Skip to content

Commit

Permalink
Apply the resolution of csswg issue #6952 : disallow nesting :has()
Browse files Browse the repository at this point in the history
Remove nesting :has() cases from the existing wpt tests and add a
tentative wpt test to check disallowing nesting :has() inside :has().

w3c/csswg-drafts#6952 (comment)

Bug: 669058, 1334631
Change-Id: I549ee9d5b1ca17d22f7f8982d0e9ff96df6937df
  • Loading branch information
byung-woo authored and chromium-wpt-export-bot committed Jun 13, 2022
1 parent df393ed commit 8b9efe6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
4 changes: 0 additions & 4 deletions css/selectors/has-basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@
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(> .parent)', [a]);
test_selector_all(':has(> .target)', [b, f, h]);
test_selector_all(':has(> .parent, > .target)', [a, b, f, h]);
Expand Down
6 changes: 0 additions & 6 deletions css/selectors/has-relative-argument.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,6 @@
test_selector_all('.y:has(.g .h)', [d63, d68, d71])
test_selector_all('.y:has(> .g .h) .i', [d67, d75])
test_selector_all('.y:has(.g .h) .i', [d67, d75])
test_selector_all('.x:has(+ .y:has(> .g .h) .i)', [d62, d70])
test_selector_all('.x:has(+ .y:has(.g .h) .i)', [d62, d63, d70])
test_selector_all('.x:has(+ .y:has(> .g .h) .i) ~ .j', [d77, d80])
test_selector_all('.x:has(+ .y:has(.g .h) .i) ~ .j', [d77, d80])
test_selector_all('.x:has(~ .y:has(> .g .h) .i)', [d61, d62, d69, d70])
test_selector_all('.x:has(~ .y:has(.g .h) .i)', [d61, d62, d63, d69, d70])

test_selector_all('.d .x:has(.e)', [d51, d52])

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Selectors: The relational pseudo-class (disallow nesting :has() inside :has())</title>
<link rel="author" title="Byungwoo Lee" href="mailto:blee@igalia.com">
<link rel="help" href="https://drafts.csswg.org/selectors-4/#has-pseudo">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<script>
test_valid_selector('.a:has(.b:has(.c))', '.a:has()');
test_valid_selector('.a:has(.b:has(.c), .d)', '.a:has(.d)');
test_valid_selector('.a:has(.b:is(.c:has(.d) .e))', '.a:has(.b:is())');
</script>
2 changes: 0 additions & 2 deletions css/selectors/parsing/parse-has.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
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))');
Expand Down

0 comments on commit 8b9efe6

Please sign in to comment.