Commit Graph
109 Commits
Author SHA1 Message Date
Julian Descottes 90bb6ad318 Bug 1914863 - [devtools] Remove windowUtils cache in layout/utils.js r=devtools-reviewers,nchevobbe
This cache might keep destroyed windowUtils helpers in some scenarios involving navigations with a process change.
The regular getter is slightly slower, but the performance hit should not be noticeable.

Differential Revision: https://phabricator.services.mozilla.com/D220785
2024-09-02 09:47:14 +00:00
Tooru Fujisawa 571e7ae7b8 Bug 1875639 - Part 2: Explicitly use contextual loader in files loaded into DevTools global. r=ochameau,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D199467
2024-02-20 04:49:57 +00:00
Tom Schuster dbc5458a42 Bug 1409200 - Use nsILoadInfo for nsIContentSecurityPolicy::ShouldLoad. r=freddyb
Differential Revision: https://phabricator.services.mozilla.com/D179823
2023-06-09 18:39:59 +00:00
Norisz Fay bd48e8269c Backed out 3 changesets (bug 1409200) as requested by dev
Backed out changeset ea10214aa35f (bug 1409200)
Backed out changeset a66ea7d7f812 (bug 1409200)
Backed out changeset e8a83b1e7e08 (bug 1409200)
2023-06-09 15:11:48 +03:00
Tom Schuster 22e7e4c20b Bug 1409200 - Use nsILoadInfo for nsIContentSecurityPolicy::ShouldLoad. r=freddyb
Differential Revision: https://phabricator.services.mozilla.com/D179823
2023-06-09 07:52:50 +00:00
Mark Banner 40de601f11 Bug 1834176 - Convert consumers of NetUtil.jsm to import the ES module directly. r=arai,webdriver-reviewers,perftest-reviewers,valentin,extension-reviewers,devtools-reviewers,sync-reviewers,cookie-reviewers,robwu,afinder,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D178589
2023-06-07 08:42:36 +00:00
Natalia Csoregi 1b67d0b941 Backed out 3 changesets (bug 1834222, bug 1834176) for causing RemoteProcessMonitor failures. CLOSED TREE
Backed out changeset 346d3a1568dd (bug 1834222)
Backed out changeset ea1d8b634bfc (bug 1834176)
Backed out changeset 74d1880272d3 (bug 1834176)
2023-05-24 04:29:45 +03:00
Mark Banner d1fc869252 Bug 1834176 - Convert NetUtil.jsm to be an ES system module. r=arai,webdriver-reviewers,perftest-reviewers,valentin,extension-reviewers,devtools-reviewers,sync-reviewers,cookie-reviewers,robwu,afinder,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D178589
2023-05-23 19:09:29 +00:00
Noemi Erli 1f146f097e Backed out 2 changesets (bug 1834176) for causing xpc failures in test_unload.js CLOSED TREE
Backed out changeset 57876d77a652 (bug 1834176)
Backed out changeset ae2f0837b528 (bug 1834176)
2023-05-23 12:14:37 +03:00
Mark Banner 08ff6c0ad9 Bug 1834176 - Convert NetUtil.jsm to be an ES system module. r=arai,webdriver-reviewers,perftest-reviewers,valentin,extension-reviewers,devtools-reviewers,sync-reviewers,cookie-reviewers,robwu,afinder,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D178589
2023-05-23 08:13:08 +00:00
Emilio Cobos Álvarez 6871ba033a Bug 1825825 - Remove unused whatToShow option from devtools inspector walker. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
It's always SHOW_ALL, and it doesn't work anyways, see the treewalker impl.

Differential Revision: https://phabricator.services.mozilla.com/D174490
2023-04-04 08:56:37 +00:00
Emilio Cobos Álvarez 82ee3ddc29 Bug 1817381 - Ignore OS zoom in devtools. r=devtools-reviewers,nchevobbe
What devtools wants to do is ignoring the website-specific zoom.

It seems KDE 5.27 on X11 uses the text scale factor to implement scaling
of GTK apps completely (including Firefox), rather than the global
integer GTK scaling combined with it.

This makes this difference way more obvious than it otherwise would.

Differential Revision: https://phabricator.services.mozilla.com/D170195
2023-02-20 16:35:04 +00:00
Cristina Horotan fbc15256c2 Backed out changeset 9d6e541704c3 (bug 1817381) for causing multiple dt failures on a CLOSED TREE 2023-02-20 11:00:48 +02:00
Emilio Cobos Álvarez a02f063ed4 Bug 1817381 - Ignore OS zoom in devtools. r=devtools-reviewers,nchevobbe
What devtools wants to do is ignoring the website-specific zoom.

It seems KDE 5.27 on X11 uses the text scale factor to implement scaling
of GTK apps completely (including Firefox), rather than the global
integer GTK scaling combined with it.

This makes this difference way more obvious than it otherwise would.

Differential Revision: https://phabricator.services.mozilla.com/D170195
2023-02-20 08:01:42 +00:00
Alexandre Poirot 07e6ce0083 Bug 1792848 - [devtools] Use absolute URLs to import modules in devtools/shared. r=Honza,devtools-backward-compat-reviewers,bomsy
Differential Revision: https://phabricator.services.mozilla.com/D158643
2022-10-12 15:56:22 +00:00
Alexandre Poirot 59fe57c052 Bug 1793396 - [devtools] Use absolute URLs in all usages of loader.lazyRequireGetter. r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D158489
2022-10-03 18:57:13 +00:00
Alexandre Poirot acb64f5211 Bug 1791969 - [devtools] Migrate lazyRequireGetter for JSM to ChromeUtils.defineModuleGetter. r=jdescottes
There was some imports of sys.mjs which I migrated to `ChromeUtils.defineESModuleGetters`.

Differential Revision: https://phabricator.services.mozilla.com/D158129
2022-09-28 16:20:08 +00:00
Alexandre Poirot 0c4e317914 Bug 1789980 - [devtools] Migrate all callsites using require("chrome") to use Components.* global symbols. r=jdescottes,perftest-reviewers,AlexandruIonescu
This will help transition to ES Modules as we won't be able to expose a magic "chrome" ESM.
Also, most of these symbols are exposed as global already.
All but:
* `components` which is `Components`,
* `CC` which is `Components.Constructor`,
* `Cm` which is `Components.manager`.

$ sed -ie "/require(.chrome.)/d" $(git grep -l 'require("chrome")' devtools/)
+ manual edits for all three exceptions

Differential Revision: https://phabricator.services.mozilla.com/D156936
2022-09-20 12:52:27 +00:00
Alexandre Poirot 86c7a14e62 Bug 1789202 - [devtools] Expose ChromeUtils as a global to all DevTools modules. r=perftest-reviewers,nchevobbe,AlexandruIonescu
This will help transition to ES Modules as this symbol is exposed to them.

$ sed -ie "/require(.ChromeUtils.)/d" $(git grep -l 'require("ChromeUtils")' devtools/)
$ sed -ie "/loader.lazyRequireGetter(this, .ChromeUtils./d" $(git grep -l 'loader.lazyRequireGetter(this, "ChromeUtils"' devtools/)
+ the edition of builtin-modules.js + eslintrc.js + manual eslint fixes

Differential Revision: https://phabricator.services.mozilla.com/D156402
2022-09-09 07:22:51 +00:00
Kagami Sascha Rosylight 4fb733cb3b Bug 1773740 - Part 4: Reapply mach -l eslint --fix with use-isInstance changes r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D148939
2022-06-27 20:31:34 +00:00
Nicolas Chevobbe 20b32fe2c2 Bug 1755266 - [devtools] Fix isFrameWithChildTarget for frame element. r=jdescottes.
We do create dedicated targets for frame documents, but
in isFrameWithChildTarget, we were only checking if the
passed element was an iframe, making some area of the code
not behaving correctly (e.g. using the node picker, or
the Inspect Element context menu entry).
This patch fixes this and add a test case to make sure we
don't regress.

Differential Revision: https://phabricator.services.mozilla.com/D140041
2022-03-02 15:39:54 +00:00
Nicolas Chevobbe 29b70093c5 Bug 1752342 - [devtools] Fix isFrameWithChildTarget for iframe blocked by CSP. r=jdescottes.
The function was returning true as long as the passed element
was an iframe and EFT was enabled.
But if the passed iframe was blocked by a CSP rule, it would
still return true, although we wouldn't actually have a dedicated
document, nor a target, for that iframe, which would lead to
issues in the inspector when trying to fetch the iframe children.
We fix this by adding a new `isFrameBlockedByCSP` util, which  uses
`nsIContentPolicy#shouldLoad` with the iframe url so we can check if the iframe
is blocked by CSP, and in such case, return false.
We're also using this new function in the `NodeActor#form` method to set a `numChildren`
of `0` when the iframe is blocked (so in the inspector, the expand icon will be
hidden for the element), as well as in `WalkerActor#_getChildren` to return an
empty array when called with an iframe blocked by CSP.

A new test is added to check the iframe nodeFront properties and usage of
`WalkerFront#children` with those. We allow to set a specific pref to bypass
the guard in the children method in order to properly check that the root issue
of a given bug was fixed.

Differential Revision: https://phabricator.services.mozilla.com/D137667
2022-02-03 17:48:32 +00:00
Nicolas Chevobbe 3226a027ac Bug 1730167 - [devtools] Use appropriate walker front to retrieve frame children when EFT is enabled. r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D126064
2021-10-01 16:24:49 +00:00
Cristian Tuns cba9e321e0 Backed out 9 changesets (bug 1733039, bug 1730167, bug 1732334, bug 1730170, bug 1730162, bug 1732690, bug 1732906) for causing mochitest failures. CLOSED TREE
Backed out changeset bf18a96d849f (bug 1733039)
Backed out changeset f2419a8c8c5f (bug 1732906)
Backed out changeset 3ff8cca764f1 (bug 1732690)
Backed out changeset 1107e4f2779f (bug 1732334)
Backed out changeset 090410cf3b8c (bug 1730170)
Backed out changeset d253c4bf94ac (bug 1730162)
Backed out changeset 6075634c3db2 (bug 1730167)
Backed out changeset 11370a6988be (bug 1730167)
Backed out changeset 6f2825300e65 (bug 1730167)
2021-10-01 06:23:01 -04:00
Nicolas Chevobbe 7d8322d0ea Bug 1730167 - [devtools] Use appropriate walker front to retrieve frame children when EFT is enabled. r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D126064
2021-10-01 08:19:27 +00:00
Nicolas Chevobbe 8b8b5492b4 Bug 1731996 - [devtools] Fix nodePicker on remote iframe padding. r=ochameau.
With Fission enabled, hovering the padding area of an iframe would not cause the
iframe element to be highlighted.
That's because we were deliberately ignoring any event on remote frames, as we
thought the sub-document picker would take care of this.
We fix this by only checking if the event was fired on a window managed by the
target actor.

An existing test is modified to make it a Fission test case, and a few helper
for highlighterTestFront had to be modified.

Differential Revision: https://phabricator.services.mozilla.com/D126472
2021-09-28 05:16:22 +00:00
Butkovits Atila 14626e55c3 Backed out 3 changesets (bug 1731996) for causing failures at browser_jsterm_completion_dollar_zero.js. CLOSED TREE
Backed out changeset 4ed31d5ab47e (bug 1731996)
Backed out changeset feab28354d4a (bug 1731996)
Backed out changeset 0f9fe1b2b4e2 (bug 1731996)
2021-09-27 15:43:14 +03:00
Nicolas Chevobbe 85e8207217 Bug 1731996 - [devtools] Fix nodePicker on remote iframe padding. r=ochameau.
With Fission enabled, hovering the padding area of an iframe would not cause the
iframe element to be highlighted.
That's because we were deliberately ignoring any event on remote frames, as we
thought the sub-document picker would take care of this.
We fix this by only checking if the event was fired on a window managed by the
target actor.

An existing test is modified to make it a Fission test case, and a few helper
for highlighterTestFront had to be modified.

Differential Revision: https://phabricator.services.mozilla.com/D126472
2021-09-27 11:32:29 +00:00
Kris Maglione 688350be10 Bug 1647438: Remove nsIDOMWindowUtils.containerElement. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D81771
2020-07-02 15:03:44 +00:00
Jason Laster 3694ec93d0 Bug 1622996 - Refactor devtools codebase to use optional chaining (automated changes). r=jdescottes
Depends on D67084

Differential Revision: https://phabricator.services.mozilla.com/D67537
2020-03-19 21:13:38 +00:00
Jason Laster fdd5e7fbe2 Bug 1609815 - Remove Web Replay UI. r=loganfsmyth
Differential Revision: https://phabricator.services.mozilla.com/D60679
2020-02-10 21:03:28 +00:00
Noemi Erli b044f76822 Backed out changeset cfe2388a674e (bug 1609815) for causing TypeError in browserContext CLOSED TREE 2020-02-11 00:35:52 +02:00
Jason Laster 616dc3d1a7 Bug 1609815 - Remove Web Replay UI. r=loganfsmyth
Differential Revision: https://phabricator.services.mozilla.com/D60679
2020-02-10 21:03:28 +00:00
Andreea Pavel 021a735353 Backed out changeset c41e5432b3c5 (bug 1609815) for build bustages at JSControl.cpp on a CLOSED TREE 2020-01-23 22:34:40 +02:00
Jason Laster ff187aeac5 Bug 1609815 - Remove Web Replay UI. r=loganfsmyth
Differential Revision: https://phabricator.services.mozilla.com/D60679
2020-01-23 20:07:37 +00:00
Julian Descottes 36a9424e8a Bug 1603209 - Support remote frame targets in the omniscient browser toolbox r=ochameau
Depends on D57130

Differential Revision: https://phabricator.services.mozilla.com/D56347
2019-12-18 18:28:00 +00:00
Narcis Beleuzu b165e88aa4 Backed out 3 changesets (bug 1603209) for dt leaks at mozilla::net::AddrInfo::AddrInfo . CLOSED TREE
Backed out changeset ef521f6b57ea (bug 1603209)
Backed out changeset 56392b65466b (bug 1603209)
Backed out changeset 10769c72ba39 (bug 1603209)
2019-12-18 18:12:47 +02:00
Julian Descottes 372341a1e6 Bug 1603209 - Support remote frame targets in the omniscient browser toolbox r=ochameau
Depends on D57130

Differential Revision: https://phabricator.services.mozilla.com/D56347
2019-12-17 16:58:00 +00:00
Emilio Cobos Álvarez ff179a858e Bug 1596800 - Remove document.getBindingParent usage from devtools. r=jdescottes
This removes the concept of shadowAnonymous, which doesn't make a lot of sense,
and re-enables the shadow dom tests which were disabled when we removed the old
style system (as stylo didn't supported shadow DOM yet by then).

This is a change in behavior as you can now remove nodes from shadow DOM (no
reason you weren't able to, before).

Differential Revision: https://phabricator.services.mozilla.com/D53340
2019-11-18 20:54:10 +00:00
Gabriel Luong b73aff6dd9 Bug 1587789 - Remove isXBLAnonymous functions defined and used in the inspector. r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D50517
2019-10-24 21:05:44 +00:00
Razvan Caliman 3001fe3f31 Bug 1572651 - (Part 3) Add option for highlighters to get node position without scroll offsets. r=pbro
Depends on D47092

Given that the highlighter rendering surface is sized to the viewport of the inspected page (as opposed to the whole document), we need a way to ignore scroll offsets when getting data about the node position so the highlighter doesn't get drawn off-screen.

Differential Revision: https://phabricator.services.mozilla.com/D47094
2019-10-10 21:51:43 +00:00
Daniel Varga 6d6e829c75 Backed out 3 changesets (bug 1572651) for devtools failure at devtools/client/inspector/test/browser_inspector_highlighter-by-type.js. On a CLOSED TREE
Backed out changeset 71db1896c459 (bug 1572651)
Backed out changeset fb5863ee4d37 (bug 1572651)
Backed out changeset 5ef33867cacb (bug 1572651)
2019-10-10 18:51:17 +03:00
Razvan Caliman e21a9a1676 Bug 1572651 - (Part 3) Add option for highlighters to get node position without scroll offsets. r=pbro
Depends on D47092

Given that the highlighter rendering surface is sized to the viewport of the inspected page (as opposed to the whole document), we need a way to ignore scroll offsets when getting data about the node position so the highlighter doesn't get drawn off-screen.

Differential Revision: https://phabricator.services.mozilla.com/D47094
2019-10-10 14:15:03 +00:00
Patrick Brosset 23017b8864 Bug 1574401 - Multi-target node-picker in the browser toolbox r=rcaliman,gl,ochameau
The original plan for the node-picker to work with multiple targets was introduced in D41598 (in bug 1568825). The idea was that, because we can have multiple independent inspectable targets, and because the client is the one doing the orchestration between them, to let the client start the node picker in all targets at once.
At the time of this first change, the code was create with this in mind, but there was really just one target (the top-level one).

So, this revision introduces the real code for this. First of all, I removed the now obsolete `getAllInspectorFronts` in `node-picker.js` because we now have a similar function on the inspector front directly.

Then the main code changes to look for are on the actor side, in the `HighlighterActor`. This is where the picking actually happens.
You have to remember that several targets will be picking at the same time, and therefore several `HighlighterActor` instances will be in pick mode at the same time.
The way they allow users to pick is by listening to mouse events (mousemove and clicks essentially).
Because these actors can't see or talk to each other, one can't tell the others that the mouse is now over its content and the other pickers should pause somewhat.

So, when one of them sees that the mouse event is happening on a remote frame, then it bails out and lets events through without handling them. This is so that the embedded document (which also has a picker running) can get a chance to receive the mouse events too.

The other aspect is that each `HighlighterActor`, when picking, does its own highlighting. So if there are 3 remote frames, then there really are 3 highlighters.
So the trick is to make sure only one of them ever appears at any given time. Again, these actors can't talk to each other directly, so the client is responsible for doing this when receiving events that a node was hovered.

This is not perfect, but should normally get far better when the new fission-compatible highlighter is in place. Indeed, when that happens, we won't have to care about this anymore, there will be only one `HighlighterRenderer` for the entire tab. So even if there are multiple `HighlighterActor` instances picking, they will all be sending events to the same renderer.

The only exception is in the browser toolbox where you can inspect both the browser UI and the content UI. In this case, there will be 2 renderers: one over the entire browser window, and one over the <browser> area. So we'll still have to do the dance of hiding one when the other is shown.

Differential Revision: https://phabricator.services.mozilla.com/D42640
2019-10-08 13:47:18 +00:00
Julian Descottes 2e0e8cfcc7 Bug 1583444 - Stop using win.top in devtools/shared/layout/utils.js r=pbro
Depends on D46957

We are updating three call sites that were still relying on window.top to get the topmost window.

For `getFrameOffsets` and `getRect`, they are currently only called with a non-null `boundaryWindow` argument.
That's why this didn't trigger any regression.

For `getFrameElement`, I could only find STRs that don't have any user impact.
For instance, when the BrowserToolbox debugs a page where you open DevTools, this will load the toolbox in an iframe.
This load will trigger `onFrameLoad` in the walker actor. And because we were using `win.top`, getFrameElement would return null, and onFrameLoad will not emit mutations.
But I couldn't see any scenario where this had an actual impact for users.

Differential Revision: https://phabricator.services.mozilla.com/D46958
2019-09-30 09:53:15 +00:00
Brad Werth d2a197b2f5 Bug 1567310 Part 3: Make all devtools callers of getBoxQuads include option to suppress whitespace frames. r=gl
Differential Revision: https://phabricator.services.mozilla.com/D45120
2019-09-12 19:05:52 +00:00
Victor Porof 435f7b056d Bug 1561435 - Format remaining devtools/, a=automatic-formatting, CLOSED TREE
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35894
2019-07-05 11:29:32 +02:00
Patrick Brosset 74f4a4add4 Bug 1559257 - Removing getSameTypeRootTreeItemIgnoreBrowserBoundaries and getSameTypeParentIgnoreBrowserBoundaries usage; r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D34940
2019-06-18 15:59:29 +00:00
Brian Hackett b92f8a68f7 Bug 1497393 Part 7 - Server side changes for inspector support while replaying, r=pbro.
Differential Revision: https://phabricator.services.mozilla.com/D22863
2019-03-09 16:45:50 -10:00
Ian Moody 1d50d55bb8 Bug 1539265 - Add a few optimisations for ::marker pseudos. r=jdescottes
Where there is existing for ::before and ::after.

Differential Revision: https://phabricator.services.mozilla.com/D25107
2019-04-02 07:45:53 +00:00