Handle Duplicate Adopted Style Sheets
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Tracking
()
People
(Reporter: nordzilla, Assigned: emilio)
References
Details
Attachments
(2 files)
The Constructable StyleSheets API (here) may require one style sheet to be represented in the same style set multiple times.
This is currently disallowed in Gecko, enforced via assertions that check the sheet's address as well as the style set's address.
We may want to update the uniqueness checks to an index-based system, rather than an address-based system, which would allow the same sheet to exist in the set in multiple places.
We should first investigate how difficult it may be to make this change.
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Removing unused arguments and so on.
The origin can always be inferred from the stylesheet so it wasn't being used.
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
This also fixes some other bits, like mAdoptedStyleSheets.ElementAt(0) (which
really should be "the first applicable adopted stylesheet") and so on. Added a
test for that.
The new invariant also implies that a DocumentOrShadowRoot can't appear twice in
StyleSheet::mAdopters.
Also clears adopted stylesheets in Document::ResetStylesheetsToURI, as it's the
right thing to do (if you hit that code path with constructable sheets you'd end
up asserting, as we'd call FillStyleSetDocumentSheets after and find sheets in
there). I don't quite have a test-case for that though.
Depends on D64150
Assignee | ||
Comment 3•5 years ago
|
||
This is what I came up with. I think it's better than dealing with duplicates and such in the styleset, but let me know if you disagree :)
Comment 9•5 years ago
|
||
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=290663433&repo=autoland
https://treeherder.mozilla.org/logviewer.html#?job_id=290663979&repo=autoland
https://treeherder.mozilla.org/logviewer.html#?job_id=290664230&repo=autoland
Backout link: https://hg.mozilla.org/integration/autoland/rev/a546217f66bf0759aaa6c5a836ecb033e95479cd
Assignee | ||
Comment 10•5 years ago
|
||
I'll land the first patch first so that I can land another patch that conflicts with it. Will double-check and wait for try for the second.
Assignee | ||
Updated•5 years ago
|
Comment 11•5 years ago
|
||
Comment 13•5 years ago
|
||
bugherder |
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Reporter | ||
Comment 16•5 years ago
|
||
Changed title to be more representative of the work done in this patch.
Description
•