Closed Bug 2086900 Opened 1 month ago Closed 18 days ago

[wpt-sync] Sync PR 64115 - Add a WPT for user-action pseudo-classes when an ancestor changes

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 64115 into mozilla-central (this bug is closed when the sync is complete).

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

Daniil Sakhapov <sakhapov@chromium.org> wrote:

Add a WPT for user-action pseudo-classes when an ancestor changes

For a rule like .a :hover, Blink invalidates the whole subtree when
class a is added to or removed from an element. That recalc is what
re-establishes the AffectedByHover/Active/FocusWithin flags on the
descendants' ComputedStyle, and those flags are what makes a later
hover, active or focus-within change recalculate the element. So the
over-invalidation is load-bearing: an optimization which only restyles
the descendants currently in the state (as attempted in
https://crrev.com/c/8536747) breaks the sequence "ancestor gains the
class, then the state moves to a descendant that was not restyled".

No existing test covers that sequence: the hover/focus invalidation
tests either have the rule in scope from the start, or only check the
element which is in the state at the time of the class change. This
adds a WPT for :focus, :focus-within, :is(:focus, .other), :not(:focus),
a sibling :focus rule, :hover and :hover:active, where the state moves
to a different element after the ancestor/sibling change.

The test passes today and serves as a regression test for the
:focus-only optimization that follows, and for any later extension of
it to other pseudo-classes.

Change-Id: Ib24d19c3205456b1bddaee389426adad4fe1de35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8629833
Reviewed-by: Philip Jägenstedt \<foolip@chromium.org>
Commit-Queue: Daniil Sakhapov \<sakhapov@chromium.org>
Reviewed-by: Rune Lillesveen \<futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1725743}

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

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

Total 147 tests and 5 subtests

Status Summary

Firefox

OK : 2[GitHub] 80[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: 6[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt, GitHub] 2908[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 2968[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 2969[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]
FAIL: 93[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] 94[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]

Chrome

OK : 2
PASS: 6

Safari

OK : 2
PASS: 6

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /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/invalidation/heading-pseudo-class-in-has-with-headingoffset.html [wpt.fyi]
    • Initial colors: #has_heading_1: FAIL
    • Initial colors: #has_heading_1_2: FAIL
    • h1[headingoffset=1]: #has_heading_2: FAIL
    • h1[headingoffset=1]: #has_heading_1_2: FAIL
    • h1[headingoffset=2]: #has_heading_3: FAIL
    • h1 with headingoffset removed: #has_heading_1: FAIL
    • h1 with headingoffset removed: #has_heading_1_2: FAIL
    • ancestor[headingoffset=1]: #has_heading_2: FAIL
    • ancestor[headingoffset=1]: #has_heading_1_2: FAIL
    • ancestor[headingoffset=2]: #has_heading_3: FAIL
    • h1[headingreset] (cuts ancestor offset): #has_heading_1: FAIL
    • h1[headingreset] (cuts ancestor offset): #has_heading_1_2: FAIL
    • h1 with headingreset removed: #has_heading_3: FAIL
    • ancestor with headingoffset removed: #has_heading_1: FAIL
    • ancestor with headingoffset removed: #has_heading_1_2: FAIL
    • h1.headingOffset = 1: #has_heading_2: FAIL
    • h1.headingOffset = 1: #has_heading_1_2: FAIL
    • h1.headingOffset = 0: #has_heading_1: FAIL
    • h1.headingOffset = 0: #has_heading_1_2: FAIL
    • ancestor[headingoffset=2] again: #has_heading_3: FAIL
    • h1.headingReset = true: #has_heading_1: FAIL
    • h1.headingReset = true: #has_heading_1_2: FAIL
    • h1.headingReset = false: #has_heading_3: FAIL
  • /css/selectors/invalidation/heading-pseudo-class-in-has-with-slot-reassignment.html [wpt.fyi]
    • Initial (h1 slotted into slot_a): #has_heading_1: FAIL
    • h1.slot = 'b': #has_heading_1: FAIL
    • h1.slot = 'nonexistent': #has_heading_1: FAIL
    • h1.slot = 'a': #has_heading_1: FAIL
    • slotA.name = 'c': #has_heading_1: FAIL
    • slotB.name = 'a': #has_heading_1: FAIL
    • Reset slot names: #has_heading_1: FAIL
    • slotA.remove(): #has_heading_1: FAIL
    • Re-insert slot_a: #has_heading_1: FAIL
    • ancestor[headingoffset=2]: #has_heading_3: FAIL
    • h1.slot = 'b' with ancestor[headingoffset=2]: #has_heading_3: FAIL
    • ancestor[headingoffset=4]: #has_heading_5: FAIL
    • ancestor with headingoffset removed: #has_heading_1: FAIL
  • /css/selectors/invalidation/heading-pseudo-class-in-has.html [wpt.fyi]
    • Append h1 to #ancestor: #has_heading_1: FAIL
    • Append h1 to #ancestor: #has_heading_1_2: FAIL
    • Append h2 to #ancestor: #has_heading_1: FAIL
    • Append h2 to #ancestor: #has_heading_2: FAIL
    • Append h2 to #ancestor: #has_heading_1_2: FAIL
    • Append h3 to #ancestor: #has_heading_1: FAIL
    • Append h3 to #ancestor: #has_heading_2: FAIL
    • Append h3 to #ancestor: #has_heading_3: FAIL
    • Append h3 to #ancestor: #has_heading_1_2: FAIL
    • Remove h1 from #ancestor: #has_heading_2: FAIL
    • Remove h1 from #ancestor: #has_heading_3: FAIL
    • Remove h1 from #ancestor: #has_heading_1_2: FAIL
    • Remove h2 from #ancestor: #has_heading_3: FAIL
    • Insert h1 adjacent to #sibling: #has_adjacent_heading_1: FAIL
    • Insert h1 adjacent to #sibling: #adjacent_heading_1: FAIL
    • Replace div with h1 in #ancestor: #has_heading_1: FAIL
    • Replace div with h1 in #ancestor: #has_heading_1_2: 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
Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c297586f3e11 https://hg.mozilla.org/integration/autoland/rev/7faea61300a2 [wpt PR 64115] - Add a WPT for user-action pseudo-classes when an ancestor changes, a=testonly
Status: NEW → RESOLVED
Closed: 18 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.