From 1b476ffbe5be1470c147442006c6002eea44e61f Mon Sep 17 00:00:00 2001 From: Westbrook Johnson Date: Tue, 28 Jan 2025 14:38:36 -0500 Subject: [PATCH] Clarify support for ::slotted(:has(...)) as established by WebKit (#50337) --- css/css-scoping/slotted-has-001.html | 26 ++++++++++++++++++++++++ css/css-scoping/slotted-has-002.html | 26 ++++++++++++++++++++++++ css/css-scoping/slotted-has-003.html | 26 ++++++++++++++++++++++++ css/css-scoping/slotted-has-004.html | 26 ++++++++++++++++++++++++ css/selectors/parsing/parse-slotted.html | 1 + 5 files changed, 105 insertions(+) create mode 100644 css/css-scoping/slotted-has-001.html create mode 100644 css/css-scoping/slotted-has-002.html create mode 100644 css/css-scoping/slotted-has-003.html create mode 100644 css/css-scoping/slotted-has-004.html diff --git a/css/css-scoping/slotted-has-001.html b/css/css-scoping/slotted-has-001.html new file mode 100644 index 00000000000000..f70bac7eca386d --- /dev/null +++ b/css/css-scoping/slotted-has-001.html @@ -0,0 +1,26 @@ + + +:has-slotted + + +

Test passes if there is a filled green square.

+
+ +
+
\ No newline at end of file diff --git a/css/css-scoping/slotted-has-002.html b/css/css-scoping/slotted-has-002.html new file mode 100644 index 00000000000000..9ecbea5d413f92 --- /dev/null +++ b/css/css-scoping/slotted-has-002.html @@ -0,0 +1,26 @@ + + +:has-slotted + + +

Test passes if there is a filled green square.

+
+ +
+
\ No newline at end of file diff --git a/css/css-scoping/slotted-has-003.html b/css/css-scoping/slotted-has-003.html new file mode 100644 index 00000000000000..1ea412492c567e --- /dev/null +++ b/css/css-scoping/slotted-has-003.html @@ -0,0 +1,26 @@ + + +:has-slotted + + +

Test passes if there is a filled green square.

+
+ +
+
\ No newline at end of file diff --git a/css/css-scoping/slotted-has-004.html b/css/css-scoping/slotted-has-004.html new file mode 100644 index 00000000000000..adf50da13a95a5 --- /dev/null +++ b/css/css-scoping/slotted-has-004.html @@ -0,0 +1,26 @@ + + +:has-slotted + + +

Test passes if there is a filled green square.

+
+ +
+
\ No newline at end of file diff --git a/css/selectors/parsing/parse-slotted.html b/css/selectors/parsing/parse-slotted.html index 4b7b4a3b56fd05..47fafdf2b35d6f 100644 --- a/css/selectors/parsing/parse-slotted.html +++ b/css/selectors/parsing/parse-slotted.html @@ -14,6 +14,7 @@ test_valid_selector('::slotted(:not(:nth-last-of-type(2)):not([slot="foo"]))'); test_valid_selector("::slotted(:first-child)"); test_valid_selector("::slotted(:hover)"); + test_valid_selector("::slotted(:has(:first-child:last-child))"); test_invalid_selector("::slotted"); test_invalid_selector("::slotted()"); test_invalid_selector("::slotted(0)");