From 1d1ac4e422a324551a39398d68588b9362e7aaa7 Mon Sep 17 00:00:00 2001 From: Matthieu Dubet Date: Thu, 10 Aug 2023 17:51:54 +0200 Subject: [PATCH] WebKit export of https://bugs.webkit.org/show_bug.cgi?id=258688 --- .../nest-containing-forgiving-ref.html | 1 + css/css-nesting/nest-containing-forgiving.html | 7 +++++++ css/css-scoping/slotted-parsing.html | 8 ++++---- css/selectors/is-where-error-recovery.html | 16 +++++----------- css/selectors/is-where-parsing.html | 7 ++++--- ...arse-has-disallow-nesting-has-inside-has.html | 4 ++-- css/selectors/parsing/parse-has.html | 2 +- 7 files changed, 24 insertions(+), 21 deletions(-) diff --git a/css/css-nesting/nest-containing-forgiving-ref.html b/css/css-nesting/nest-containing-forgiving-ref.html index 36b07c92b6fdcb..8fb7c8674a534a 100644 --- a/css/css-nesting/nest-containing-forgiving-ref.html +++ b/css/css-nesting/nest-containing-forgiving-ref.html @@ -15,4 +15,5 @@

Tests pass if block is green

+
diff --git a/css/css-nesting/nest-containing-forgiving.html b/css/css-nesting/nest-containing-forgiving.html index d399142f7efb99..561b5a3af5e730 100644 --- a/css/css-nesting/nest-containing-forgiving.html +++ b/css/css-nesting/nest-containing-forgiving.html @@ -17,6 +17,12 @@ } } + .does-not-exist { + :is(.test-2, :unknown(div,&)) { + background-color: green; + } + } + body * + * { margin-top: 8px; } @@ -24,4 +30,5 @@

Tests pass if block is green

+
diff --git a/css/css-scoping/slotted-parsing.html b/css/css-scoping/slotted-parsing.html index 25b003091fadb0..bed4dedd56072a 100644 --- a/css/css-scoping/slotted-parsing.html +++ b/css/css-scoping/slotted-parsing.html @@ -28,12 +28,12 @@ test_valid_selector("::slotted(:not(.a))"); test_valid_selector("::slotted(*):is()"); - test_valid_selector("::slotted(*):is(:hover)", "::slotted(*):is()"); - test_valid_selector("::slotted(*):is(#id)", "::slotted(*):is()"); + test_valid_selector("::slotted(*):is(:hover)"); + test_valid_selector("::slotted(*):is(#id)"); test_valid_selector("::slotted(*):where()"); - test_valid_selector("::slotted(*):where(:hover)", "::slotted(*):where()"); - test_valid_selector("::slotted(*):where(#id)", "::slotted(*):where()"); + test_valid_selector("::slotted(*):where(:hover)"); + test_valid_selector("::slotted(*):where(#id)"); // Allow tree-abiding pseudo elements after ::slotted test_valid_selector("::slotted(*)::before"); diff --git a/css/selectors/is-where-error-recovery.html b/css/selectors/is-where-error-recovery.html index 1d6e870ed23e5b..f7e6f6ff6ea0b6 100644 --- a/css/selectors/is-where-error-recovery.html +++ b/css/selectors/is-where-error-recovery.html @@ -23,18 +23,12 @@ "random-selector", "Should've parsed", ); - assert_not_equals( - rule.selectorText, - invalidSelector, - "Should not be considered valid and parsed as-is", - ); - let emptyList = `:${pseudo}()`; assert_equals( rule.selectorText, - emptyList, - "Should be serialized as an empty selector-list", + invalidSelector, + "Should be parsed as-is (but not be considered valid)", ); - assert_equals(document.querySelector(emptyList), null, "Should never match, but should parse"); + assert_equals(document.querySelector(rule.selectorText), null, "Should never match, but should parse"); for (let mixedList of [ `:${pseudo}(:total-nonsense, #test-div)`, `:${pseudo}(:total-nonsense and-more-stuff, #test-div)`, @@ -43,8 +37,8 @@ rule.selectorText = mixedList; assert_equals( rule.selectorText, - `:${pseudo}(#test-div)`, - `${mixedList}: Should ignore invalid selectors`, + mixedList, + `${mixedList}: Should parse invalid selectors`, ); let testDiv = document.getElementById("test-div"); assert_equals(document.querySelector(mixedList), testDiv, "Should correctly match"); diff --git a/css/selectors/is-where-parsing.html b/css/selectors/is-where-parsing.html index c9cc2236a3281a..3159ecfe6a65b7 100644 --- a/css/selectors/is-where-parsing.html +++ b/css/selectors/is-where-parsing.html @@ -10,7 +10,7 @@ diff --git a/css/selectors/parsing/parse-has.html b/css/selectors/parsing/parse-has.html index 5d071010b42f9b..902fc98ff68350 100644 --- a/css/selectors/parsing/parse-has.html +++ b/css/selectors/parsing/parse-has.html @@ -37,5 +37,5 @@ test_invalid_selector(':has()'); test_invalid_selector(':has(123)'); test_invalid_selector(':has(.a, 123)'); - test_valid_selector(':has(:is(.a, 123))', ':has(:is(.a))'); + test_valid_selector(':has(:is(.a, 123))');