Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ce251e4c49e1a920d5079015b2cd287bacc29590
      
https://github.com/WebKit/WebKit/commit/ce251e4c49e1a920d5079015b2cd287bacc29590
  Author: Matthieu Dubet <[email protected]>
  Date:   2025-01-31 (Fri, 31 Jan 2025)

  Changed paths:
    M Source/WebCore/style/ElementRuleCollector.cpp
    M Source/WebCore/style/ElementRuleCollector.h
    M Source/WebCore/style/StyleSharingResolver.cpp

  Log Message:
  -----------
  [CSS] Early return from matching when doing invalidation
https://bugs.webkit.org/show_bug.cgi?id=286721
rdar://138419832

Reviewed by Antti Koivisto.

For invalidation, we generally don't want to collect rules
but just to know if any rule matches. We can optimize for
this use case by early returning on first match.

 * Source/WebCore/style/ElementRuleCollector.cpp:
 (WebCore::Style::ElementRuleCollector::isFirstMatchModeAndHasMatchedAnyRules 
const):
 (WebCore::Style::ElementRuleCollector::collectMatchingRules):
 (WebCore::Style::ElementRuleCollector::transferMatchedRules):
 (WebCore::Style::ElementRuleCollector::collectMatchingRulesForList):
 (WebCore::Style::ElementRuleCollector::matchAllRules):
 (WebCore::Style::ElementRuleCollector::hasAnyMatchingRules): Deleted.

 Renamed to matchesAnyRules().

 * Source/WebCore/style/ElementRuleCollector.h:
 * Source/WebCore/style/StyleSharingResolver.cpp:
 (WebCore::Style::SharingResolver::styleSharingCandidateMatchesRuleSet const):

Canonical link: https://commits.webkit.org/289611@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

Reply via email to