Open Bug 1945618 Opened 10 days ago Updated 9 days ago

Various places don't deal with non-constructed adopted stylesheets properly

Categories

(Core :: DOM: CSS Object Model, defect, P3)

defect

Tracking

()

Tracking Status
firefox-esr128 --- unaffected
firefox135 --- unaffected
firefox136 --- affected
firefox137 --- affected

People

(Reporter: emilio, Unassigned, NeedInfo)

References

(Regression)

Details

(Keywords: regression)

Various places assume that if a sheet is not constructed, it can't appear in mAdoptedStyleSheets:

https://searchfox.org/mozilla-central/rev/b1662b447f306e6554647914090d4b73ac8e1664/dom/base/DocumentOrShadowRoot.cpp#631
https://searchfox.org/mozilla-central/rev/b1662b447f306e6554647914090d4b73ac8e1664/dom/base/ShadowRoot.cpp#527
https://searchfox.org/mozilla-central/rev/b1662b447f306e6554647914090d4b73ac8e1664/layout/style/StyleSheet.cpp#182,187-193 assumes that if the sheet is constructed, its document matches the adopter which was also lifted.

I'm not convinced we want to open the can of cross-document adoption, fwiw. Maybe it's worth putting that restriction back in place at least.

Severity: -- → S3
Priority: -- → P3

Should also probably prevent @import sheets from being adopted, or otherwise that's another whole can of worms.

:mozilla, since you are the author of the regressor, bug 1944244, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(mozilla)

Set release status flags based on info from the regressing bug 1944244

You need to log in before you can comment on or make changes to this bug.