Branch: refs/heads/webkitglib/2.52
Home: https://github.com/WebKit/WebKit
Commit: 0e1fdcee0a05525d14f6123b9eac2896ac5e8e9e
https://github.com/WebKit/WebKit/commit/0e1fdcee0a05525d14f6123b9eac2896ac5e8e9e
Author: Antti Koivisto <[email protected]>
Date: 2026-02-27 (Fri, 27 Feb 2026)
Changed paths:
A LayoutTests/fast/selectors/empty-rule-invalidation-expected.html
A LayoutTests/fast/selectors/empty-rule-invalidation.html
M Source/WebCore/style/RuleFeature.cpp
Log Message:
-----------
Cherry-pick 307366@main (1961f4c243df).
https://bugs.webkit.org/show_bug.cgi?id=307593
REGRESSION(302297@main): Dark mode is broken in Wikipedia
https://bugs.webkit.org/show_bug.cgi?id=307593
rdar://169362651
Reviewed by Matthieu Dubet.
Wikipedia has an empty CSS rule
html.skin-theme-clientpref-night {
}
and then further non-empty rules with the same selector. We would pick the
first rule to our invalidation ruleset
and proceed to dedupe other rules to it. However ElementRuleCollector
ignores empty rules and no invalidation happens.
Test: fast/selectors/empty-rule-invalidation.html
* LayoutTests/fast/selectors/empty-rule-invalidation-expected.html: Added.
* LayoutTests/fast/selectors/empty-rule-invalidation.html: Added.
* Source/WebCore/style/RuleFeature.cpp:
(WebCore::Style::RuleFeatureSet::collectFeatures):
Don't collect features from empty rules. They can never affect style and
don't need invalidation.
Canonical link: https://commits.webkit.org/307366@main
Canonical link: https://commits.webkit.org/305877.111@webkitglib/2.52
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications