Closed Bug 1773941 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 34385 - Apply the resolution of csswg issue #6952 : disallow nesting :has()

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox103 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 34385 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/34385
Details from upstream follow.

Byungwoo Lee <blee@igalia.com> wrote:

Apply the resolution of csswg issue #6952 : disallow nesting :has()

Remove nesting :has() cases from the existing wpt tests and add a
tentative wpt test to check disallowing nesting :has() inside :has().

https://github.com/w3c/csswg-drafts/issues/6952#issuecomment-1143812466

Bug: 669058, 1334631
Change-Id: I549ee9d5b1ca17d22f7f8982d0e9ff96df6937df

Reviewed-on: https://chromium-review.googlesource.com/3697654
WPT-Export-Revision: 5275aedd21b1ce6b144c72865dbed03edd5e876c

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 4 tests and 27 subtests

Status Summary

Firefox

OK : 4
PASS: 3
FAIL: 80

Chrome

OK : 4
PASS: 83

Safari

OK : 4
PASS: 81
FAIL: 2

Links

GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

  • /css/selectors/has-basic.html [wpt.fyi]
    • :has(#a) matches expected elements: FAIL
    • :has(.ancestor) matches expected elements: FAIL
    • :has(.target) matches expected elements: FAIL
    • :has(.descendant) matches expected elements: FAIL
    • .parent:has(.target) matches expected elements: FAIL
    • :has(.sibling ~ .target) matches expected elements: FAIL
    • .parent:has(.sibling ~ .target) matches expected elements: FAIL
    • :has(:is(.target ~ .sibling .descendant)) matches expected elements: FAIL
    • .parent:has(:is(.target ~ .sibling .descendant)) matches expected elements: FAIL
    • .sibling:has(.descendant) ~ .target matches expected elements: FAIL
    • :has(> .parent) matches expected elements: FAIL
    • :has(> .target) matches expected elements: FAIL
    • :has(> .parent, > .target) matches expected elements: FAIL
    • :has(+ #h) matches expected elements: FAIL
    • .parent:has(~ #h) matches expected elements: FAIL
    • .sibling:has(.descendant) matches expected element: FAIL
    • closest(.ancestor:has(.descendant)) returns expected element: FAIL
    • :has(.target ~ .sibling .descendant) matches expectedly: FAIL
  • /css/selectors/has-relative-argument.html [wpt.fyi]
    • .x:has(.a) matches expected elements: FAIL
    • .x:has(.a > .b) matches expected elements: FAIL
    • .x:has(.a .b) matches expected elements: FAIL
    • .x:has(.a + .b) matches expected elements: FAIL
    • .x:has(.a ~ .b) matches expected elements: FAIL
    • .x:has(> .a) matches expected elements: FAIL
    • .x:has(> .a > .b) matches expected elements: FAIL
    • .x:has(> .a .b) matches expected elements: FAIL
    • .x:has(> .a + .b) matches expected elements: FAIL
    • .x:has(> .a ~ .b) matches expected elements: FAIL
    • .x:has(+ .a) matches expected elements: FAIL
    • .x:has(+ .a > .b) matches expected elements: FAIL
    • .x:has(+ .a .b) matches expected elements: FAIL
    • .x:has(+ .a + .b) matches expected elements: FAIL
    • .x:has(+ .a ~ .b) matches expected elements: FAIL
    • .x:has(~ .a) matches expected elements: FAIL
    • .x:has(~ .a > .b) matches expected elements: FAIL
    • .x:has(~ .a .b) matches expected elements: FAIL
    • .x:has(~ .a + .b) matches expected elements: FAIL
    • .x:has(~ .a + .b > .c) matches expected elements: FAIL
    • .x:has(~ .a + .b .c) matches expected elements: FAIL
    • .x:has(.d .e) matches expected elements: FAIL
    • .x:has(.d .e) .f matches expected elements: FAIL
    • .x:has(> .d) matches expected elements: FAIL
    • .x:has(> .d) .f matches expected elements: FAIL
    • .x:has(~ .d ~ .e) matches expected elements: FAIL
    • .x:has(~ .d ~ .e) ~ .f matches expected elements: FAIL
    • .x:has(+ .d ~ .e) matches expected elements: FAIL
    • .x:has(+ .d ~ .e) ~ .f matches expected elements: FAIL
    • .y:has(> .g .h) matches expected elements: FAIL
    • .y:has(.g .h) matches expected elements: FAIL
    • .y:has(> .g .h) .i matches expected elements: FAIL
    • .y:has(.g .h) .i matches expected elements: FAIL
    • .d .x:has(.e) matches expected elements: FAIL
    • .d ~ .x:has(~ .e) matches expected elements: FAIL
  • /css/selectors/parsing/parse-has-disallow-nesting-has-inside-has.tentative.html [wpt.fyi]
    • ".a:has(.b:has(.c), .d)" should be a valid selector: FAIL
    • ".a:has(.b:is(.c:has(.d) .e))" should be a valid selector: FAIL
  • /css/selectors/parsing/parse-has.html [wpt.fyi]
    • ":has(a)" should be a valid selector: FAIL linked bug:Bug 1771692
    • ":has(#a)" should be a valid selector: FAIL linked bug:Bug 1771692
    • ":has(.a)" should be a valid selector: FAIL linked bug:Bug 1771692
    • ":has([a])" should be a valid selector: FAIL linked bug:Bug 1771692
    • ":has([a="b"])" should be a valid selector: FAIL linked bug:Bug 1771692
    • ":has([a|="b"])" should be a valid selector: FAIL linked bug:Bug 1771692
    • ":has(:hover)" should be a valid selector: FAIL linked bug:Bug 1771692
    • "*:has(.a)" should be a valid selector: FAIL linked bug:Bug 1771692
    • ".a:has(.b)" should be a valid selector: FAIL linked bug:Bug 1771692
    • ".a:has(> .b)" should be a valid selector: FAIL linked bug:Bug 1771692
    • ".a:has(~ .b)" should be a valid selector: FAIL linked bug:Bug 1771692
    • ".a:has(+ .b)" should be a valid selector: FAIL linked bug:Bug 1771692
    • ".a:has(.b) .c" should be a valid selector: FAIL linked bug:Bug 1771692
    • ".a .b:has(.c)" should be a valid selector: FAIL linked bug:Bug 1771692
    • ".a .b:has(.c .d)" should be a valid selector: FAIL linked bug:Bug 1771692
    • ".a .b:has(.c .d) .e" should be a valid selector: FAIL linked bug:Bug 1771692
    • ".a:has(.b:is(.c .d))" should be a valid selector: FAIL linked bug:Bug 1771692
    • ".a:is(.b:has(.c) .d)" should be a valid selector: FAIL linked bug:Bug 1771692
    • ".a:not(:has(.b))" should be a valid selector: FAIL linked bug:Bug 1771692
    • ".a:has(:not(.b))" should be a valid selector: FAIL linked bug:Bug 1771692
    • ".a:has(.b):has(.c)" should be a valid selector: FAIL linked bug:Bug 1771692
    • "|:has(*)" should be a valid selector: FAIL linked bug:Bug 1771692
    • ":has(|)" should be a valid selector: FAIL linked bug:Bug 1771692

New Tests That Don't Pass

  • /css/selectors/has-basic.html [wpt.fyi]
    • :has(#a) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • :has(.ancestor) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • :has(.target) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • :has(.descendant) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .parent:has(.target) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • :has(.sibling ~ .target) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .parent:has(.sibling ~ .target) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • :has(:is(.target ~ .sibling .descendant)) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .parent:has(:is(.target ~ .sibling .descendant)) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .sibling:has(.descendant) ~ .target matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • :has(> .parent) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • :has(> .target) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • :has(> .parent, > .target) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • :has(+ #h) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .parent:has(~ #h) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .sibling:has(.descendant) matches expected element: FAIL (Chrome: PASS, Safari: PASS)
    • closest(.ancestor:has(.descendant)) returns expected element: FAIL (Chrome: PASS, Safari: PASS)
    • :has(.target ~ .sibling .descendant) matches expectedly: FAIL (Chrome: PASS, Safari: PASS)
  • /css/selectors/has-relative-argument.html [wpt.fyi]
    • .x:has(.a) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(.a > .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(.a .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(.a + .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(.a ~ .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(> .a) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(> .a > .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(> .a .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(> .a + .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(> .a ~ .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(+ .a) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(+ .a > .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(+ .a .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(+ .a + .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(+ .a ~ .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(~ .a) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(~ .a > .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(~ .a .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(~ .a + .b) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(~ .a + .b > .c) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(~ .a + .b .c) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(.d .e) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(.d .e) .f matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(> .d) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(> .d) .f matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(~ .d ~ .e) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(~ .d ~ .e) ~ .f matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(+ .d ~ .e) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .x:has(+ .d ~ .e) ~ .f matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .y:has(> .g .h) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .y:has(.g .h) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .y:has(> .g .h) .i matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .y:has(.g .h) .i matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .d .x:has(.e) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
    • .d ~ .x:has(~ .e) matches expected elements: FAIL (Chrome: PASS, Safari: PASS)
  • /css/selectors/parsing/parse-has-disallow-nesting-has-inside-has.tentative.html [wpt.fyi]
    • ".a:has(.b:has(.c))" should be a valid selector: FAIL (Chrome: PASS, Safari: FAIL)
    • ".a:has(.b:has(.c), .d)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a:has(.b:is(.c:has(.d) .e))" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
  • /css/selectors/parsing/parse-has.html [wpt.fyi]
    • ":has(a)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ":has(#a)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ":has(.a)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ":has([a])" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ":has([a="b"])" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ":has([a|="b"])" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ":has(:hover)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • "*:has(.a)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a:has(.b)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a:has(> .b)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a:has(~ .b)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a:has(+ .b)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a:has(.b) .c" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a .b:has(.c)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a .b:has(.c .d)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a .b:has(.c .d) .e" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a:has(.b:is(.c .d))" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a:is(.b:has(.c) .d)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a:not(:has(.b))" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a:has(:not(.b))" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a:has(.b):has(.c)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • "|:has(*)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ":has(|)" should be a valid selector: FAIL (Chrome: PASS, Safari: PASS)
    • ".a:has()" should be a valid selector: FAIL (Chrome: PASS, Safari: FAIL)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6ff9614c1927 [wpt PR 34385] - Apply the resolution of csswg issue #6952 : disallow nesting :has(), a=testonly https://hg.mozilla.org/integration/autoland/rev/8497851983dd [wpt PR 34385] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
You need to log in before you can comment on or make changes to this bug.