Closed Bug 2092416 Opened 4 days ago Closed 2 days ago

[wpt-sync] Sync PR 64561 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=327922

Categories

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

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Ahmad Saleem <ahmad.saleem792+github@gmail.com> wrote:

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=327922

WebKit export from bug: Forgiving selector list recovery splits on commas inside blocks of an invalid selector

<pre>
Forgiving selector list recovery splits on commas inside blocks of an invalid selector

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

When a selector in a forgiving selector list (:is(), :where()) is invalid,
consumeForgivingSelectorList() skips ahead to the next comma one token at a time.
CSSParserTokenRange is flat, so a comma nested inside a (...) or [...] block was
treated as a top-level separator, and the tokens after it were parsed as a
separate selector. For example, :is(:unknown-pseudo(1, .b, .c)) matched
elements with class "b", because ".b" was followed by a comma and parsed as a
valid selector.

<a href="https://drafts.csswg.org/selectors-4/#typedef-forgiving-selector-list">https://drafts.csswg.org/selectors-4/#typedef-forgiving-selector-list</a> says:

 &quot;Syntactically, &lt;forgiving-selector-list&gt; is equivalent to &lt;any-value&gt;?.
 It is then parsed as a forgiving selector list to obtain its actual value.

 To parse as a forgiving selector list given an input input:
 1. Parse a list of &lt;complex-real-selector&gt;s from input, and let selector
    list be the result.
 2. Remove all failure items from selector list, and all items that are
    invalid selectors, then return a &lt;selector-list&gt; representing the
    remaining items in selector list.&quot;

The argument is parsed as component values, so a (...) or [...] block is a
single component value and a comma inside it does not separate list items.
The whole :unknown-pseudo(1, .b, .c) is therefore one invalid item, which is
removed, and :is() matches nothing. Skip whole component values (blocks
included) while recovering.

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=327922">https://bugs.webkit.org/show_bug.cgi?id=327922</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/325466@main">https://commits.webkit.org/325466@main</a>
</pre>

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

CI Results

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

Total 839 tests

Status Summary

Firefox

OK : 1[GitHub] 477[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS : 19[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt, GitHub] 6127[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 6462[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview] 6463[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 6464[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt]
FAIL : 157[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 162[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt] 163[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PRECONDITION_FAILED: 1
TIMEOUT : 1

Chrome

OK : 1
PASS : 19

Safari

OK : 1
PASS : 10
FAIL : 9

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /css/selectors/featureless-005.html [wpt.fyi]: FAIL
  • /css/selectors/is-default-ns-003.html [wpt.fyi]: FAIL
  • /css/selectors/is-where-visited.html [wpt.fyi]: FAIL
  • /css/selectors/not-default-ns-003.html [wpt.fyi]: FAIL
  • /css/selectors/remove-hovered-element.html [wpt.fyi]: PASS [Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], SKIP [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview]
  • /css/selectors/i18n/lang-pseudo-class-across-shadow-boundaries.html [wpt.fyi]: FAIL
  • /css/selectors/invalidation/lang-pseudo-class-in-has-multiple-document-elements.html [wpt.fyi]: FAIL [Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], PASS [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt]
  • /css/selectors/active-toplayer-001.html [wpt.fyi]
    • Clicking inside a modal dialog should not propagate :active beyond the dialog.: FAIL
    • Clicking inside a popover should not propagate :active beyond the popover.: FAIL
    • With nested top layer elements, :active should stop at the innermost top layer boundary.: FAIL
  • /css/selectors/class-prefix-selector-has-invalidation.tentative.html [wpt.fyi]
    • :has(> .foo-*) invalidates the :has() subject when a direct child gains/loses a matching class: FAIL
    • :has(.foo-*) invalidates the :has() subject when a descendant at any depth gains/loses a matching class: FAIL
    • :has(+ .foo-*) invalidates the :has() subject when its immediately following sibling gains/loses a matching class: FAIL
    • :has(~ .foo-*) invalidates the :has() subject when a later (non-adjacent) sibling gains/loses a matching class: FAIL
    • :has(~ .bar > .foo-*) invalidates the :has() subject when a direct child of a later ".bar" sibling gains/loses a matching class: FAIL
    • :has(~ .bar .foo-*) invalidates the :has() subject when a descendant, at any depth, of a later ".bar" sibling gains/loses a matching class: FAIL
    • :has(.foo-*) in non-subject (ancestor) position invalidates a separate descendant of the :has() bearer: FAIL
    • :has(> .foo-*) in non-subject (parent) position invalidates a sibling child of the :has() bearer: FAIL
  • /css/selectors/class-prefix-selector-has-matching.tentative.html [wpt.fyi]
    • :has(.foo-*) matches an element with a descendant, at any depth, whose class matches the prefix: FAIL
    • :has(> .foo-*) only matches a direct child, unlike the plain descendant form: FAIL
    • :has(+ .foo-*) matches when the immediately following sibling matches the prefix: FAIL
    • :has(~ .foo-*) matches a later sibling that is not the immediately following one: FAIL
    • :has(~ .bar > .foo-*) matches when a later sibling has a matching direct child: FAIL
    • :has(~ .bar .foo-*) matches at any depth under a later sibling, unlike the direct-child form: FAIL
    • class prefix selector works inside :has() used as a :not() argument: FAIL
    • a class prefix selector on the same compound as :has() still matches normally: FAIL
  • /css/selectors/class-prefix-selector-invalidation.tentative.html [wpt.fyi]
    • adding/removing a class that starts matching the prefix invalidates the element itself (subject position): FAIL
    • a class change on an ancestor invalidates descendants selected through the class prefix selector: FAIL
    • a class change on a preceding sibling invalidates a following sibling selected through the class prefix selector: FAIL
  • /css/selectors/class-prefix-selector-matching-quirks.tentative.html [wpt.fyi]
    • class="foo-bar" matches .foo-* in quirks mode: FAIL
    • class="FOO-bar" matches .foo-* in quirks mode (the class attribute value itself is ASCII-lowercased by the quirks mode class-matching quirk): FAIL
    • class="FOO-bar" does not match .FOO-* in quirks mode: unlike a regular class selector, the class prefix selector itself is never case-folded, so writing it in a different case than the (quirks-mode-lowercased) class attribute never matches: FAIL
  • /css/selectors/class-prefix-selector-matching.tentative.html [wpt.fyi]
    • class="foo-bar-baz" matches .foo-*: FAIL
    • class="foo-bar-baz" matches .foo-bar-*: FAIL
    • class="foo--bar" matches .foo--*: FAIL
    • class="foo--bar" does not match .foo-* (the separator is "--", not "-"): FAIL
    • class="foo-bar-" (ends in a dash) matches .foo-*: FAIL
    • class="foo-bar-" does not match .foo-bar-* (nothing left after the prefix): FAIL
    • class="foobar" does not match .foo-* (no "-" separator): FAIL
    • class="foo-" does not match .foo-* (no character beyond the prefix): FAIL
    • class="foo-a" matches .foo-* (exactly one character beyond the prefix): FAIL
    • a class matching the prefix among several space-separated classes still matches: FAIL
    • an element with no class attribute does not match .foo-*: FAIL
    • class prefix selector combines with a type selector in a compound: FAIL
    • class prefix selector combines with another class selector in a compound: FAIL
    • class prefix selector works as a :not() argument: FAIL
    • class prefix selector works inside :is(): FAIL
    • class="foo---baz" matches .foo---* (a three-hyphen prefix works the same way as one or two hyphens): FAIL
    • class="foo---baz" does not match .foo--* (the separator is "---", not "--"): FAIL
    • class="foo----qux" does not match .foo---* but does match .foo----* (an extra hyphen right after the prefix disqualifies a shorter prefix match): FAIL
  • /css/selectors/class-prefix-selector-queryselector.tentative.html [wpt.fyi]
    • querySelectorAll(".foo-*") returns matching elements in document order and excludes non-matches (foobar, foo-): FAIL
    • querySelector(".foo-*") returns the first matching element in document order: FAIL
    • querySelectorAll with a selector list containing a class prefix selector does not duplicate an element that matches more than one branch: FAIL
    • Element.closest() finds an ancestor via the class prefix selector: FAIL
    • Element.closest() matches the element itself first: FAIL
    • Element.closest() returns null when no ancestor matches the class prefix selector: FAIL
  • /css/selectors/featureless-006.html [wpt.fyi]
    • :host:has(.inner) matches the shadow host: FAIL
    • :not(:host:has(.nope)) matches the shadow host: FAIL
    • :not(:has(.nope):host) matches the shadow host: FAIL
  • /css/selectors/focus-visible-007.html [wpt.fyi]
    • Using keyboard while element is focused should trigger :focus-visible; using mouse without moving focus should not cancel it; moving focus using mouse should cancel it.: FAIL
  • /css/selectors/focus-visible-011.html [wpt.fyi]
    • :focus-visible matches even if preventDefault() is called: FAIL
  • /css/selectors/focus-within-toplayer-001.html [wpt.fyi]
    • Focusing inside a modal dialog should not propagate :focus-within beyond the dialog.: FAIL
    • Focusing inside a popover should not propagate :focus-within beyond the popover.: FAIL
    • With nested top layer elements, :focus-within should stop at the innermost top layer boundary.: FAIL
  • /css/selectors/hover-toplayer-001.html [wpt.fyi]
    • Hovering inside a modal dialog should not propagate :hover beyond the dialog.: FAIL
    • Hovering inside a popover should not propagate :hover beyond the popover.: FAIL
    • With nested top layer elements, :hover should stop at the innermost top layer boundary.: FAIL
  • /css/selectors/is-where-shadow.html [wpt.fyi]
    • :is() inside :host-context(): FAIL
  • /css/selectors/open-pseudo.html [wpt.fyi]
    • The select element should support :open.: FAIL [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview], PASS [Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
  • /css/selectors/toplayer-transition-001.html [wpt.fyi]
    • :focus-within should be adjusted on ancestors when popover enters/exits top layer.: FAIL
    • :hover should be adjusted on ancestors when popover enters/exits top layer.: FAIL
  • /css/selectors/user-action-pseudo-top-layer.html [wpt.fyi]
    • User action pseudo-classes on dialog (modal): FAIL
    • User action pseudo-classes on popover (popover): FAIL
    • User action pseudo-classes on customizable-select (open): PRECONDITION_FAILED
  • /css/selectors/user-invalid.html [wpt.fyi]
    • A required date should match :user-invalid if the user unchecks it and blurs.: FAIL
  • /css/selectors/user-valid-user-invalid-multifield-inputs.tentative.html [wpt.fyi]
    • <input type=date> keyboard behavior for :user-valid/:user-invalid.: FAIL
    • <input type=time> keyboard behavior for :user-valid/:user-invalid.: FAIL
    • <input type=datetime-local> keyboard behavior for :user-valid/:user-invalid.: FAIL
  • /css/selectors/user-valid.html [wpt.fyi]
    • Date inputs should match :user-valid after the user types a value into it.: FAIL
  • /css/selectors/invalidation/host-context-pseudo-class-in-has.html [wpt.fyi]
    • After adding 'a' to #host_parent: Check #subject1 color: FAIL
    • After adding 'a' to #host_parent: Check #subject2 color: FAIL
  • /css/selectors/invalidation/host-has-shadow-tree-element-at-nonsubject-position.html [wpt.fyi]
    • Add .descendant to #shadow_child: FAIL
    • Add .descendant to #shadow_descendant: FAIL
    • Add .ancestor to #shadow_child:has(.descendant): FAIL
    • Remove .ancestor from #shadow_child:has(.descendant): FAIL
    • Add .child to #shadow_child:has(.descendant): FAIL
    • Remove .child from #shadow_child:has(.descendant): FAIL
    • Add .child to #shadow_child: FAIL
    • Add .grand_child to #shadow_descendant: FAIL
    • Add .host_context to #host: FAIL
    • Add .descendant to #shadow_descendant.grand_child: FAIL
    • Remove .descendant from #shadow_descendant.grand_child: FAIL
    • Remove .grand_child from #shadow_descendant: FAIL
    • Insert #first_child.descendant to shadow root: FAIL
    • Insert #last_child.descendant to shadow root: FAIL
    • Insert #child_in_middle.descendant before #shadow_child: FAIL
    • Insert #grand_child.descendant before #shadow_descendant: FAIL
  • /css/selectors/invalidation/host-has-shadow-tree-element-at-subject-position.html [wpt.fyi]
    • Add .descendant to #shadow_child: FAIL
    • Add .descendant to #shadow_descendant: FAIL
    • Add .ancestor to #shadow_child:has(.descendant): FAIL
    • Remove .ancestor from #shadow_child:has(.descendant): FAIL
    • Add .child to #shadow_child:has(.descendant): FAIL
    • Remove .child from #shadow_child:has(.descendant): FAIL
    • Add .child to #shadow_child: FAIL
    • Add .grand_child to #shadow_descendant: FAIL
    • Add .host_context to #host: FAIL
    • Add .descendant to #shadow_descendant.grand_child: FAIL
    • Remove .descendant from #shadow_descendant.grand_child: FAIL
    • Remove .grand_child from #shadow_descendant: FAIL
    • Insert #first_child.descendant to shadow root: FAIL
    • Insert #last_child.descendant to shadow root: FAIL
    • Insert #child_in_middle.descendant before #shadow_child: FAIL
    • Insert #grand_child.descendant before #shadow_descendant: FAIL
  • /css/selectors/invalidation/option-disabled-when-ancestor-changes.html [wpt.fyi]
    • option :disabled and :has(option:disabled) invalidate when ancestor select disabled toggles: FAIL
    • optgroup :disabled and :has(optgroup:disabled) invalidate when ancestor select disabled toggles: FAIL
    • option :disabled and :has(option:disabled) invalidate when ancestor fieldset disabled toggles: FAIL
    • optgroup :disabled and :has(optgroup:disabled) invalidate when ancestor fieldset disabled toggles: FAIL
  • /css/selectors/invalidation/part-lang.html [wpt.fyi]
    • ::part():lang() invalidation: FAIL
    • ::part():lang() invalidation from setAttribute: FAIL
  • /css/selectors/old-tests/css3-modsel-22.xml [wpt.fyi]
    • li:lang(en-GB) matches: FAIL
  • /css/selectors/parsing/parse-class-prefix.tentative.html [wpt.fyi]
    • ".foo-*" should be a valid selector: FAIL
    • ".foo--*" should be a valid selector: FAIL
    • ".foo---*" should be a valid selector: FAIL
    • ".foo-bar-*" should be a valid selector: FAIL
    • ".foo-" should be a valid selector: FAIL
    • "h1.foo-*" should be a valid selector: FAIL
    • "p.foo-.bar-" should be a valid selector: FAIL
    • ".foo-*:hover" should be a valid selector: FAIL
    • ":not(.foo-*)" should be a valid selector: FAIL
    • ":is(.foo-*)" should be a valid selector: FAIL
    • ".foo-* .bar" should be a valid selector: FAIL
  • /css/selectors/parsing/parse-has-class-prefix.tentative.html [wpt.fyi]
    • ":has(.foo-*)" should be a valid selector: FAIL
    • ":has(> .foo-*)" should be a valid selector: FAIL
    • ":has(+ .foo-*)" should be a valid selector: FAIL
    • ":has(~ .foo-*)" should be a valid selector: FAIL
    • ":has(~ .bar > .foo-*)" should be a valid selector: FAIL
    • ":has(~ .bar .foo-*)" should be a valid selector: FAIL
    • ".a:has(.foo-*)" should be a valid selector: FAIL
    • ".foo-*:has(.a)" should be a valid selector: FAIL
    • ":has(.foo-*) .a" should be a valid selector: FAIL
    • ":has(> .foo-*) > .a" should be a valid selector: FAIL
    • ":not(:has(.foo-*))" should be a valid selector: FAIL
    • ":has(.foo-, .bar-)" should be a valid selector: FAIL
    • ":has(.foo-):has(.bar-)" should be a valid selector: FAIL
  • /css/selectors/parsing/parse-has-slotted.tentative.html [wpt.fyi]
    • ":has-slotted(bar)" should be a valid selector: FAIL
    • ":has-slotted([attr="foo"])" should be a valid selector: FAIL
    • ":has-slotted(*)" should be a valid selector: FAIL
    • ":has-slotted(.class)" should be a valid selector: FAIL
    • ":has-slotted(#id)" should be a valid selector: FAIL
    • ":has-slotted(:not(foo))" should be a valid selector: FAIL
    • ":has-slotted(:not(:nth-last-of-type(2)):not([slot="foo"]))" should be a valid selector: FAIL
    • ":has-slotted(:first-child)" should be a valid selector: FAIL
    • ":has-slotted(:hover)" should be a valid selector: FAIL
    • ":has-slotted(foo):first-child" should be a valid selector: FAIL
    • ":has-slotted(foo):hover" should be a valid selector: FAIL
    • ":has-slotted(foo):focus" should be a valid selector: FAIL
    • ":has-slotted(foo):lang(en)" should be a valid selector: FAIL
    • ":has-slotted(foo):dir(ltr)" should be a valid selector: FAIL
    • ":has-slotted(foo) + :has-slotted(bar)" should be a valid selector: FAIL
    • ":not(:has-slotted(foo))" should be a valid selector: FAIL
    • ":has-slotted(div + div)" should be a valid selector: FAIL
    • ":has-slotted(div:has(> span))" should be a valid selector: FAIL
  • /css/selectors/selectors-4/lang-singleton-subtag-matching.html [wpt.fyi]
    • :lang(fr-x) matches lang="fr-x" and lang="fr-x-standard" (singleton "x" matches): FAIL
    • :lang(fr-x) matches the correct elements: FAIL
    • :lang(fr) does not match lang="fr-ninechars" (subtag exceeds 8-char limit): FAIL
    • :lang(zh-x) matches both lang="zh-x" and lang="zh-x-foobar": FAIL
  • /css/selectors/crashtests/chrome-bug-565742178.html [wpt.fyi]: TIMEOUT

Tests Disabled in Gecko Infrastructure

  • /css/selectors/remove-hovered-element.html [wpt.fyi]: PASS [Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], SKIP [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview]
Status: NEW → RESOLVED
Closed: 2 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.