From 436dee8450ef4759ead9e8f764790517f94b3618 Mon Sep 17 00:00:00 2001 From: saku Date: Mon, 21 Apr 2025 01:09:31 +0900 Subject: [PATCH] Fix: Slot Assignment mode according to the spec (#36620) When parsing a Declarative Shadow DOM, the slot assignment isn't being triggered as mentioned in the [spec](https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inhead:~:text=Attach%20a%20shadow%20root%20with%20declarative%20shadow%20host%20element%2C%20mode%2C%20clonable%2C%20serializable%2C%20delegatesFocus%2C%20%22named%22%2C%20and%20registry.). When creating a shadow root declaratively, SlotAssignment mode was set to "manual" instead of "named". Tests: The followings should get fully passed with this change, so `.ini`s are removed. - `declarative-shadow-dom-basic.html` - `declarative-shadow-dom-write-to-iframe.html` - `declarative-shadow-dom-repeats.html` Fixes: #36100 --------- Signed-off-by: saku --- components/script/dom/servoparser/mod.rs | 2 +- .../declarative/declarative-shadow-dom-basic.html.ini | 6 ------ .../declarative/declarative-shadow-dom-repeats.html.ini | 3 --- .../declarative-shadow-dom-write-to-iframe.html.ini | 3 --- 4 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 tests/wpt/meta/shadow-dom/declarative/declarative-shadow-dom-basic.html.ini delete mode 100644 tests/wpt/meta/shadow-dom/declarative/declarative-shadow-dom-repeats.html.ini delete mode 100644 tests/wpt/meta/shadow-dom/declarative/declarative-shadow-dom-write-to-iframe.html.ini diff --git a/components/script/dom/servoparser/mod.rs b/components/script/dom/servoparser/mod.rs index 976c1c6eb79..23ef1bab3ef 100644 --- a/components/script/dom/servoparser/mod.rs +++ b/components/script/dom/servoparser/mod.rs @@ -1462,7 +1462,7 @@ impl TreeSink for Sink { clonable, serializable, delegatesfocus, - SlotAssignmentMode::Manual, + SlotAssignmentMode::Named, CanGc::note(), ) { Ok(shadow_root) => { diff --git a/tests/wpt/meta/shadow-dom/declarative/declarative-shadow-dom-basic.html.ini b/tests/wpt/meta/shadow-dom/declarative/declarative-shadow-dom-basic.html.ini deleted file mode 100644 index 9ea3d57e32a..00000000000 --- a/tests/wpt/meta/shadow-dom/declarative/declarative-shadow-dom-basic.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[declarative-shadow-dom-basic.html] - [Declarative Shadow DOM: Basic test] - expected: FAIL - - [Declarative Shadow DOM: Fragment parser basic test] - expected: FAIL diff --git a/tests/wpt/meta/shadow-dom/declarative/declarative-shadow-dom-repeats.html.ini b/tests/wpt/meta/shadow-dom/declarative/declarative-shadow-dom-repeats.html.ini deleted file mode 100644 index 4fad73d8d8c..00000000000 --- a/tests/wpt/meta/shadow-dom/declarative/declarative-shadow-dom-repeats.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[declarative-shadow-dom-repeats.html] - [Calling attachShadow() on declarative shadow root must match all parameters] - expected: FAIL diff --git a/tests/wpt/meta/shadow-dom/declarative/declarative-shadow-dom-write-to-iframe.html.ini b/tests/wpt/meta/shadow-dom/declarative/declarative-shadow-dom-write-to-iframe.html.ini deleted file mode 100644 index 81cb59eb03e..00000000000 --- a/tests/wpt/meta/shadow-dom/declarative/declarative-shadow-dom-write-to-iframe.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[declarative-shadow-dom-write-to-iframe.html] - [`document.write` on inner iframe handles declarative shadow DOM] - expected: FAIL