[webkit-changes] [WebKit/WebKit] f2bf58: Fix invalidation for class names within :nth-child...
Tim Nguyen
noreply at github.com
Sat Jan 14 10:29:04 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f2bf588885181a85c763ddb6cb5e7e7f758dbe46
https://github.com/WebKit/WebKit/commit/f2bf588885181a85c763ddb6cb5e7e7f758dbe46
Author: Tim Nguyen <ntim at apple.com>
Date: 2023-01-14 (Sat, 14 Jan 2023)
Changed paths:
M LayoutTests/TestExpectations
M Source/WebCore/style/ClassChangeInvalidation.cpp
Log Message:
-----------
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@main
More information about the webkit-changes
mailing list