Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4a6e51b91b8ef0d6a31cd1a6342a5941425209a5
https://github.com/WebKit/WebKit/commit/4a6e51b91b8ef0d6a31cd1a6342a5941425209a5
Author: Antti Koivisto <[email protected]>
Date: 2025-09-21 (Sun, 21 Sep 2025)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/nesting-basic-expected.html
M
LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/nesting-basic.html
M Source/WebCore/css/CSSSelector.cpp
M Source/WebCore/css/CSSSelector.h
M Source/WebCore/css/parser/CSSSelectorParser.cpp
M Source/WebCore/css/parser/MutableCSSSelector.cpp
M Source/WebCore/style/RuleData.cpp
Log Message:
-----------
Inline nesting selector when possible
https://bugs.webkit.org/show_bug.cgi?id=299168
rdar://160927950
Reviewed by Matthieu Dubet.
Currently we always wrap the parent selector list to :is(). This is unneeded in
many common cases. For example
.foo { & .bar {...} }
currently resolves to
:is(.foo) .bar {...}
with this patch it resolves to
.foo .bar {...}
Removing unnecessary :is() improves selector performance.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/nesting-basic-expected.html:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/nesting-basic.html:
Add a test for the pseudo-element case where we can't inline.
* Source/WebCore/css/CSSSelector.cpp:
(WebCore::CSSSelector::firstInCompound const):
(WebCore::CSSSelector::CSSSelector):
Add a copy-constructor that resets the selector list bits to the initial state
for MutableCSSSelector use.
(WebCore::complexSelectorCanMatchPseudoElement):
Move the function here from RuleData so we can use it from resolveNestingParent.
* Source/WebCore/css/CSSSelector.h:
* Source/WebCore/css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::resolveNestingParent):
Inline the resolved nesting selectors when possible.
* Source/WebCore/css/parser/MutableCSSSelector.cpp:
(WebCore::MutableCSSSelector::MutableCSSSelector):
* Source/WebCore/style/RuleData.cpp:
(WebCore::Style::RuleData::RuleData):
(WebCore::Style::selectorCanMatchPseudoElement): Deleted.
Canonical link: https://commits.webkit.org/300297@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes