Commit f2bf588
committed
Fix invalidation for class names within :nth-child() selector lists
https://bugs.webkit.org/show_bug.cgi?id=250551
rdar://104241960
Reviewed by Darin Adler.
There is an optimization in ClassChangeInvalidation that assumes only adding a class makes new elements match.
However, it is not true in the case of :nth-child(n of .class), removing the class name can make new elements match too.
Special case MatchElement::AnySibling (used by :nth-child() invalidation) to reflect this.
Tests:
- imported/w3c/web-platform-tests/css/selectors/invalidation/nth-child-of-class.html
- imported/w3c/web-platform-tests/css/selectors/invalidation/nth-child-of-sibling.html
* LayoutTests/TestExpectations:
* Source/WebCore/style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::computeInvalidation):
Canonical link: https://commits.webkit.org/258917@main1 parent 78892eb commit f2bf588
File tree
2 files changed
+12
-8
lines changed- LayoutTests
- Source/WebCore/style
2 files changed
+12
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1636 | 1636 | | |
1637 | 1637 | | |
1638 | 1638 | | |
1639 | | - | |
1640 | 1639 | | |
1641 | 1640 | | |
1642 | | - | |
1643 | 1641 | | |
1644 | 1642 | | |
1645 | 1643 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
127 | 133 | | |
128 | | - | |
| 134 | + | |
129 | 135 | | |
130 | | - | |
| 136 | + | |
131 | 137 | | |
132 | 138 | | |
133 | 139 | | |
| |||
0 commit comments