Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ad0609b55f82429f8f70a528f233438d5a59e4e8
https://github.com/WebKit/WebKit/commit/ad0609b55f82429f8f70a528f233438d5a59e4e8
Author: Antti Koivisto <[email protected]>
Date: 2026-05-19 (Tue, 19 May 2026)
Changed paths:
M Source/WebCore/css/CSSSelector.cpp
M Source/WebCore/css/CSSSelector.h
M Source/WebCore/css/CSSSelectorList.cpp
M Source/WebCore/css/CSSSelectorList.h
M Source/WebCore/css/parser/CSSParser.cpp
M Source/WebCore/css/parser/CSSSelectorParser.cpp
M Source/WebCore/cssjit/SelectorCompiler.cpp
M Source/WebCore/dom/SelectorQuery.cpp
M Source/WebCore/style/ChildChangeInvalidation.cpp
M Source/WebCore/style/HasSelectorFilter.cpp
M Source/WebCore/style/RuleFeature.cpp
M Source/WebCore/style/RuleSet.cpp
Log Message:
-----------
Use logical selector order in compound traversal function names
https://bugs.webkit.org/show_bug.cgi?id=315094
rdar://177431445
Reviewed by Alan Baradlay.
Storage lays out compounds right-to-left (subject compound first) but
simples within a compound left-to-right. The old "first / last in
compound" names followed the storage walk and read backwards in source
order. Rename to source-frame names:
firstInCompound -> rightmostInCompound
lastInCompound -> leftmostInCompound
precedingInCompound -> followingInCompound (advances rightward in source)
Drop the public isFirstInComplexSelector / isLastInComplexSelector
accessors; their callers all want "no preceding simple", which is just
!precedingInComplexSelector(). The bit fields stay as internal storage
for that primitive.
Convert iterate-and-break-at-compound-boundary loops to single
followingInCompound() for-loops where it fits.
Update the storage layout comment in CSSSelector.h with a concrete
example.
* Source/WebCore/css/CSSSelector.cpp:
(WebCore::CSSSelector::rightmostInCompound const):
(WebCore::CSSSelector::leftmostInCompound const):
(WebCore::CSSSelector::followingInCompound const):
(WebCore::complexSelectorMatchesElementBackedPseudoElement):
(WebCore::CSSSelector::firstInCompound const): Deleted.
(WebCore::CSSSelector::lastInCompound const): Deleted.
(WebCore::CSSSelector::precedingInCompound const): Deleted.
* Source/WebCore/css/CSSSelector.h:
(WebCore::CSSSelector::isFirstInComplexSelector const): Deleted.
(WebCore::CSSSelector::isLastInComplexSelector const): Deleted.
* Source/WebCore/css/CSSSelectorList.cpp:
(WebCore::CSSSelectorList::CSSSelectorList):
(WebCore::CSSSelectorList::size const):
* Source/WebCore/css/CSSSelectorList.h:
(WebCore::CSSSelectorList::const_iterator::operator++):
* Source/WebCore/css/parser/CSSParser.cpp:
(WebCore::validateUserAgentSheetSelector):
* Source/WebCore/css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::resolveNestingParent):
(WebCore::collectHasCompoundContext):
(WebCore::CSSSelectorParser::makeHasScopeSelector):
* Source/WebCore/cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::constructFragmentsInternal):
* Source/WebCore/dom/SelectorQuery.cpp:
(WebCore::isSingleTagNameSelector):
(WebCore::isSingleClassNameSelector):
(WebCore::isSingleAttributeExactSelector):
(WebCore::SelectorDataList::SelectorDataList):
(WebCore::selectorForIdLookup):
* Source/WebCore/style/ChildChangeInvalidation.cpp:
(WebCore::Style::rightmostCompoundContainsEmpty):
* Source/WebCore/style/HasSelectorFilter.cpp:
(WebCore::Style::HasSelectorFilter::makeKey):
* Source/WebCore/style/RuleFeature.cpp:
(WebCore::Style::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
(WebCore::Style::makePseudoClassInvalidationKey):
(WebCore::Style::RuleFeatureSet::collectPseudoElementFeatures):
* Source/WebCore/style/RuleSet.cpp:
(WebCore::Style::RuleSet::addRuleToBucket):
Canonical link: https://commits.webkit.org/313496@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications