Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4f1593f053b31d0678805160252d194aeb7af57f
      
https://github.com/WebKit/WebKit/commit/4f1593f053b31d0678805160252d194aeb7af57f
  Author: Ahmad Saleem <[email protected]>
  Date:   2025-11-28 (Fri, 28 Nov 2025)

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

  Log Message:
  -----------
  Add focusVisible optimization to rule matching
https://bugs.webkit.org/show_bug.cgi?id=303221
rdar://165514653

Reviewed by Antti Koivisto.

This patch optimizes selector matching by tracking focusVisible state in
the rule collection process. This avoids unnecessary style recalculations
when focus-visible pseudo-class selectors are present.

Added focusVisible member to RuleSet to track whether any rules contain
:focus-visible selectors, and propagated this information through
ElementRuleCollector to enable selective invalidation.

* Source/WebCore/style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::collectMatchingRules):
* Source/WebCore/style/RuleSet.cpp:
(WebCore::Style::RuleSet::addRule):
(WebCore::Style::RuleSet::traverseRuleDatas):
(WebCore::Style::RuleSet::shrinkToFit):
* Source/WebCore/style/RuleSet.h:
(WebCore::Style::RuleSet::focusVisiblePseudoClassRules const):

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



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

Reply via email to