Commit Graph
5946 Commits
Author SHA1 Message Date
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
Nathan LaPre a337b03937 Bug 1849160 - Part 4: Update tests in light of new ancestor role requirements, r=Jamie,devtools-reviewers,nchevobbe,geckoview-reviewers,ohall
This revision updates newly-failing tests after implementing the ancestor
requirements for certain child roles. Generally, this revision adds ancestors
where appropriate, because tests largely are not testing this particular
behavior.

Differential Revision: https://phabricator.services.mozilla.com/D205880
2024-04-10 17:22:14 +00:00
Julian Descottes 1c858ccd09 Bug 1890715 - [devtools] Fix type error thrown when debugging xpcshell tests r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D207109
2024-04-10 11:53:30 +00:00
Nicolas Chevobbe e4ea58dcbc Bug 1890115 - [devtools] Fix call to createWorkerTargetActor in ServiceWorkerTargetWatcherClass. r=bomsy,devtools-reviewers.
The call didn't match the function signature

Differential Revision: https://phabricator.services.mozilla.com/D206900
2024-04-09 11:46:35 +00:00
Nicolas Chevobbe 3f151d357e Bug 1882964 - [devtools] Turn getRuleBodyTextOffsets into getRuleBodyText for easier unicode chars handling. r=layout-reviewers,devtools-reviewers,emilio,ochameau.
`InspectorUtils.getRuleBodyTextOffset` was returning bytes position, and we
were using them directly in Javascript `substring`, which causes problem
with non-ascii chars.
Instead of returning offsets to compute the rule string, we directly return
the string from InspectorUtils which is easier to work with.

Differential Revision: https://phabricator.services.mozilla.com/D204523
2024-04-08 08:37:14 +00:00
Nicolas Chevobbe 2644f82de7 Bug 1882964 - [devtools] Add InspectorUtils.replaceBlockRuleBodyTextInStylesheet. r=layout-reviewers,devtools-reviewers,emilio,ochameau.
The next patch modifies `getRuleText` so it only returns the text, and no
longer the offset at which the rule starts.
The only consumer of the returned offset was in `StyleRuleActor#setRuleText`,
so we migrate this directly to a InspectorUtils method to avoid mixing JS string
indexes with Rust bytes position.

Differential Revision: https://phabricator.services.mozilla.com/D204522
2024-04-08 08:37:13 +00:00
Tooru Fujisawa dc207f0ffb Bug 1887687 - Reflect global option to reject-multiple-getters-calls rule. r=Standard8,frontend-codestyle-reviewers,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D206460
2024-04-05 15:35:57 +00:00
Jan-Niklas Jaeschke dbaf47b1f4 Bug 1867939, part 4: Implemented the ::target-text CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-04 14:39:32 +00:00
Alexandre Poirot 9a8140af9d Bug 1888899 - [devtools] Fix ESM imports from tab descriptor module. r=devtools-reviewers,nchevobbe
The test weren't spawning the DevToolsServer the same way as in production.
--start-debugger-server spawns the server in the distinct devtools global in order to be able to debug privileged compartment.

Differential Revision: https://phabricator.services.mozilla.com/D206497
2024-04-04 09:21:12 +00:00
Stanca Serban ce5dc60809 Backed out 6 changesets (bug 1867939) for causing wpt failures in target-text-010.html. CLOSED TREE
Backed out changeset 44101c258e52 (bug 1867939)
Backed out changeset c53267e1b460 (bug 1867939)
Backed out changeset 0748839408e5 (bug 1867939)
Backed out changeset 38631fbd2f2f (bug 1867939)
Backed out changeset d77b9257c842 (bug 1867939)
Backed out changeset 0d269b891421 (bug 1867939)
2024-04-04 00:50:50 +03:00
Jan-Niklas Jaeschke 3f695f17a9 Bug 1867939, part 4: Implemented the ::target-text CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-03 15:23:02 +00:00
Sandor Molnar 000124e596 Merge mozilla-central to autoland. a=merge 2024-04-03 17:47:38 +03:00
Sandor Molnar 7a867184d3 Backed out 6 changesets (bug 1867939) for causing a top crash in nightly Bug 1889393 CLOSED TREE
Backed out changeset 2110f57e928c (bug 1867939)
Backed out changeset 51890598ecb4 (bug 1867939)
Backed out changeset 839bc1b11a2c (bug 1867939)
Backed out changeset bb88c4d09e82 (bug 1867939)
Backed out changeset 27c76e65cf58 (bug 1867939)
Backed out changeset c3e3c81f9ceb (bug 1867939)
2024-04-03 17:31:56 +03:00
Nicolas Chevobbe b5c469f519 Bug 1888081 - [devtools] Don't call setStyleSheetText from StyleRuleActor#setRuleText if the stylesheet text doesn't actually change. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D205799
2024-04-03 07:53:53 +00:00
Nicolas Chevobbe e78c7f3d05 Bug 1888079 - [devtools] Don't call getStyleSheetRuleCountAndAtRules in setStyleSheetText when it's not needed. r=devtools-reviewers,ochameau.
When we modify a rule from the inspector, the number of rules and the at-rules
data can't be impacted, so avoid computing this costly information.

Differential Revision: https://phabricator.services.mozilla.com/D205798
2024-04-03 07:53:52 +00:00
Emilio Cobos Álvarez dadf0fbdef Bug 1888242 - Simplify viewport handling in RDM. r=bradwerth,devtools-reviewers,ochameau
In particular:

 * Always handle meta viewport in RDM. This fixes bug 1625999 too by
   making touch simulation enabled and disabled consistent.

 * Restore the resolution to 1 when toggling RDM. This is just simpler,
   and we're not keeping around the visual viewport offsets anyways
   so...

 * Deal with the change more easily, at the same point we switch
   scrollbars etc.

Differential Revision: https://phabricator.services.mozilla.com/D206266
2024-04-02 15:21:04 +00:00
Jan-Niklas Jaeschke f46900e678 Bug 1867939, part 4: Implemented the ::target-text CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-02 13:44:25 +00:00