Closed Bug 1810657 Opened 2 years ago Closed 2 years ago

:nth-child(An+B of selector list) is not invalidated if a sibling or ancestor changes

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: zrhoffman, Assigned: zrhoffman)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

Testcases are in wpt-sync bug 1809470:

  • To test invalidation for selector .ancestor :nth-child(even of .c), toggle class .ancestor on an ancestor element.
  • To test invalidation for selector .sibling + :nth-child(odd of .c), toggle class .sibling on the left sibling of an element matching :nth-child(odd of .c).

and in wpt-sync bug 1809659:

To test invalidation for selector :nth-child(odd of .a .b), toggle class a on an ancestor of an element matching nth-child(odd of .b).

This patch fixes a bug introduced by bug 1808228/D166266, where, if an
element does not initially match :nth-child(An+B of selector list) or
:nth-last-child(An+B of selector list), changing a sibling or ancestor
will not invalidate that element.

Assignee: nobody → zach
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a8b6fbfa9e6c Apply slow selector flags before matching r=emilio
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: