StyleEditor does not display same-origin frame stylesheets on reload
Categories
(DevTools :: Style Editor, defect, P2)
Tracking
(firefox-esr78 unaffected, firefox-esr91 wontfix, firefox93 wontfix, firefox94 wontfix)
Tracking | Status | |
---|---|---|
firefox-esr78 | --- | unaffected |
firefox-esr91 | --- | wontfix |
firefox93 | --- | wontfix |
firefox94 | --- | wontfix |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
References
(Regression)
Details
(Keywords: regression, Whiteboard: dt-perf-stability-mvp)
Steps to reproduce
- Go to https://same-domain-iframe-stylesheet-reload.glitch.me/
- Open DevTools and go to the StyleEditor
- There should be 2 stylesheets, one for the top level document, the other for the same origin iframe.
- Reload the page
Expected results
The list of stylesheet is cleared, and then the 2 stylesheet are loaded back
Actual results
The list of stylesheet is cleared, but only the top-level stylesheet is displayed
Stylesheets added through the "Add Stylesheet" button are not reflected in the StyleEditor either after the reload
I can reproduce on Firefox 90, regardless of Fission state.
I can't reproduce on Firefox ESR (78).
I did some investigation on this:
We rely on the document.styleSheetChangeEventsEnabled
to be notified about stylesheets being added.
This flag is added by the StylesheeManager on all the documents of a given target when we start watching, and then on each window we receive from the window-ready
event.
window-ready
is emitted from the BrowsingContextTargetActor
, via the onWindowCreated
handler. This one can be triggered either by a DOMWindowCreated
event or by a pageshow
event.
Here what seems to happen when reloading:
- we get the top level
DomWindowCreated
fine - then we get
DomWindowCreated
for the iframe, which are actually initial documents (isInitialDocument
is true).window-ready
is sent for all of those and we set thestyleSheetChangeEventsEnabled
on the document. - then I guess those transient documents are "destroyed" (or swapped, not sure, but we don't get them in
windowDestroyed
) and the "real" one is created (we don't get aDOMWindowCreated
for it though). The issue is that it has the sameinnerWindowId
than the initial document, which means we won't get window-ready for those: https://searchfox.org/mozilla-central/rev/8f08c21f093be1c1c42438697f8bca67af94fc77/devtools/server/actors/targets/browsing-context.js#1777-1780 would see them as already handled. - at this point, the iframe
document.styleSheetChangeEventsEnabled
is false and we won't get notified about its stylesheets
Assignee | ||
Comment 1•3 years ago
|
||
Patch for Bug 1724909 is adding a test (devtools/shared/commands/resource/tests/browser_resources_stylesheets_navigation.js
) with disabled assertions, that should be enabled as part of this bug.
Assignee | ||
Comment 2•3 years ago
|
||
A proper solution would be to move that flag on the browsing context (we already have devtools-specific flags on it), and setting it would propagate it to the whole browsing context tree
Updated•3 years ago
|
Comment 3•3 years ago
|
||
Assignee | ||
Comment 4•3 years ago
|
||
(In reply to Alice0775 White from comment #3)
Regression window:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=b54e100794eef36af9e4cefe3b260fe9642ea3bf&tochange=ccd521ebc464ffdad1a5abfa3f03a9df603c67da
Thanks! I strongly suspect Bug 1625930 (turning stylesheets into resources)
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Comment 5•3 years ago
|
||
Removing the regressionwindow-wanted keyword as it was provided in Comment 3.
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Comment 6•3 years ago
|
||
Set release status flags based on info from the regressing bug 1625930
Updated•3 years ago
|
Assignee | ||
Comment 8•2 years ago
|
||
EFT is enabled everywhere and all blockers are resolved, we can probably close this
Description
•