Log Message
Import basic :has() tests https://bugs.webkit.org/show_bug.cgi?id=227703 Reviewed by Alan Bujtas.
Along with some other updates to css/selectors. * web-platform-tests/css/selectors/focus-visible-022.tentative-expected.txt: Added. * web-platform-tests/css/selectors/focus-visible-022.tentative.html: Added. * web-platform-tests/css/selectors/has-basic-expected.txt: Added. * web-platform-tests/css/selectors/has-basic.html: Added. * web-platform-tests/css/selectors/has-relative-argument-expected.txt: Added. * web-platform-tests/css/selectors/has-relative-argument.html: Added. * web-platform-tests/css/selectors/is-where-parsing-expected.txt: * web-platform-tests/css/selectors/is-where-parsing.html: * web-platform-tests/css/selectors/parsing/parse-has-expected.txt: Added. * web-platform-tests/css/selectors/parsing/parse-has.html: Added. * web-platform-tests/css/selectors/parsing/w3c-import.log: * web-platform-tests/css/selectors/user-invalid.html: * web-platform-tests/css/selectors/user-valid-expected.txt: Added. * web-platform-tests/css/selectors/user-valid.html: Added. * web-platform-tests/css/selectors/w3c-import.log:
Modified Paths
- trunk/LayoutTests/imported/w3c/ChangeLog
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-where-parsing-expected.txt
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-where-parsing.html
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/w3c-import.log
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-invalid.html
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/w3c-import.log
- trunk/LayoutTests/platform/ios/TestExpectations
Added Paths
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-022.tentative-expected.txt
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-022.tentative.html
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-basic-expected.txt
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-basic.html
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-relative-argument-expected.txt
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-relative-argument.html
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-has-expected.txt
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-has.html
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-valid-expected.txt
- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-valid.html
Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (279580 => 279581)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-07-06 11:10:18 UTC (rev 279580)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2021-07-06 14:54:03 UTC (rev 279581)
@@ -1,3 +1,28 @@
+2021-07-06 Antti Koivisto <[email protected]>
+
+ Import basic :has() tests
+ https://bugs.webkit.org/show_bug.cgi?id=227703
+
+ Reviewed by Alan Bujtas.
+
+ Along with some other updates to css/selectors.
+
+ * web-platform-tests/css/selectors/focus-visible-022.tentative-expected.txt: Added.
+ * web-platform-tests/css/selectors/focus-visible-022.tentative.html: Added.
+ * web-platform-tests/css/selectors/has-basic-expected.txt: Added.
+ * web-platform-tests/css/selectors/has-basic.html: Added.
+ * web-platform-tests/css/selectors/has-relative-argument-expected.txt: Added.
+ * web-platform-tests/css/selectors/has-relative-argument.html: Added.
+ * web-platform-tests/css/selectors/is-where-parsing-expected.txt:
+ * web-platform-tests/css/selectors/is-where-parsing.html:
+ * web-platform-tests/css/selectors/parsing/parse-has-expected.txt: Added.
+ * web-platform-tests/css/selectors/parsing/parse-has.html: Added.
+ * web-platform-tests/css/selectors/parsing/w3c-import.log:
+ * web-platform-tests/css/selectors/user-invalid.html:
+ * web-platform-tests/css/selectors/user-valid-expected.txt: Added.
+ * web-platform-tests/css/selectors/user-valid.html: Added.
+ * web-platform-tests/css/selectors/w3c-import.log:
+
2021-07-05 Cameron McCormack <[email protected]>
Move some Mac MathML test expectation files around
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-022.tentative-expected.txt (0 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-022.tentative-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-022.tentative-expected.txt 2021-07-06 14:54:03 UTC (rev 279581)
@@ -0,0 +1,5 @@
+One
+Two
+
+PASS focus-visible-022
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-022.tentative.html (0 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-022.tentative.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-022.tentative.html 2021-07-06 14:54:03 UTC (rev 279581)
@@ -0,0 +1,34 @@
+<!doctype html>
+<link rel="author" title="Emilio Cobos Álvarez" href=""
+<link rel="author" title="Mozilla" href=""
+<link rel="help" href="" />
+<link rel="help" href=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+
+<div id="one" tabindex="1">One</div>
+<div id="two" tabindex="1">Two</div>
+
+<script>
+let _one_ = document.getElementById("one");
+let two = document.getElementById("two");
+
+document.addEventListener("keydown", function(e) {
+ two.focus();
+});
+
+promise_test(async t => {
+ await test_driver.click(one);
+ assert_equals(document.activeElement, one, "#one should be focused by mouse");
+ assert_true(one.matches(":focus"), "#one should match :focus");
+ assert_true(!one.matches(":focus-visible"), "#one should not match :focus-visible");
+
+ await test_driver.send_keys(document.body, " ");
+
+ assert_equals(document.activeElement, two, "#two should be focused by our event listener");
+ assert_true(two.matches(":focus"), "#two should match :focus");
+ assert_true(two.matches(":focus-visible"), "#two should match :focus-visible");
+});
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-basic-expected.txt (0 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-basic-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-basic-expected.txt 2021-07-06 14:54:03 UTC (rev 279581)
@@ -0,0 +1,25 @@
+
+FAIL :has(#a) matches expected elements The string did not match the expected pattern.
+FAIL :has(.ancestor) matches expected elements The string did not match the expected pattern.
+FAIL :has(.target) matches expected elements The string did not match the expected pattern.
+FAIL :has(.descendant) matches expected elements The string did not match the expected pattern.
+FAIL .parent:has(.target) matches expected elements The string did not match the expected pattern.
+FAIL :has(.sibling ~ .target) matches expected elements The string did not match the expected pattern.
+FAIL .parent:has(.sibling ~ .target) matches expected elements The string did not match the expected pattern.
+FAIL :has(:is(.target ~ .sibling .descendant)) matches expected elements The string did not match the expected pattern.
+FAIL .parent:has(:is(.target ~ .sibling .descendant)) matches expected elements The string did not match the expected pattern.
+FAIL .sibling:has(.descendant) ~ .target matches expected elements The string did not match the expected pattern.
+FAIL :has(.sibling:has(.descendant) ~ .target) matches expected elements The string did not match the expected pattern.
+FAIL :has(.sibling:has(.descendant) ~ .target) ~ .parent > .descendant matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope .target) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope > .parent) matches expected elements The string did not match the expected pattern.
+FAIL :has(> .target) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope > .target) matches expected elements The string did not match the expected pattern.
+FAIL :has(+ #h) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope + #h) matches expected elements The string did not match the expected pattern.
+FAIL .parent:has(~ #h) matches expected elements The string did not match the expected pattern.
+FAIL .parent:has(:scope ~ #h) matches expected elements The string did not match the expected pattern.
+FAIL .sibling:has(.descendant) matches expected element The string did not match the expected pattern.
+FAIL closest(.ancestor:has(.descendant)) returns expected element The string did not match the expected pattern.
+FAIL :has(.target ~ .sibling .descendant) matches expectedly The string did not match the expected pattern.
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-basic.html (0 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-basic.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-basic.html 2021-07-06 14:54:03 UTC (rev 279581)
@@ -0,0 +1,88 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Basic matching behavior of :has pseudo class</title>
+<link rel="author" title="Byungwoo Lee" href=""
+<script src=""
+<script src=""
+<link rel="help" href=""
+
+<main id=main>
+ <div id=a class="ancestor">
+ <div id=b class="parent ancestor">
+ <div id=c class="sibling descendant">
+ <div id=d class="descendant"></div>
+ </div>
+ <div id=e class="target descendant"></div>
+ </div>
+ <div id=f class="parent ancestor">
+ <div id=g class="target descendant"></div>
+ </div>
+ <div id=h class="parent ancestor">
+ <div id=i class="target descendant"></div>
+ <div id=j class="sibling descendant">
+ <div id=k class="descendant"></div>
+ </div>
+ </div>
+ </div>
+</main>
+
+<script>
+ function formatElements(elements) {
+ return elements.map(e => e.id).sort().join();
+ }
+
+ // Test that |selector| returns the given elements in #main.
+ function test_selector_all(selector, expected) {
+ test(function() {
+ let actual = Array.from(main.querySelectorAll(selector));
+ assert_equals(formatElements(actual), formatElements(expected));
+ }, `${selector} matches expected elements`);
+ }
+
+ // Test that |selector| returns the given element in #main.
+ function test_selector(selector, expected) {
+ test(function() {
+ assert_equals(main.querySelector(selector), expected);
+ }, `${selector} matches expected element`);
+ }
+
+ // Test that |selector| returns the given closest element.
+ function test_closest(node, selector, expected) {
+ test(function() {
+ assert_equals(node.closest(selector), expected);
+ }, `closest(${selector}) returns expected element`);
+ }
+
+ // Test that |selector| returns matching status.
+ function test_matches(node, selector, expected) {
+ test(function() {
+ assert_equals(node.matches(selector), expected);
+ }, `${selector} matches expectedly`);
+ }
+
+ test_selector_all(':has(#a)', []);
+ test_selector_all(':has(.ancestor)', [a]);
+ test_selector_all(':has(.target)', [a, b, f, h]);
+ test_selector_all(':has(.descendant)', [a, b, c, f, h, j]);
+ test_selector_all('.parent:has(.target)', [b, f, h]);
+ test_selector_all(':has(.sibling ~ .target)', [a, b]);
+ test_selector_all('.parent:has(.sibling ~ .target)', [b]);
+ test_selector_all(':has(:is(.target ~ .sibling .descendant))', [a, h, j]);
+ test_selector_all('.parent:has(:is(.target ~ .sibling .descendant))', [h]);
+ test_selector_all('.sibling:has(.descendant) ~ .target', [e]);
+ test_selector_all(':has(.sibling:has(.descendant) ~ .target)', [a, b]);
+ test_selector_all(
+ ':has(.sibling:has(.descendant) ~ .target) ~ .parent > .descendant',
+ [g, i, j]);
+ test_selector_all(':has(:scope .target)', [a, b, f, h]);
+ test_selector_all(':has(:scope > .parent)', [a]);
+ test_selector_all(':has(> .target)', [b, f, h]);
+ test_selector_all(':has(:scope > .target)', [b, f, h]);
+ test_selector_all(':has(+ #h)', [f]);
+ test_selector_all(':has(:scope + #h)', [f]);
+ test_selector_all('.parent:has(~ #h)', [b, f]);
+ test_selector_all('.parent:has(:scope ~ #h)', [b, f]);
+ test_selector('.sibling:has(.descendant)', c);
+ test_closest(k, '.ancestor:has(.descendant)', h);
+ test_matches(h, ':has(.target ~ .sibling .descendant)', true);
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-relative-argument-expected.txt (0 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-relative-argument-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-relative-argument-expected.txt 2021-07-06 14:54:03 UTC (rev 279581)
@@ -0,0 +1,129 @@
+
+FAIL .x:has(:scope .a) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope .a > .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope .a .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope .a + .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope .a ~ .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope .a) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope .a > .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope .a .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope .a + .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope .a ~ .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x .a) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x .a > .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x .a .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x .a + .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x .a ~ .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope > .a) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope > .a > .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope > .a .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope > .a + .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope > .a ~ .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope > .a) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope > .a > .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope > .a .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope > .a + .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope > .a ~ .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x > .a) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x > .a > .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x > .a .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x > .a + .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x > .a ~ .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope + .a) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope + .a > .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope + .a .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope + .a + .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope + .a ~ .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope + .a) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope + .a > .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope + .a .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope + .a + .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope + .a ~ .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x + .a) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x + .a > .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x + .a .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x + .a + .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x + .a ~ .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope ~ .a) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope ~ .a > .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope ~ .a .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope ~ .a + .b) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope ~ .a + .b > .c) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope ~ .a + .b .c) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope ~ .a) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope ~ .a > .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope ~ .a .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope ~ .a + .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope ~ .a + .b > .c) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope ~ .a + .b .c) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x ~ .a) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x ~ .a > .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x ~ .a .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x ~ .a + .b) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x ~ .a + .b > .c) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x ~ .a + .b .c) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(.d .e) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(.d .e) .f matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope .d .e) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope .d .e) .f matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope > .d) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope > .d) .f matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope ~ .d ~ .e) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope ~ .d ~ .e) ~ .f matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope + .d ~ .e) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope + .d ~ .e) ~ .f matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope .d .e) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope .d .e) .f matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope > .d) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope > .d) .f matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope ~ .d ~ .e) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope ~ .d ~ .e) ~ .f matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope + .d ~ .e) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope + .d ~ .e) ~ .f matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x .d .e) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x .d .e) .f matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x > .d) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x > .d) .f matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x ~ .d ~ .e) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x ~ .d ~ .e) ~ .f matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x + .d ~ .e) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x + .d ~ .e) ~ .f matches expected elements The string did not match the expected pattern.
+FAIL .y:has(:scope > .g .h) matches expected elements The string did not match the expected pattern.
+FAIL .y:has(:scope .g .h) matches expected elements The string did not match the expected pattern.
+FAIL .y:has(:scope > .g .h) .i matches expected elements The string did not match the expected pattern.
+FAIL .y:has(:scope .g .h) .i matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope + .y:has(:scope > .g .h) .i) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope + .y:has(:scope .g .h) .i) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope + .y:has(:scope > .g .h) .i) ~ .j matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope + .y:has(:scope .g .h) .i) ~ .j matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope ~ .y:has(:scope > .g .h) .i) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(:scope ~ .y:has(:scope .g .h) .i) matches expected elements The string did not match the expected pattern.
+FAIL :has(.y:scope > .g .h) matches expected elements The string did not match the expected pattern.
+FAIL :has(.y:scope .g .h) matches expected elements The string did not match the expected pattern.
+FAIL :has(.y:scope > .g .h) .i matches expected elements The string did not match the expected pattern.
+FAIL :has(.y:scope .g .h) .i matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope + :has(.y:scope > .g .h) .i) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope + :has(.y:scope .g .h) .i) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope + :has(.y:scope > .g .h) .i) ~ .j matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope + :has(.y:scope .g .h) .i) ~ .j matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope ~ :has(.y:scope > .g .h) .i) matches expected elements The string did not match the expected pattern.
+FAIL :has(.x:scope ~ :has(.y:scope .g .h) .i) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.y > .g .h) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.y .g .h) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.y > .g .h) .i matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.y .g .h) .i matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x + :has(:scope.y > .g .h) .i) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x + :has(:scope.y .g .h) .i) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x + :has(:scope.y > .g .h) .i) ~ .j matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x + :has(:scope.y .g .h) .i) ~ .j matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x ~ :has(:scope.y > .g .h) .i) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope.x ~ :has(:scope.y .g .h) .i) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(.d :scope .e) matches expected elements The string did not match the expected pattern.
+FAIL :has(.d .x:scope .e) matches expected elements The string did not match the expected pattern.
+FAIL :has(.d :scope.x .e) matches expected elements The string did not match the expected pattern.
+FAIL .x:has(.d ~ :scope ~ .e) matches expected elements The string did not match the expected pattern.
+FAIL :has(.d ~ .x:scope ~ .e) matches expected elements The string did not match the expected pattern.
+FAIL :has(.d ~ :scope.x ~ .e) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope .d :scope) matches expected elements The string did not match the expected pattern.
+FAIL :has(:scope ~ .d ~ :scope) matches expected elements The string did not match the expected pattern.
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-relative-argument.html (0 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-relative-argument.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-relative-argument.html 2021-07-06 14:54:03 UTC (rev 279581)
@@ -0,0 +1,276 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>:has pseudo class behavior with various relative arguments</title>
+<link rel="author" title="Byungwoo Lee" href=""
+<script src=""
+<script src=""
+<link rel="help" href=""
+
+<main id=main>
+ <div id=d01>
+ <div id=d02 class="x">
+ <div id=d03 class="a"></div>
+ <div id=d04></div>
+ <div id=d05 class="b"></div>
+ </div>
+ <div id=d06 class="x">
+ <div id=d07 class="x">
+ <div id=d08 class="a"></div>
+ </div>
+ </div>
+ <div id=d09 class="x">
+ <div id=d10 class="a">
+ <div id=d11 class="b"></div>
+ </div>
+ </div>
+ <div id=d12 class="x">
+ <div id=d13 class="a">
+ <div id=d14>
+ <div id=d15 class="b"></div>
+ </div>
+ </div>
+ <div id=d16 class="b"></div>
+ </div>
+ </div>
+ <div id=d17>
+ <div id=d18 class="x"></div>
+ <div id=d19 class="x"></div>
+ <div id=d20 class="a"></div>
+ <div id=d21 class="x"></div>
+ <div id=d22 class="a">
+ <div id=d23 class="b"></div>
+ </div>
+ <div id=d24 class="x"></div>
+ <div id=d25 class="a">
+ <div id=d26>
+ <div id=d27 class="b"></div>
+ </div>
+ </div>
+ <div id=d28 class="x"></div>
+ <div id=d29 class="a"></div>
+ <div id=d30 class="b">
+ <div id=d31 class="c"></div>
+ </div>
+ <div id=d32 class="x"></div>
+ <div id=d33 class="a"></div>
+ <div id=d34 class="b">
+ <div id=d35>
+ <div id=d36 class="c"></div>
+ </div>
+ </div>
+ <div id=d37 class="x"></div>
+ <div id=d38 class="a"></div>
+ <div id=d39 class="b"></div>
+ <div id=d40 class="x"></div>
+ <div id=d41 class="a"></div>
+ <div id=d42></div>
+ <div id=d43 class="b">
+ <div id=d44 class="x">
+ <div id=d45 class="c"></div>
+ </div>
+ </div>
+ <div id=d46 class="x"></div>
+ <div id=d47 class="a">
+ </div>
+ </div>
+ <div>
+ <div id=d48 class="x">
+ <div id=d49 class="x">
+ <div id=d50 class="x d">
+ <div id=d51 class="x d">
+ <div id=d52 class="x">
+ <div id=d53 class="x e">
+ <div id=d54 class="f"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id=d55 class="x"></div>
+ <div id=d56 class="x d"></div>
+ <div id=d57 class="x d"></div>
+ <div id=d58 class="x"></div>
+ <div id=d59 class="x e"></div>
+ <div id=d60 class="f"></div>
+ </div>
+ <div>
+ <div id=d61 class="x"></div>
+ <div id=d62 class="x y"></div>
+ <div id=d63 class="x y">
+ <div id=d64 class="y g">
+ <div id=d65 class="y">
+ <div id=d66 class="y h">
+ <div id=d67 class="i"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id=d68 class="x y">
+ <div id=d69 class="x"></div>
+ <div id=d70 class="x"></div>
+ <div id=d71 class="x y">
+ <div id=d72 class="y g">
+ <div id=d73 class="y">
+ <div id=d74 class="y h">
+ <div id=d75 class="i"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id=d76 class="x"></div>
+ <div id=d77 class="j"><div id=d78><div id=d79></div></div></div>
+ </div>
+ <div id=d80 class="j"></div>
+ </div>
+</main>
+
+<script>
+ function formatElements(elements) {
+ return elements.map(e => e.id).sort().join();
+ }
+
+ // Test that |selector| returns the given elements in #main.
+ function test_selector_all(selector, expected) {
+ test(function() {
+ let actual = Array.from(main.querySelectorAll(selector));
+ assert_equals(formatElements(actual), formatElements(expected));
+ }, `${selector} matches expected elements`);
+ }
+
+ test_selector_all('.x:has(:scope .a)', [d02, d06, d07, d09, d12]);
+ test_selector_all('.x:has(:scope .a > .b)', [d09]);
+ test_selector_all('.x:has(:scope .a .b)', [d09, d12]);
+ test_selector_all('.x:has(:scope .a + .b)', [d12]);
+ test_selector_all('.x:has(:scope .a ~ .b)', [d02, d12]);
+ test_selector_all(':has(.x:scope .a)', [d02, d06, d07, d09, d12]);
+ test_selector_all(':has(.x:scope .a > .b)', [d09]);
+ test_selector_all(':has(.x:scope .a .b)', [d09, d12]);
+ test_selector_all(':has(.x:scope .a + .b)', [d12]);
+ test_selector_all(':has(.x:scope .a ~ .b)', [d02, d12]);
+ test_selector_all(':has(:scope.x .a)', [d02, d06, d07, d09, d12]);
+ test_selector_all(':has(:scope.x .a > .b)', [d09]);
+ test_selector_all(':has(:scope.x .a .b)', [d09, d12]);
+ test_selector_all(':has(:scope.x .a + .b)', [d12]);
+ test_selector_all(':has(:scope.x .a ~ .b)', [d02, d12]);
+
+ test_selector_all('.x:has(:scope > .a)', [d02, d07, d09, d12]);
+ test_selector_all('.x:has(:scope > .a > .b)', [d09]);
+ test_selector_all('.x:has(:scope > .a .b)', [d09, d12]);
+ test_selector_all('.x:has(:scope > .a + .b)', [d12]);
+ test_selector_all('.x:has(:scope > .a ~ .b)', [d02, d12]);
+ test_selector_all(':has(.x:scope > .a)', [d02, d07, d09, d12]);
+ test_selector_all(':has(.x:scope > .a > .b)', [d09]);
+ test_selector_all(':has(.x:scope > .a .b)', [d09, d12]);
+ test_selector_all(':has(.x:scope > .a + .b)', [d12]);
+ test_selector_all(':has(.x:scope > .a ~ .b)', [d02, d12]);
+ test_selector_all(':has(:scope.x > .a)', [d02, d07, d09, d12]);
+ test_selector_all(':has(:scope.x > .a > .b)', [d09]);
+ test_selector_all(':has(:scope.x > .a .b)', [d09, d12]);
+ test_selector_all(':has(:scope.x > .a + .b)', [d12]);
+ test_selector_all(':has(:scope.x > .a ~ .b)', [d02, d12]);
+
+ test_selector_all('.x:has(:scope + .a)', [d19, d21, d24, d28, d32, d37, d40, d46]);
+ test_selector_all('.x:has(:scope + .a > .b)', [d21]);
+ test_selector_all('.x:has(:scope + .a .b)', [d21, d24]);
+ test_selector_all('.x:has(:scope + .a + .b)', [d28, d32, d37]);
+ test_selector_all('.x:has(:scope + .a ~ .b)', [d19, d21, d24, d28, d32, d37, d40]);
+ test_selector_all(':has(.x:scope + .a)', [d19, d21, d24, d28, d32, d37, d40, d46]);
+ test_selector_all(':has(.x:scope + .a > .b)', [d21]);
+ test_selector_all(':has(.x:scope + .a .b)', [d21, d24]);
+ test_selector_all(':has(.x:scope + .a + .b)', [d28, d32, d37]);
+ test_selector_all(':has(.x:scope + .a ~ .b)', [d19, d21, d24, d28, d32, d37, d40]);
+ test_selector_all(':has(:scope.x + .a)', [d19, d21, d24, d28, d32, d37, d40, d46]);
+ test_selector_all(':has(:scope.x + .a > .b)', [d21]);
+ test_selector_all(':has(:scope.x + .a .b)', [d21, d24]);
+ test_selector_all(':has(:scope.x + .a + .b)', [d28, d32, d37]);
+ test_selector_all(':has(:scope.x + .a ~ .b)', [d19, d21, d24, d28, d32, d37, d40]);
+
+ test_selector_all('.x:has(:scope ~ .a)', [d18, d19, d21, d24, d28, d32, d37, d40, d46]);
+ test_selector_all('.x:has(:scope ~ .a > .b)', [d18, d19, d21]);
+ test_selector_all('.x:has(:scope ~ .a .b)', [d18, d19, d21, d24]);
+ test_selector_all('.x:has(:scope ~ .a + .b)', [d18, d19, d21, d24, d28, d32, d37]);
+ test_selector_all('.x:has(:scope ~ .a + .b > .c)', [d18, d19, d21, d24, d28]);
+ test_selector_all('.x:has(:scope ~ .a + .b .c)', [d18, d19, d21, d24, d28, d32]);
+ test_selector_all(':has(.x:scope ~ .a)', [d18, d19, d21, d24, d28, d32, d37, d40, d46]);
+ test_selector_all(':has(.x:scope ~ .a > .b)', [d18, d19, d21]);
+ test_selector_all(':has(.x:scope ~ .a .b)', [d18, d19, d21, d24]);
+ test_selector_all(':has(.x:scope ~ .a + .b)', [d18, d19, d21, d24, d28, d32, d37]);
+ test_selector_all(':has(.x:scope ~ .a + .b > .c)', [d18, d19, d21, d24, d28]);
+ test_selector_all(':has(.x:scope ~ .a + .b .c)', [d18, d19, d21, d24, d28, d32]);
+ test_selector_all(':has(:scope.x ~ .a)', [d18, d19, d21, d24, d28, d32, d37, d40, d46]);
+ test_selector_all(':has(:scope.x ~ .a > .b)', [d18, d19, d21]);
+ test_selector_all(':has(:scope.x ~ .a .b)', [d18, d19, d21, d24]);
+ test_selector_all(':has(:scope.x ~ .a + .b)', [d18, d19, d21, d24, d28, d32, d37]);
+ test_selector_all(':has(:scope.x ~ .a + .b > .c)', [d18, d19, d21, d24, d28]);
+ test_selector_all(':has(:scope.x ~ .a + .b .c)', [d18, d19, d21, d24, d28, d32]);
+
+ test_selector_all('.x:has(.d .e)', [d48, d49, d50]);
+ test_selector_all('.x:has(.d .e) .f', [d54]);
+ test_selector_all('.x:has(:scope .d .e)', [d48, d49, d50]);
+ test_selector_all('.x:has(:scope .d .e) .f', [d54]);
+ test_selector_all('.x:has(:scope > .d)', [d49, d50]);
+ test_selector_all('.x:has(:scope > .d) .f', [d54]);
+ test_selector_all('.x:has(:scope ~ .d ~ .e)', [d48, d55, d56]);
+ test_selector_all('.x:has(:scope ~ .d ~ .e) ~ .f', [d60]);
+ test_selector_all('.x:has(:scope + .d ~ .e)', [d55, d56]);
+ test_selector_all('.x:has(:scope + .d ~ .e) ~ .f', [d60]);
+ test_selector_all(':has(.x:scope .d .e)', [d48, d49, d50]);
+ test_selector_all(':has(.x:scope .d .e) .f', [d54]);
+ test_selector_all(':has(.x:scope > .d)', [d49, d50]);
+ test_selector_all(':has(.x:scope > .d) .f', [d54]);
+ test_selector_all(':has(.x:scope ~ .d ~ .e)', [d48, d55, d56]);
+ test_selector_all(':has(.x:scope ~ .d ~ .e) ~ .f', [d60]);
+ test_selector_all(':has(.x:scope + .d ~ .e)', [d55, d56]);
+ test_selector_all(':has(.x:scope + .d ~ .e) ~ .f', [d60]);
+ test_selector_all(':has(:scope.x .d .e)', [d48, d49, d50]);
+ test_selector_all(':has(:scope.x .d .e) .f', [d54]);
+ test_selector_all(':has(:scope.x > .d)', [d49, d50]);
+ test_selector_all(':has(:scope.x > .d) .f', [d54]);
+ test_selector_all(':has(:scope.x ~ .d ~ .e)', [d48, d55, d56]);
+ test_selector_all(':has(:scope.x ~ .d ~ .e) ~ .f', [d60]);
+ test_selector_all(':has(:scope.x + .d ~ .e)', [d55, d56]);
+ test_selector_all(':has(:scope.x + .d ~ .e) ~ .f', [d60]);
+
+ test_selector_all('.y:has(:scope > .g .h)', [d63, d71])
+ test_selector_all('.y:has(:scope .g .h)', [d63, d68, d71])
+ test_selector_all('.y:has(:scope > .g .h) .i', [d67, d75])
+ test_selector_all('.y:has(:scope .g .h) .i', [d67, d75])
+ test_selector_all('.x:has(:scope + .y:has(:scope > .g .h) .i)', [d62, d70])
+ test_selector_all('.x:has(:scope + .y:has(:scope .g .h) .i)', [d62, d63, d70])
+ test_selector_all('.x:has(:scope + .y:has(:scope > .g .h) .i) ~ .j', [d77, d80])
+ test_selector_all('.x:has(:scope + .y:has(:scope .g .h) .i) ~ .j', [d77, d80])
+ test_selector_all('.x:has(:scope ~ .y:has(:scope > .g .h) .i)', [d61, d62, d69, d70])
+ test_selector_all('.x:has(:scope ~ .y:has(:scope .g .h) .i)', [d61, d62, d63, d69, d70])
+ test_selector_all(':has(.y:scope > .g .h)', [d63, d71])
+ test_selector_all(':has(.y:scope .g .h)', [d63, d68, d71])
+ test_selector_all(':has(.y:scope > .g .h) .i', [d67, d75])
+ test_selector_all(':has(.y:scope .g .h) .i', [d67, d75])
+ test_selector_all(':has(.x:scope + :has(.y:scope > .g .h) .i)', [d62, d70])
+ test_selector_all(':has(.x:scope + :has(.y:scope .g .h) .i)', [d62, d63, d70])
+ test_selector_all(':has(.x:scope + :has(.y:scope > .g .h) .i) ~ .j', [d77, d80])
+ test_selector_all(':has(.x:scope + :has(.y:scope .g .h) .i) ~ .j', [d77, d80])
+ test_selector_all(':has(.x:scope ~ :has(.y:scope > .g .h) .i)', [d61, d62, d69, d70])
+ test_selector_all(':has(.x:scope ~ :has(.y:scope .g .h) .i)', [d61, d62, d63, d69, d70])
+ test_selector_all(':has(:scope.y > .g .h)', [d63, d71])
+ test_selector_all(':has(:scope.y .g .h)', [d63, d68, d71])
+ test_selector_all(':has(:scope.y > .g .h) .i', [d67, d75])
+ test_selector_all(':has(:scope.y .g .h) .i', [d67, d75])
+ test_selector_all(':has(:scope.x + :has(:scope.y > .g .h) .i)', [d62, d70])
+ test_selector_all(':has(:scope.x + :has(:scope.y .g .h) .i)', [d62, d63, d70])
+ test_selector_all(':has(:scope.x + :has(:scope.y > .g .h) .i) ~ .j', [d77, d80])
+ test_selector_all(':has(:scope.x + :has(:scope.y .g .h) .i) ~ .j', [d77, d80])
+ test_selector_all(':has(:scope.x ~ :has(:scope.y > .g .h) .i)', [d61, d62, d69, d70])
+ test_selector_all(':has(:scope.x ~ :has(:scope.y .g .h) .i)', [d61, d62, d63, d69, d70])
+
+ test_selector_all('.x:has(.d :scope .e)', [d51, d52])
+ test_selector_all(':has(.d .x:scope .e)', [d51, d52])
+ test_selector_all(':has(.d :scope.x .e)', [d51, d52])
+
+ test_selector_all('.x:has(.d ~ :scope ~ .e)', [d57, d58])
+ test_selector_all(':has(.d ~ .x:scope ~ .e)', [d57, d58])
+ test_selector_all(':has(.d ~ :scope.x ~ .e)', [d57, d58])
+
+ test_selector_all(':has(:scope .d :scope)', [])
+ test_selector_all(':has(:scope ~ .d ~ :scope)', [])
+</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-where-parsing-expected.txt (279580 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-where-parsing-expected.txt 2021-07-06 11:10:18 UTC (rev 279580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-where-parsing-expected.txt 2021-07-06 14:54:03 UTC (rev 279581)
@@ -1,8 +1,10 @@
+PASS Trailing whitespace
PASS Multiple selectors with combinators
PASS Nested :is
PASS Nested :where
PASS Nested inside :host, without combinators
+PASS Nested inside :host, with trailing whitespace
FAIL Nested inside :host, with combinators assert_not_equals: Nested inside :host, with combinators: :host(:is(div .foo)) got disallowed value ":host(:is(div .foo))"
PASS Pseudo-classes inside
PASS Pseudo-classes after
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-where-parsing.html (279580 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-where-parsing.html 2021-07-06 11:10:18 UTC (rev 279580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-where-parsing.html 2021-07-06 14:54:03 UTC (rev 279581)
@@ -10,15 +10,18 @@
</style>
<script>
let rule = document.getElementById("test-sheet").sheet.cssRules[0];
- function assert_valid(expected_valid, pattern, description) {
+ function assert_valid(expected_valid, pattern, expected_pattern, description) {
test(function() {
for (let pseudo of ["is", "where"]) {
- let selector = pattern.replace("{}", ":" + pseudo)
+ let selector = pattern.replace("{}", ":" + pseudo);
+ let expected_selector = selector;
+ if (expected_pattern != null)
+ expected_selector = expected_pattern.replace("{}", ":" + pseudo);
rule.selectorText = "random-selector";
rule.selectorText = selector;
(expected_valid ? assert_equals : assert_not_equals)(
rule.selectorText,
- selector,
+ expected_selector,
`${description}: ${selector}`
);
}
@@ -25,24 +28,26 @@
}, description);
}
- assert_valid(true, "{}(div + bar, div ~ .baz)", "Multiple selectors with combinators");
+ assert_valid(true, "{}(div )", "{}(div)", "Trailing whitespace");
+ assert_valid(true, "{}(div + bar, div ~ .baz)", null, "Multiple selectors with combinators");
- assert_valid(true, "{}(:is(div))", "Nested :is");
- assert_valid(true, "{}(:where(div))", "Nested :where");
+ assert_valid(true, "{}(:is(div))", null, "Nested :is");
+ assert_valid(true, "{}(:where(div))", null, "Nested :where");
- assert_valid(true, ":host({}(div))", "Nested inside :host, without combinators");
+ assert_valid(true, ":host({}(div))", null, "Nested inside :host, without combinators");
+ assert_valid(true, ":host({}(div ))", ":host({}(div))", "Nested inside :host, with trailing whitespace");
// See https://github.com/w3c/csswg-drafts/issues/5093
- assert_valid(false, ":host({}(div .foo))", "Nested inside :host, with combinators");
+ assert_valid(false, ":host({}(div .foo))", null, "Nested inside :host, with combinators");
- assert_valid(true, "{}(:hover, :active)", "Pseudo-classes inside");
- assert_valid(true, "{}(div):hover", "Pseudo-classes after");
- assert_valid(true, "{}(div)::before", "Pseudo-elements after");
- assert_valid(false, "{}(::before)", "Pseudo-elements inside");
+ assert_valid(true, "{}(:hover, :active)", null, "Pseudo-classes inside");
+ assert_valid(true, "{}(div):hover", null, "Pseudo-classes after");
+ assert_valid(true, "{}(div)::before", null, "Pseudo-elements after");
+ assert_valid(false, "{}(::before)", null, "Pseudo-elements inside");
- assert_valid(true, "{}(div) + bar", "Combinators after");
- assert_valid(true, "::part(foo):is(:hover)", "After part with simple pseudo-class");
- assert_valid(false, "::part(foo):is([attr='value'])", "After part with invalid selector after");
+ assert_valid(true, "{}(div) + bar", null, "Combinators after");
+ assert_valid(true, "::part(foo):is(:hover)", null, "After part with simple pseudo-class");
+ assert_valid(false, "::part(foo):is([attr='value'])", null, "After part with invalid selector after");
- assert_valid(true, ":not({}(div))", "Nested inside :not, without combinators");
- assert_valid(true, ":not({}(div .foo))", "Nested inside :not, with combinators");
+ assert_valid(true, ":not({}(div))", null, "Nested inside :not, without combinators");
+ assert_valid(true, ":not({}(div .foo))", null, "Nested inside :not, with combinators");
</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-has-expected.txt (0 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-has-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-has-expected.txt 2021-07-06 14:54:03 UTC (rev 279581)
@@ -0,0 +1,41 @@
+
+FAIL ":has(a)" should be a valid selector The string did not match the expected pattern.
+FAIL ":has(#a)" should be a valid selector The string did not match the expected pattern.
+FAIL ":has(.a)" should be a valid selector The string did not match the expected pattern.
+FAIL ":has([a])" should be a valid selector The string did not match the expected pattern.
+FAIL ":has([a=\"b\"])" should be a valid selector The string did not match the expected pattern.
+FAIL ":has([a|=\"b\"])" should be a valid selector The string did not match the expected pattern.
+FAIL ":has(:hover)" should be a valid selector The string did not match the expected pattern.
+FAIL "*:has(.a)" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(.b)" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(:scope .b)" should be a valid selector The string did not match the expected pattern.
+FAIL ":has(.a:scope .b)" should be a valid selector The string did not match the expected pattern.
+FAIL ":has(.a .b:scope)" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(> .b)" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(:scope > .b)" should be a valid selector The string did not match the expected pattern.
+FAIL ":has(.a:scope > .b)" should be a valid selector The string did not match the expected pattern.
+FAIL ":has(> .a .b:scope)" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(~ .b)" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(:scope ~ .b)" should be a valid selector The string did not match the expected pattern.
+FAIL ":has(.a:scope ~ .b)" should be a valid selector The string did not match the expected pattern.
+FAIL ":has(~ .a .b:scope)" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(+ .b)" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(:scope + .b)" should be a valid selector The string did not match the expected pattern.
+FAIL ":has(.a:scope + .b)" should be a valid selector The string did not match the expected pattern.
+FAIL ":has(+ .a .b:scope)" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(:scope .b :scope)" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(.b) .c" should be a valid selector The string did not match the expected pattern.
+FAIL ".a .b:has(.c)" should be a valid selector The string did not match the expected pattern.
+FAIL ".a .b:has(.c .d)" should be a valid selector The string did not match the expected pattern.
+FAIL ".a .b:has(.c .d) .e" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(.b:has(.c))" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(.b:is(.c .d))" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(.b:is(.c:has(.d) .e))" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:is(.b:has(.c) .d)" should be a valid selector assert_equals: serialization should be canonical expected ".a:is(.b:has(.c) .d)" but got ".a:is()"
+FAIL ".a:not(:has(.b))" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(:not(.b))" should be a valid selector The string did not match the expected pattern.
+FAIL ".a:has(.b):has(.c)" should be a valid selector The string did not match the expected pattern.
+FAIL "*|*:has(*)" should be a valid selector The string did not match the expected pattern.
+FAIL ":has(*|*)" should be a valid selector The string did not match the expected pattern.
+PASS ".a:has()" should be an invalid selector
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-has.html (0 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-has.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-has.html 2021-07-06 14:54:03 UTC (rev 279581)
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Selectors: The relational pseudo-class</title>
+<link rel="author" title="Byungwoo Lee" href=""
+<link rel="help" href=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+ test_valid_selector(':has(a)');
+ test_valid_selector(':has(#a)');
+ test_valid_selector(':has(.a)');
+ test_valid_selector(':has([a])');
+ test_valid_selector(':has([a="b"])');
+ test_valid_selector(':has([a|="b"])');
+ test_valid_selector(':has(:hover)');
+ test_valid_selector('*:has(.a)', ['*:has(.a)', ':has(.a)']);
+ test_valid_selector('.a:has(.b)');
+ test_valid_selector('.a:has(:scope .b)');
+ test_valid_selector(':has(.a:scope .b)');
+ test_valid_selector(':has(.a .b:scope)');
+ test_valid_selector('.a:has(> .b)');
+ test_valid_selector('.a:has(:scope > .b)');
+ test_valid_selector(':has(.a:scope > .b)');
+ test_valid_selector(':has(> .a .b:scope)');
+ test_valid_selector('.a:has(~ .b)');
+ test_valid_selector('.a:has(:scope ~ .b)');
+ test_valid_selector(':has(.a:scope ~ .b)');
+ test_valid_selector(':has(~ .a .b:scope)');
+ test_valid_selector('.a:has(+ .b)');
+ test_valid_selector('.a:has(:scope + .b)');
+ test_valid_selector(':has(.a:scope + .b)');
+ test_valid_selector(':has(+ .a .b:scope)');
+ test_valid_selector('.a:has(:scope .b :scope)');
+ test_valid_selector('.a:has(.b) .c');
+ test_valid_selector('.a .b:has(.c)');
+ test_valid_selector('.a .b:has(.c .d)');
+ test_valid_selector('.a .b:has(.c .d) .e');
+ test_valid_selector('.a:has(.b:has(.c))');
+ test_valid_selector('.a:has(.b:is(.c .d))');
+ test_valid_selector('.a:has(.b:is(.c:has(.d) .e))');
+ test_valid_selector('.a:is(.b:has(.c) .d)');
+ test_valid_selector('.a:not(:has(.b))');
+ test_valid_selector('.a:has(:not(.b))');
+ test_valid_selector('.a:has(.b):has(.c)');
+ test_valid_selector('*|*:has(*)', ':has(*)');
+ test_valid_selector(':has(*|*)', ':has(*)');
+ test_invalid_selector('.a:has()');
+</script>
\ No newline at end of file
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/w3c-import.log (279580 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/w3c-import.log 2021-07-06 11:10:18 UTC (rev 279580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/w3c-import.log 2021-07-06 14:54:03 UTC (rev 279581)
@@ -19,6 +19,7 @@
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-class.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-descendant.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-focus-visible.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-has.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-id.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-is.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-not.html
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-invalid.html (279580 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-invalid.html 2021-07-06 11:10:18 UTC (rev 279580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-invalid.html 2021-07-06 14:54:03 UTC (rev 279581)
@@ -3,10 +3,11 @@
<link rel="help" href=""
<script src=""
<script src=""
-<input>
+<input value="bar" pattern="foo">
<script>
test(() => {
const input = document.querySelector('input');
+ assert_false(input.validity.valid, "Should be invalid");
// The selector can't match because no interaction has happened.
assert_false(input.matches(':user-invalid'));
}, ':user-invalid selector should be supported');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-valid-expected.txt (0 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-valid-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-valid-expected.txt 2021-07-06 14:54:03 UTC (rev 279581)
@@ -0,0 +1,4 @@
+
+
+FAIL :user-valid selector should be supported The string did not match the expected pattern.
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-valid.html (0 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-valid.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-valid.html 2021-07-06 14:54:03 UTC (rev 279581)
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>Support for the :user-valid pseudo-class</title>
+<link rel="help" href=""
+<script src=""
+<script src=""
+<input>
+<script>
+test(() => {
+ const input = document.querySelector('input');
+ assert_true(input.validity.valid);
+ // The selector can't match because no interaction has happened.
+ assert_false(input.matches(':user-valid'));
+}, ':user-valid selector should be supported');
+</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/w3c-import.log (279580 => 279581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/w3c-import.log 2021-07-06 11:10:18 UTC (rev 279580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/w3c-import.log 2021-07-06 14:54:03 UTC (rev 279581)
@@ -50,6 +50,8 @@
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-018.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-019.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-020.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-021.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-022.tentative.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-script-focus-001.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-script-focus-002.tentative.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-script-focus-003.tentative.html
@@ -101,6 +103,8 @@
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-within-shadow-005.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-within-shadow-006-expected.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-within-shadow-006.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-basic.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-relative-argument.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/historical-xmlid-expected.xht
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/historical-xmlid.xht
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/hover-002.html
@@ -200,5 +204,6 @@
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/sharing-in-svg-use-expected.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/sharing-in-svg-use.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-invalid.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/user-valid.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/webkit-pseudo-element.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/x-pseudo-element.html
Modified: trunk/LayoutTests/platform/ios/TestExpectations (279580 => 279581)
--- trunk/LayoutTests/platform/ios/TestExpectations 2021-07-06 11:10:18 UTC (rev 279580)
+++ trunk/LayoutTests/platform/ios/TestExpectations 2021-07-06 14:54:03 UTC (rev 279581)
@@ -3244,6 +3244,7 @@
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-013.html [ Skip ]
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-019.html [ Skip ]
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-021.html [ Skip ]
+webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-022.tentative.html [ Skip ]
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-script-focus-004.html [ Skip ]
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-script-focus-005.html [ Skip ]
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-script-focus-012.html [ Skip ]
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
