mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +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
12
tests/wpt/meta/css/cssom/idlharness.html.ini
vendored
12
tests/wpt/meta/css/cssom/idlharness.html.ini
vendored
|
@ -395,18 +395,6 @@
|
|||
[CSSStyleSheet interface: calling replace(USVString) on sheet with too few arguments must throw TypeError]
|
||||
expected: FAIL
|
||||
|
||||
[Document interface: attribute adoptedStyleSheets]
|
||||
expected: FAIL
|
||||
|
||||
[Document interface: document must inherit property "adoptedStyleSheets" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[Document interface: new Document() must inherit property "adoptedStyleSheets" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[ShadowRoot interface: attribute adoptedStyleSheets]
|
||||
expected: FAIL
|
||||
|
||||
[CSSImportRule interface: attribute supportsText]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue