Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 38b6ce2aafaa50e1f214cc20c89cfab7c709406c
https://github.com/WebKit/WebKit/commit/38b6ce2aafaa50e1f214cc20c89cfab7c709406c
Author: Nipun Shukla <[email protected]>
Date: 2026-04-27 (Mon, 27 Apr 2026)
Changed paths:
A PerformanceTests/CSS/WhereIsClassRuleIndexing.html
M Source/WebCore/style/RuleSet.cpp
M Source/WebCore/style/RuleSet.h
Log Message:
-----------
Expand :is()/:where() optimization beyond tag selectors
https://bugs.webkit.org/show_bug.cgi?id=313030
rdar://175369601
Reviewed by Antti Koivisto.
This change is a follow-up to 311212@main, which extracted tag selectors
from single-argument :is()/:where(). We wrap the switch in RuleSet::addRule
in a recursive lambda so the inner walk applies the full logic: :is(.foo)
now goes to the class bucket, :is(#id) to the id bucket, :is([attr]) to
the attribute bucket, and :where(:focus) to the focus pseudo-class bucket.
The included performance test progresses from ~70 runs/s to ~1050 run/s
with this change.
* PerformanceTests/CSS/WhereIsClassRuleIndexing.html: Added.
* Source/WebCore/style/RuleSet.cpp:
(WebCore::Style::RuleSet::addRule):
(WebCore::Style::RuleSet::addRuleToBucket):
* Source/WebCore/style/RuleSet.h:
Canonical link: https://commits.webkit.org/312134@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications