Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e017b07ddf72c20929164b17e067e37ba610338d
https://github.com/WebKit/WebKit/commit/e017b07ddf72c20929164b17e067e37ba610338d
Author: Jason Leo <[email protected]>
Date: 2026-03-18 (Wed, 18 Mar 2026)
Changed paths:
M Source/WebCore/SaferCPPExpectations/UncountedLocalVarsCheckerExpectations
M Source/WebCore/style/ElementRuleCollector.cpp
Log Message:
-----------
[SaferCPP] Replace raw pointers and leaking references with smart pointers in
style/ElementRuleCollector.cpp
https://bugs.webkit.org/show_bug.cgi?id=309932
Reviewed by Ryosuke Niwa.
Replace uncounted local variables with RefPtr/Ref smart pointers throughout
ElementRuleCollector.cpp to satisfy the SaferCPP UncountedLocalVarsChecker.
Also replace the leakRef() pattern in leftToRightDeclaration() and
rightToLeftDeclaration() with NeverDestroyed<Ref<MutableStyleProperties>>,
eliminating the need for GCC dangling-reference warning suppression.
* Source/WebCore/SaferCPPExpectations/UncountedLocalVarsCheckerExpectations:
* Source/WebCore/style/ElementRuleCollector.cpp:
(WebCore::Style::leftToRightDeclaration):
(WebCore::Style::rightToLeftDeclaration):
(WebCore::Style::ElementRuleCollector::collectMatchingRules):
(WebCore::Style::ElementRuleCollector::matchUserAgentPartRules):
(WebCore::Style::ElementRuleCollector::matchHostPseudoClassRules):
(WebCore::Style::ElementRuleCollector::matchSlottedPseudoElementRules):
(WebCore::Style::ElementRuleCollector::matchPartPseudoElementRules):
(WebCore::Style::ElementRuleCollector::matchPartPseudoElementRulesForScope):
(WebCore::Style::ElementRuleCollector::matchSlottedPseudoElementRulesInUserAgentShadowTree):
(WebCore::Style::ElementRuleCollector::collectMatchingUserAgentPartRules):
(WebCore::Style::ElementRuleCollector::matchUARules):
(WebCore::Style::classListForNamedViewTransitionPseudoElement):
(WebCore::Style::ElementRuleCollector::collectMatchingRulesForListSlow):
(WebCore::Style::ElementRuleCollector::scopeRulesMatch):
(WebCore::Style::ElementRuleCollector::matchAllRules):
(WebCore::Style::ElementRuleCollector::addElementInlineStyleProperties):
Canonical link: https://commits.webkit.org/309460@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications