Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 84d3b8d69740107a059f8c18ea28e2cbc6d63bcb
      
https://github.com/WebKit/WebKit/commit/84d3b8d69740107a059f8c18ea28e2cbc6d63bcb
  Author: Antti Koivisto <[email protected]>
  Date:   2026-01-30 (Fri, 30 Jan 2026)

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

  Log Message:
  -----------
  Add RuleSet bucket for universal pseudo-elements
https://bugs.webkit.org/show_bug.cgi?id=306332
rdar://169001503

Reviewed by Alan Baradlay.

UA sheet has things like ::marker and ::backdrop that get processed like 
regular selectors. We can shortcut them.

(relanding)

* Source/WebCore/style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::collectMatchingRules):

If we are in a normal selector matching for a HTML element just mark that we 
saw these pseudo-elements.
If they are actually requested then process the rules normally.

(WebCore::Style::ElementRuleCollector::matchHostPseudoClassRules):
* Source/WebCore/style/ElementRuleCollector.h:
(WebCore::Style::ElementRuleCollector::collectMatchingRulesForList):
* Source/WebCore/style/RuleSet.cpp:
(WebCore::Style::RuleSet::addRule):

Add a bucket and also an EnumSet to remember what sort of pseudo-elements we 
saw.

(WebCore::Style::RuleSet::traverseRuleDatas):
(WebCore::Style::RuleSet::shrinkToFit):
* Source/WebCore/style/RuleSet.h:
(WebCore::Style::RuleSet::linkPseudoClassRules const):
(WebCore::Style::RuleSet::focusPseudoClassRules const):
(WebCore::Style::RuleSet::focusVisiblePseudoClassRules const):
(WebCore::Style::RuleSet::rootElementRules const):
(WebCore::Style::RuleSet::universalRules const):
(WebCore::Style::RuleSet::universalPseudoElementRules const):
(WebCore::Style::RuleSet::universalHTMLPseudoElementTypes const):
(WebCore::Style::RuleSet::universalPseudoElementTypes const):

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



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

Reply via email to