Closed Bug 1484690 Opened 3 years ago Closed 3 years ago

Panic when having two stylesheet <link>s with the same href in ShadowRoot.


(Core :: CSS Parsing and Computation, defect)

Not set



Tracking Status
firefox63 --- fixed


(Reporter: emilio, Assigned: emilio)




(2 files)

See the test-case. Found this while I was trying to determine whether bug 1484520 affects Shadow DOM apart from XBL too.
See Also: → 1484520
Attached file testcase
See Also: → 1484699
We share the inner object across sheets from the same URL, so what happens here
is that, once the sheet parses and loads, we call SetEnabled() on the first
sheet, which sets the inner bit, then calls ApplicableStateChanged.

That set actually turned the second sheet complete, so when inserting the sheet,
we think that the second sheet is already enabled, and thus in the author data,
and try to insert before it. Of course there's nothing there, so we panic.

We rely on calling SetEnabled() on all the sheets already to insert them in the
styleset / author data, so this makes it clearer and fixes the bug by moving the
state to each individual sheet.
Comment on attachment 9002487 [details]
Move the enabled state to the sheet instead of sharing it.

Cameron McCormack (:heycam) (away 24 Aug) has approved the revision.
Attachment #9002487 - Flags: review+
Pushed by
Move the enabled state to the sheet instead of sharing it. r=heycam
Created web-platform-tests PR for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Pushed by
followup: fixup the WPT manifest since lando overrode it with an older version. r=me
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.