Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5719b6566bbf264bd8ad79b2cdc9b21c23a8e582
      
https://github.com/WebKit/WebKit/commit/5719b6566bbf264bd8ad79b2cdc9b21c23a8e582
  Author: Antti Koivisto <[email protected]>
  Date:   2026-05-11 (Mon, 11 May 2026)

  Changed paths:
    M LayoutTests/fast/selectors/has-invalidation-traversal-size-expected.txt
    M LayoutTests/fast/selectors/has-invalidation-traversal-size.html
    M LayoutTests/platform/ios/TestExpectations
    M Source/WebCore/style/RuleFeature.cpp
    M Source/WebCore/style/RuleFeature.h
    M Source/WebCore/style/StyleScopeRuleSets.cpp

  Log Message:
  -----------
  [:has() perf] Use scope selectors to limit traversal in 
class/attribute/pseudo-class invalidation
https://bugs.webkit.org/show_bug.cgi?id=314541
rdar://176771971

Reviewed by Alan Baradlay.

So far these optimizations have been used for child change invalidation (tree 
shape
mutation) only.

* LayoutTests/fast/selectors/has-invalidation-traversal-size-expected.txt:
* LayoutTests/fast/selectors/has-invalidation-traversal-size.html:
* Source/WebCore/style/RuleFeature.cpp:
(WebCore::Style::RuleFeature::RuleFeature):
(WebCore::Style::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
(WebCore::Style::RuleFeatureSet::collectFeatures):

Collect scope selectors for class/id/attribute/pseudo-class features, not just 
ones used for child change invalidation.

(WebCore::Style::RuleFeatureWithInvalidationSelector::RuleFeatureWithInvalidationSelector):
 Deleted.
* Source/WebCore/style/RuleFeature.h:
(WebCore::Style::RuleFeature::RuleFeature):

Size of RuleFeature grows by two pointers. This shouldn't be a problem, we have 
started deduplicating features
since and we have way fewer of them than we used to have.

(WebCore::Style::RuleFeatureWithInvalidationSelector::RuleFeatureWithInvalidationSelector):
 Deleted.

Merge RuleFeatureWithInvalidationSelector into RuleFeature so all feature kinds 
can
carry an optional scopeSelector. This also simplified code and we can remove 
templating.

* Source/WebCore/style/StyleScopeRuleSets.cpp:
(WebCore::Style::ensureInvalidationRuleSets):

Canonical link: https://commits.webkit.org/313009@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to