Commit Graph
5962 Commits
Author SHA1 Message Date
Cristian Tuns d0272b92b7 Backed out 8 changesets (bug 1651518, bug 1883847) dt failures in nsTArray.h. CLOSED TREE
Backed out changeset 481558275c1d (bug 1651518)
Backed out changeset 5337435e8bca (bug 1651518)
Backed out changeset 8fe0c1a4da7f (bug 1651518)
Backed out changeset 840a0d9db260 (bug 1651518)
Backed out changeset eaab9de5819d (bug 1651518)
Backed out changeset cf71de92d782 (bug 1651518)
Backed out changeset d778691464db (bug 1651518)
Backed out changeset af28e5f719e8 (bug 1883847)
2024-05-22 09:02:19 -04:00
Alexandre Poirot 76d52e829a Bug 1651518 - [devtools] Enable server side worker targets for browser toolbox. r=devtools-reviewers,nchevobbe
Note that the ignore code for subprocess is being ported from the legacy worker watcher.

The Worker Target URL is now correctly set to the Absolute URL,
this has an impact on the context selector as we are displaying it.

Also, this patch highlights some issues around Common JS Loader and the distinct compartment
to be used when debugging privileged page, or when running the browser toolbox.
It caused leaks when running browser toolbox tests in debug builds.
The JS Process Actor is directly loaded in a distinct global and compartment "DevTools global",
thanks to `loadInDevToolsLoader` flag of BrowserToolboxDevToolsProcess JS Process Actor configuration.
There is no need to use `useDistinctSystemPrincipalLoader` helper as Loader.sys.mjs, loaded from
the JS Process Actor will also be loaded in the distinct global.
Then, we only need to ensure that the CommonJS Loader will also pick up the "DevTools global"
when it is loaded in that distinct global.
Things will be significantly easier once we migrate from CommonJS to ESM as the `{ global: "contextual" }`
option passed to `ChromeUtils.importESModule` will do the right thing, as well as static `import` statements.

Differential Revision: https://phabricator.services.mozilla.com/D204874
2024-05-22 11:50:45 +00:00
Alexandre Poirot adc974e7f1 Bug 1651518 - [devtools] Ensure cleaning up workers which are destroyed during their initilization. r=devtools-reviewers,nchevobbe
We may unwatch for workers, while the creation of the target actor is still ongoing.

Differential Revision: https://phabricator.services.mozilla.com/D210367
2024-05-22 11:50:45 +00:00
Alexandre Poirot 93312eab5a Bug 1651518 - [devtools] Ensure destroying active target actors on toolbox closing. r=devtools-reviewers,nchevobbe
The cleanup work done from didDestroy was only calling `unwatch` on the Watcher classes,
which was typically unregistering the platform listeners.
We were missing calling `destroyTargetsForWatcher` on them which is meant to destroy
the target actors, which can also register platform listeners and be leaking data.

Differential Revision: https://phabricator.services.mozilla.com/D210366
2024-05-22 11:50:45 +00:00
Alexandre Poirot e9c4e8ed6b Bug 1651518 - [devtools] Unregister the JS Process Actor only on watcher actor destruction. r=devtools-reviewers,nchevobbe
Stop unregistering the JS Process actor when removing the last watched target/resource type.
Instead only unregister it when the Watcher Actor is destroyed.

It prevents some race condition where unwatch request (which aren't awaited for)
unregister the actor late and the next test/next toolbox opening would have its actor
unregistered by late destruction code related to the previously closed toolbox.

Differential Revision: https://phabricator.services.mozilla.com/D210365
2024-05-22 11:50:44 +00:00
Alexandre Poirot 34e5032104 Bug 1651518 - [devtools] Ensure spawning DistinctSystemPrincipalLoader.sys.mjs only once. r=devtools-reviewers,nchevobbe
This is important to spawn this ESM only once between regular and browser toolbox,
and especially between various callsites used by the browser toolbox.
Otherwise we may start loading modules in two distinct system loaders
and may have inconsistancies when using `instanceof`.

Differential Revision: https://phabricator.services.mozilla.com/D207432
2024-05-22 11:50:44 +00:00
Alexandre Poirot ffda34f517 Bug 1883847 - [devtools] Add support for server side SHARED_WORKER target support. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D204873
2024-05-22 11:50:43 +00:00
Cristina Horotan ca70119cfa Backed out 8 changesets (bug 1651518, bug 1883847) for causing damp failures at toolbox/browser-toolbox.js CLOSED TREE
Backed out changeset 4ec70db12f48 (bug 1651518)
Backed out changeset b2b138889ad6 (bug 1651518)
Backed out changeset efda5c09b0ea (bug 1651518)
Backed out changeset b0de4113f8fb (bug 1651518)
Backed out changeset 03cf235d2a80 (bug 1651518)
Backed out changeset 58e71c27f1fd (bug 1651518)
Backed out changeset f7fb390c3965 (bug 1651518)
Backed out changeset b8a2473c47c0 (bug 1883847)
2024-05-22 04:00:53 +03:00
Alexandre Poirot 64b2f242bc Bug 1651518 - [devtools] Enable server side worker targets for browser toolbox. r=devtools-reviewers,nchevobbe
Note that the ignore code for subprocess is being ported from the legacy worker watcher.

Also, this patch highlights some issues around Common JS Loader and the distinct compartment
to be used when debugging privileged page, or when running the browser toolbox.
It caused leaks when running browser toolbox tests in debug builds.
The JS Process Actor is directly loaded in a distinct global and compartment "DevTools global",
thanks to `loadInDevToolsLoader` flag of BrowserToolboxDevToolsProcess JS Process Actor configuration.
There is no need to use `useDistinctSystemPrincipalLoader` helper as Loader.sys.mjs, loaded from
the JS Process Actor will also be loaded in the distinct global.
Then, we only need to ensure that the CommonJS Loader will also pick up the "DevTools global"
when it is loaded in that distinct global.
Things will be significantly easier once we migrate from CommonJS to ESM as the `{ global: "contextual" }`
option passed to `ChromeUtils.importESModule` will do the right thing, as well as static `import` statements.

Differential Revision: https://phabricator.services.mozilla.com/D204874
2024-05-21 14:09:35 +00:00
Alexandre Poirot 5aee0c27f5 Bug 1651518 - [devtools] Ensure cleaning up workers which are destroyed during their initilization. r=devtools-reviewers,nchevobbe
We may unwatch for workers, while the creation of the target actor is still ongoing.

Differential Revision: https://phabricator.services.mozilla.com/D210367
2024-05-21 14:09:35 +00:00
Alexandre Poirot 2adafe588e Bug 1651518 - [devtools] Ensure destroying active target actors on toolbox closing. r=devtools-reviewers,nchevobbe
The cleanup work done from didDestroy was only calling `unwatch` on the Watcher classes,
which was typically unregistering the platform listeners.
We were missing calling `destroyTargetsForWatcher` on them which is meant to destroy
the target actors, which can also register platform listeners and be leaking data.

Differential Revision: https://phabricator.services.mozilla.com/D210366
2024-05-21 14:09:34 +00:00
Alexandre Poirot fd464b4d95 Bug 1651518 - [devtools] Unregister the JS Process Actor only on watcher actor destruction. r=devtools-reviewers,nchevobbe
Stop unregistering the JS Process actor when removing the last watched target/resource type.
Instead only unregister it when the Watcher Actor is destroyed.

It prevents some race condition where unwatch request (which aren't awaited for)
unregister the actor late and the next test/next toolbox opening would have its actor
unregistered by late destruction code related to the previously closed toolbox.

Differential Revision: https://phabricator.services.mozilla.com/D210365
2024-05-21 14:09:34 +00:00
Alexandre Poirot 3d2406db93 Bug 1651518 - [devtools] Ensure spawning DistinctSystemPrincipalLoader.sys.mjs only once. r=devtools-reviewers,nchevobbe
This is important to spawn this ESM only once between regular and browser toolbox,
and especially between various callsites used by the browser toolbox.
Otherwise we may start loading modules in two distinct system loaders
and may have inconsistancies when using `instanceof`.

Differential Revision: https://phabricator.services.mozilla.com/D207432
2024-05-21 14:09:33 +00:00
Alexandre Poirot 91b22a2ea0 Bug 1883847 - [devtools] Add support for server side SHARED_WORKER target support. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D204873
2024-05-21 14:09:32 +00:00
Tamas Szentpeteri 03c9e65872 Backed out 2 changesets (bug 1897619) for causing wpt failures on position-anchor-basics.html
Backed out changeset d1e736673f03 (bug 1897619)
Backed out changeset 62489eeeb03e (bug 1897619)
2024-05-21 18:53:31 +03:00
Jonathan Watt e3ca566fd8 Bug 1897619. Implement parsing of CSS 'position-anchor' property. r=emilio,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D210880
2024-05-21 10:12:22 +00:00
Jonathan Watt 26c49a3375 Bug 1897605. Implement parsing of CSS 'anchor-scope'. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D210874
2024-05-18 16:47:28 +00:00
Jonathan Watt ea5cbc487d Bug 1897405 p1. Implement parsing of CSS 'anchor-name'. r=emilio,devtools-reviewers,firefox-style-system-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D210787
2024-05-18 16:47:27 +00:00
Alexandre Poirot 5506678bac Bug 1896592 - [devtools] Better handle file:// requests. r=devtools-reviewers,bomsy
Error were thrown when trying to fetch headers and cookies, which was preventing inspecting them fully.

Fixing that, enable seeing about:neterror requests which were trigerring a file:// URI request (at least on local builds).
So that we now have to explicitly ignore these error requests.

Differential Revision: https://phabricator.services.mozilla.com/D210319
2024-05-16 08:30:22 +00:00
Nicolas Chevobbe 3b36e62d91 Bug 1844446 - [devtools] Don't use desugared selectors for selector highlighter. r=devtools-reviewers,bomsy.
Instead, we use the new CSSStyleRule.querySelectorAll method to retrieve the
elements to highlight.
We still compute a "selector", which is basically a concatenation of the
ancestor rules, so we can still mark the rule as highlighted when we display a
different StyleRule front for a rule that was previously highlighted.

Differential Revision: https://phabricator.services.mozilla.com/D208364
2024-05-14 06:19:43 +00:00
Nicolas Chevobbe 7e3ff18292 Bug 1844446 - [devtools] Send rules matching selectors indexes instead of the selector strings. r=devtools-reviewers,bomsy.
This is done to avoid a performance issue with deeply nested rules,
where computing the desugared selector can be super expensive.
This should help overall since we're doing a bit less work, as well
as returning smaller data.

Differential Revision: https://phabricator.services.mozilla.com/D207727
2024-05-14 06:19:43 +00:00
Nicolas Chevobbe 468323a509 Bug 1888645 - [devtools] Fix SmartTrace crash with wasm frames. r=devtools-reviewers,bomsy.
In some cases, we were getting null sourceId, which was causing an exception
to be thrown in `getFormattedSourceId` since it expects a string.
We add a simple guard in this function so we don't throw anymore.

But we shouldn't get null sourceId in the first place. It looks like for
some Wasm sources, the SavedFrame sourceId can be 0, which wasn't playing
well with some loose check we were doing in the sources manager.

Finally, the "Copy metadata" button we display when a console message crash
wasn't working. The message now includes the targetFront, which can be serialized
in JSON, so we simply ignore it.

Differential Revision: https://phabricator.services.mozilla.com/D206105
2024-05-13 10:17:15 +00:00
Tooru Fujisawa 93e31d8b1f Bug 1893611 - Add shouldAvoidSideEffects debugger flag and use it in Services resolve hook. r=iain,devtools-reviewers,nchevobbe
In order to abort eager evaluation when executing a resolve hook with side-effect,
especially the Services' hook which imports ES module, which is not undo-able,
introduce a dedicate debugger flag to ask to avoid side-effectful operation in
the resolve hook.

Differential Revision: https://phabricator.services.mozilla.com/D208970
2024-05-08 10:56:39 +00:00
Tooru Fujisawa 6539dc6484 Bug 1895128 - Ignore dead wrapper when adding debuggee. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D209499
2024-05-08 10:56:38 +00:00
Nicolas Chevobbe d604cfb8b7 Bug 1894603 - [devtools] Display nested keyframes rules in the Rules view. r=devtools-reviewers,bomsy.
Recursively traverse css rules so we can collect
keyframes rules nested in other rules, which should
behave as regular rules.
We also don't collect ancestor rules for keyframe rules,
as they can only be direct child of @keyframes rules, and
we'd rather display the @keyframes ancestor data at some
point.

Differential Revision: https://phabricator.services.mozilla.com/D209354
2024-05-06 05:21:44 +00:00
Stanca Serban e06a6821a9 Backed out changeset 797adb0dd49c (bug 1893611) for causing dt failures in browser_console_eager_eval_resolve.js. 2024-05-04 05:31:43 +03:00
Tooru Fujisawa 8202ca9760 Bug 1893611 - Add shouldAvoidSideEffects debugger flag and use it in Services resolve hook. r=iain,devtools-reviewers,nchevobbe
In order to abort eager evaluation when executing a resolve hook with side-effect,
especially the Services' hook which imports ES module, which is not undo-able,
introduce a dedicate debugger flag to ask to avoid side-effectful operation in
the resolve hook.

Differential Revision: https://phabricator.services.mozilla.com/D208970
2024-05-03 20:06:38 +00:00
Nicolas Chevobbe 4db84a5386 Bug 1893644 - [devtools] Display ::backdrop rules for popover elements. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D208746
2024-05-02 14:17:13 +00:00
Henrik Skupin a05a1f4dca Bug 1892248 - [devtools] Remove backward compatibility code for Firefox 127. r=devtools-backward-compat-reviewers,devtools-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D209198
2024-05-02 11:48:36 +00:00
Nicolas Chevobbe 1ba466a342 Bug 1892459 - [devtools] Add textInput in event listener breakpoints panel. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D208857
2024-05-02 04:58:51 +00:00
Nazım Can Altınova bcc392d1bf Bug 1817163 - Add a profiler feature for memory tracking to enable the memory hooks r=profiler-reviewers,perftest-reviewers,android-reviewers,kshampur,aabh,gl
This feature is added as "recommended", and added to every presets. This will
allow us to disable it if we really want to.

If the "native allocations" feature is enabled, we still force the installation
of the memory hooks even if we don't have this feature to not break the native
allocations feature.

Differential Revision: https://phabricator.services.mozilla.com/D206789
2024-04-30 10:35:47 +00:00
Norisz Fay cef69f9836 Backed out changeset dc425d760d09 (bug 1817163) for causing dt failures on browser_interaction-between-interfaces.js CLOSED TREE 2024-04-29 18:54:49 +03:00
Nazım Can Altınova 23911eb488 Bug 1817163 - Add a profiler feature for memory tracking to enable the memory hooks r=profiler-reviewers,perftest-reviewers,android-reviewers,kshampur,aabh,gl
This feature is added as "recommended", and added to every presets. This will
allow us to disable it if we really want to.

If the "native allocations" feature is enabled, we still force the installation
of the memory hooks even if we don't have this feature to not break the native
allocations feature.

Differential Revision: https://phabricator.services.mozilla.com/D206789
2024-04-29 14:57:37 +00:00
Nicolas Chevobbe 5532aef13b Bug 1892895 - [devtools] Remove JS CSS Lexer. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D208318
2024-04-26 09:18:12 +00:00
Nicolas Chevobbe af92c0b814 Bug 1892897 - [devtools] Use InspectorCSSParser in getSelectorOffsets. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D208317
2024-04-26 09:18:11 +00:00
Nazım Can Altınova e67904bb08 Bug 1893433 - Fix some eslint warnings in the performance devtools codebase r=julienw,profiler-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D208607
2024-04-26 08:39:24 +00:00
Alexandre Poirot 424ff91ac8 Bug 1892905 - [devtools] Ensure tracing DOM Events for same-process iframe. r=devtools-reviewers,nchevobbe
The previous patch explicitly prevents spawning JavaScriptTracer for same-process iframe,
as the JavaScriptTracer can only be spawn once per thread.
But then the JavaScriptTracer should ensure tracking DOM Events for these same-process iframe globals.
`DebuggerNotificationObserver` requires to connect to each individual WindowGlobal.
Connecting to the top WindowGlobal isn't enough to receive DOM Events for children WindowGlobals.

Differential Revision: https://phabricator.services.mozilla.com/D208468
2024-04-25 11:26:23 +00:00
Alexandre Poirot 90e9825752 Bug 1892905 - [devtools] Prevent exception when tracing a document with same-process iframes. r=devtools-reviewers,nchevobbe
The JavaScriptTracer class for now only supports being instantiated once per thread.
So that we shouldn't try to instantiate it for WindowGlobal/<iframe> that run in the same
process as their parent document. The `isProcessRoot` will be true for the top document
and false for children running in the same process as their parent document.

Also address a noisy exception happening when debugging Google Doc.

Differential Revision: https://phabricator.services.mozilla.com/D208321
2024-04-25 11:26:22 +00:00
Nicolas Chevobbe 9b1522fec0 Bug 1868732 - [devtools] Add tests for ::target-text pseudo elements. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D206507
2024-04-24 12:28:42 +00:00
Nicolas Chevobbe aa3c3bbfed Bug 1555498 - [devtools] Avoid calling hasEventListeners on nodes without event badges. r=devtools-reviewers,ochameau.
Also cache the result of hasEventListeners.

Differential Revision: https://phabricator.services.mozilla.com/D201197
2024-04-23 08:40:57 +00:00
Nicolas Chevobbe 63edda6163 Bug 1555498 - [devtools] Speedup event-collector hasListeners. r=devtools-reviewers,ochameau.
Avoid creating arrays and limit cross-compartment accesses.

Differential Revision: https://phabricator.services.mozilla.com/D200912
2024-04-23 08:40:57 +00:00
Alexandre Poirot efc7f2859d Bug 1890247 - [devtools] Prevent leaking WindowGlobal target actor via LazyPool. r=devtools-reviewers,nchevobbe
We shouldn't try to request target actor's form late during the destroy sequence.
This would force to re-create the Lazy Target Scoped Actors via LazyPool,
which would ultimately force to re-instantiate a new _targetScopedActorsPool
which wouldn't be destroyed as it is created post-destruction.

Avoid re-instantiating the target scoped actors when we detect that the actor is being destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D207487
2024-04-17 11:57:02 +00:00
Nicolas Chevobbe e9fe2d28bd Bug 1888615 - [devtools] Use InspectorCSSParser in _collectAttributesFromRule. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D206100
2024-04-16 12:12:00 +00:00
Aron Cseh 12dda8a2c9 Backed out 5 changesets (bug 1888615, bug 1889871, bug 1888609, bug 1888353, bug 1888363) for causing dt failures on browser_webconsole_location_styleeditor_link.js CLOSED TREE
Backed out changeset ef8e96126716 (bug 1889871)
Backed out changeset a68f24368621 (bug 1888615)
Backed out changeset 1783cd63d2c4 (bug 1888609)
Backed out changeset 62333a10235e (bug 1888363)
Backed out changeset 03888776c90d (bug 1888353)
2024-04-16 13:18:32 +03:00
Nicolas Chevobbe 182a88983e Bug 1888615 - [devtools] Use InspectorCSSParser in _collectAttributesFromRule. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D206100
2024-04-16 07:39:37 +00:00
Nicolas Chevobbe 0d8b0e1ce6 Bug 1889500 - [devtools] Return deepest element in _findNodeAtMouseEventPosition. r=devtools-reviewers,jdescottes.
When picking nodes while holding Shift, we're calling
nodesFromRect, which returns a list of nodes, in no
particular order.
Instead of randomly picking the first one in the list,
return the first one that is not a parent of any of the
other matching elements.
This should potentially give us the deepest element (even
if in some situation we might miss "deeper" nodes from other
branches than the first "only child").

Differential Revision: https://phabricator.services.mozilla.com/D207256
2024-04-15 12:44:19 +00:00
Tamas Szentpeteri 327fe30bef Backed out changeset f5267fdb3020 (bug 1889500) for causing dt failures in browser_inspector_picker-shift-key.js. CLOSED TREE. 2024-04-15 14:33:03 +03:00
Nicolas Chevobbe dbf2380122 Bug 1889500 - [devtools] Return deepest element in _findNodeAtMouseEventPosition. r=devtools-reviewers,jdescottes.
When picking nodes while holding Shift, we're calling
nodesFromRect, which returns a list of nodes, in no
particular order.
Instead of randomly picking the first one in the list,
return the first one that is not a parent of any of the
other matching elements.
This should potentially give us the deepest element (even
if in some situation we might miss "deeper" nodes from other
branches than the first "only child").

Differential Revision: https://phabricator.services.mozilla.com/D207256
2024-04-15 09:22:22 +00:00
Nicolas Chevobbe e98d57ec87 Bug 1890759 - [devtools] Fix event-breakpoint.js errors in worker toolbox. r=devtools-reviewers,jdescottes.
- Guard Services.prefs as this isn't available in workers
- Pass worker's global to getAvailableEventBreakpoints when in worker toolbox
- Check that global exists before checking property on it

Differential Revision: https://phabricator.services.mozilla.com/D207257
2024-04-11 14:34:53 +00:00
Nicolas Chevobbe 6a315df242 Bug 1890775 - [devtools] Fix get_byte_index_from_line_and_column line index computation. r=layout-reviewers,devtools-reviewers,emilio.
We were getting a line byte index for the
actual char matching the line we want, but
we actually need the index _after_ that
new line char.
A test case is added to cover this fix.

Differential Revision: https://phabricator.services.mozilla.com/D207156
2024-04-11 12:57:38 +00:00