mirror of
https://github.com/servo/servo.git
synced 2025-09-02 11:08:22 +01:00
script: Implement DocumentOrShadowDOM.adoptedStylesheet
with FrozenArray
(#38163)
Spec: https://drafts.csswg.org/cssom/#dom-documentorshadowroot-adoptedstylesheets Implement `DocumentOrShadowDOM.adoptedStylesheet`. Due to `ObservableArray` being a massive issue on its own, it will be as it was a `FrozenArray` at first. This approach is similar to how Gecko implement adopted stylesheet. See https://phabricator.services.mozilla.com/D144547#change-IXyOzxxFn8sU. All of the changes will be gated behind a preference `dom_adoptedstylesheet_enabled`. Adopted stylesheet is implemented by adding the setter and getter of it. While the getter works like a normal attribute getter, the setter need to consider the inner working of document and shadow root StylesheetSet, specifically the ordering and the invalidations. Particularly for setter, we will clear all of the adopted stylesheet within the StylesheetSet and readd them. Possible optimization exist, but the focus should be directed to implementing `ObservableArray`. More context about the implementations https://hackmd.io/vtJAn4UyS_O0Idvk5dCO_w. Testing: Existing WPT Coverage Fixes: https://github.com/servo/servo/issues/37561 --------- Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
This commit is contained in:
parent
d2e5137201
commit
f523445fc3
24 changed files with 434 additions and 139 deletions
|
@ -1,7 +1,4 @@
|
|||
[CSSStyleSheet-constructable.html]
|
||||
[document.adoptedStyleSheets should initially have length 0.]
|
||||
expected: FAIL
|
||||
|
||||
[new CSSStyleSheet produces empty CSSStyleSheet]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -17,12 +14,6 @@
|
|||
[Re-attaching shadow host with adopted stylesheets work]
|
||||
expected: FAIL
|
||||
|
||||
[Attaching a shadow root that already has adopted stylesheets work]
|
||||
expected: FAIL
|
||||
|
||||
[Re-attaching shadow host and updating attributes work]
|
||||
expected: FAIL
|
||||
|
||||
[Changes to constructed stylesheets through CSSOM is reflected]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -35,12 +26,6 @@
|
|||
[Stylesheet constructed on iframe cannot be used in the main Document]
|
||||
expected: FAIL
|
||||
|
||||
[Adding non-constructed stylesheet to AdoptedStyleSheets is not allowed when the owner document of the stylesheet is in the same document tree as the AdoptedStyleSheets]
|
||||
expected: FAIL
|
||||
|
||||
[Adding non-constructed stylesheet to AdoptedStyleSheets is not allowed when the owner document of the stylesheet and the AdoptedStyleSheets are in different document trees]
|
||||
expected: FAIL
|
||||
|
||||
[CSSStyleSheet.replaceSync correctly updates the style of its adopters synchronously]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue