Bug 2033191 made sure we only call ownerGlobal on nodes.
As per the discussion in dev-platform, the front-end ~always wants
.documentGlobal. This removes ownerGlobal from the bindings. Following
patch will rename internal GetOwnerGlobal in gecko to GetRelevantGlobal
as per the HTML spec terminology.
Differential Revision: https://phabricator.services.mozilla.com/D297183
Bug 2033191 made sure we only call ownerGlobal on nodes.
As per the discussion in dev-platform, the front-end ~always wants
.documentGlobal. This removes ownerGlobal from the bindings. Following
patch will rename internal GetOwnerGlobal in gecko to GetRelevantGlobal
as per the HTML spec terminology.
Differential Revision: https://phabricator.services.mozilla.com/D297183
Bug 2033191 made sure we only call ownerGlobal on nodes.
As per the discussion in dev-platform, the front-end ~always wants
.documentGlobal. This removes ownerGlobal from the bindings. Following
patch will rename internal GetOwnerGlobal in gecko to GetRelevantGlobal
as per the HTML spec terminology.
Differential Revision: https://phabricator.services.mozilla.com/D297183
Bug 2033191 made sure we only call ownerGlobal on nodes.
As per the discussion in dev-platform, the front-end ~always wants
.documentGlobal. This removes ownerGlobal from the bindings. Following
patch will rename internal GetOwnerGlobal in gecko to GetRelevantGlobal
as per the HTML spec terminology.
Differential Revision: https://phabricator.services.mozilla.com/D297183
- primary / nodefaultsrc / allowscriptstoclose / forcemessagemanager
are already used as true or not present, so no behavior change.
- remote can be a regular XUL attr, but needs some consumers to change.
While at it remove the unused mozframetype attr, just use type for both
XUL and privileged iframes.
Differential Revision: https://phabricator.services.mozilla.com/D286522
- primary / nodefaultsrc / allowscriptstoclose / forcemessagemanager
are already used as true or not present, so no behavior change.
- remote can be a regular XUL attr, but needs some consumers to change.
While at it remove the unused mozframetype attr, just use type for both
XUL and privileged iframes.
Differential Revision: https://phabricator.services.mozilla.com/D286522
Remove devtools/shared/layout/utils.js isNativeAnonymous/isAnonymous and switch
callsites to directly use node.isNativeAnonymous getter.
On the client rename isAnonymous into isNativeAnonymous so it's consistent
with the platform implementation.
Differential Revision: https://phabricator.services.mozilla.com/D271553
We used to compute the pseudo element name (e.g. `::before`, `::marker`, …) in a
few places, both on the server and the client.
This patch does it directly from `getNodeDisplayName`, which is called for assigning
the NodeActorForm displayName.
We also use `getNodeDisplayName` in `getBindingElementAndPseudo` to avoid duplicating
code.
On the client we now use displayName in the few places we used to re-construct
the pseudo element text in (markup view, breadcrumb, rules view, …)
We also no longer pass "individual" pseudo element booleans (e.g. `isAfterPseudoElement`)
in the NodeActor form, but a more generic `isPseudoElement` one so it's easier
to handle future pseudo element (e.g. `::view-transition`).
And we take this as an opportunity to remove the utility functions that we were
using to build those properties, and instead switch to look into `Node.implementedPseudoElement`
to detect when we do handle pseudo elements.
Differential Revision: https://phabricator.services.mozilla.com/D271002
We used to compute the pseudo element name (e.g. `::before`, `::marker`, …) in a
few places, both on the server and the client.
This patch does it directly from `getNodeDisplayName`, which is called for assigning
the NodeActorForm displayName.
We also use `getNodeDisplayName` in `getBindingElementAndPseudo` to avoid duplicating
code.
On the client we now use displayName in the few places we used to re-construct
the pseudo element text in (markup view, breadcrumb, rules view, …)
We also no longer pass "individual" pseudo element booleans (e.g. `isAfterPseudoElement`)
in the NodeActor form, but a more generic `isPseudoElement` one so it's easier
to handle future pseudo element (e.g. `::view-transition`).
And we take this as an opportunity to remove the utility functions that we were
using to build those properties, and instead switch to look into `Node.implementedPseudoElement`
to detect when we do handle pseudo elements.
Differential Revision: https://phabricator.services.mozilla.com/D271002
We are making changes to many files. Very huge chunk of the changes are just renaming CSP -> PolicyContainer. Part 1 and part 2 are solely separated as frontend and backend. The unfortunate thing is, I mistakenly placed IDL changes in part 1, and many of those IDL changes affect frontend code too. I'm sorry for this inconvinience and hard to review patch(es).
(FWIW before this rewrite we had [another patch stack](https://phabricator.services.mozilla.com/D247332). It is 25 patches and I believe isn't as comprehensive as this one. It also didn't replace CSP's inheritance but was copied alongside with CSP, but we decided to change our method and make policy conttainer contain CSP and copy it around after some discussion and reviews)
Differential Revision: https://phabricator.services.mozilla.com/D250286
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
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
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
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
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
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
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