[:has() pseudo-class] Collect invalidation selectors for child invalidation
commitda68ce67f69692a1a6b96c04f149b8a526ec6218
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jan 2022 07:31:50 +0000 (13 07:31 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jan 2022 07:31:50 +0000 (13 07:31 +0000)
tree97c429c110b828d27aed987661dc0077cc92b19c
parent526a8c0bb12673392ea14baed61abde379d2829a
[:has() pseudo-class] Collect invalidation selectors for child invalidation
https://bugs.webkit.org/show_bug.cgi?id=235103

Reviewed by Dean Jackson.

Collect selectors we can use to test if :has status actually changed before invalidating.

This patch doesn't yet use the the selector.

* style/ChildChangeInvalidation.cpp:
(WebCore::Style::ChildChangeInvalidation::invalidateForChangedElement):

Use the pseudo class invalidation keys for looking up :has selectors too
instead of having a custom mechanism for doing the same thing.

* style/PseudoClassChangeInvalidation.cpp:
(WebCore::Style::makePseudoClassInvalidationKeys):
* style/PseudoClassChangeInvalidation.h:
* style/RuleFeature.cpp:
(WebCore::Style::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):

Always return a selector for consistency.

(WebCore::Style::makePseudoClassInvalidationKey):
(WebCore::Style::RuleFeatureSet::collectFeatures):
(WebCore::Style::RuleFeatureSet::add):
(WebCore::Style::RuleFeatureSet::clear):
(WebCore::Style::RuleFeatureSet::shrinkToFit):
* style/RuleFeature.h:
* style/StyleScopeRuleSets.cpp:
(WebCore::Style::ScopeRuleSets::collectFeatures const):
(WebCore::Style::ScopeRuleSets::hasPseudoClassInvalidationRuleSets const):
(WebCore::Style::ScopeRuleSets::tagInvalidationRuleSets const): Deleted.

We don't need keep around tag rule sets anymore.

* style/StyleScopeRuleSets.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@287973 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/style/ChildChangeInvalidation.cpp
Source/WebCore/style/PseudoClassChangeInvalidation.cpp
Source/WebCore/style/PseudoClassChangeInvalidation.h
Source/WebCore/style/RuleFeature.cpp
Source/WebCore/style/RuleFeature.h
Source/WebCore/style/StyleScopeRuleSets.cpp
Source/WebCore/style/StyleScopeRuleSets.h