Closed Bug 1836563 Opened 3 years ago Closed 3 years ago

WPT css/selectors/invalidation/nth-child-of-has.html and nth-last-child-of-has.html fail in Firefox

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1792501

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug)

Details

Right now, we fail this WPT (part of the interop-2023 test set):
https://wpt.fyi/results/css/selectors/invalidation/nth-last-child-of-has.html
Direct link to test:
http://wpt.live/css/selectors/invalidation/nth-last-child-of-has.html

Using a fresh Firefox profile, I can trigger 3 distinct renderings:
(1) by default, we render all of the text black.
(2) if I toggle layout.css.has-selector.enabled to true and reload, we render the 3rd and 5th line as green.
(3) If I then open devtools and hover anything, then we instead render the 2nd and 4th line as green. And that seems to be what the test expects.

(My regular browsing profile often goes directly to the "good" rendering -- possibly due to a race condition?

So there seems to be a bug here where we get the initial state wrong, but we correct it eventually if you force some sort of restyle flush.

Possibly some work on bug 418039 or another preexisting associated bug will fix this, but I figured I'd spin off this dedicated bug, just in case this is a special case that needs additional work.

(Note, this test was added by Zach in bug 1818135 ; adding dependency on that bug.)

Duplicate of this bug: 1818155

Note that css/selectors/invalidation/nth-child-of-has.html also fails (with layout.css.has-selector.enabled enabled).

Blocks: 1809754

Thanks! Indeed, that one fails in roughly the same way roughly as described in comment 0 (with 3 distinct renderings), though now with the 4th and 6th lines initially green, changing to 5th and 7th after I interact with devtools. And as noted there, it automatically swaps to the good rendering in my regular browsing profile, due to a race condition or something.

(Sorry for overlooking your bug 1818155 that was already tracking these; and thanks duping that over to clean up after me. :))

Summary: WPT css/selectors/invalidation/nth-last-child-of-has.html fails in Firefox → WPT css/selectors/invalidation/nth-child-of-has.html and nth-last-child-of-has.html fail in Firefox

Fixed in bug 1792501!

Status: NEW → RESOLVED
Closed: 3 years ago
Duplicate of bug: 1792501
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.