Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c9187f7abc1eadd352b2107727aa043ea4134b7e
      
https://github.com/WebKit/WebKit/commit/c9187f7abc1eadd352b2107727aa043ea4134b7e
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-07-04 (Sat, 04 Jul 2026)

  Changed paths:
    M Source/WebCore/inspector/InspectorStyleSheet.cpp

  Log Message:
  -----------
  [Web Inspector] selectorsForCSSStyleRule computes the split-rule list twice
https://bugs.webkit.org/show_bug.cgi?id=318541
rdar://181312162

Reviewed by Devin Rousso.

InspectorStyleSheet::selectorsForCSSStyleRule() called
cssStyleRulesSplitFromSameRule() into a local `rules` vector that was
never read, then called it a second time in the range-for header,
recomputing the identical result. Each call runs ensureFlatRules() plus
a find() and two scans over m_flatRules, so the split was done twice for
no benefit. The loop variable also shadowed the `rule` parameter.

Call cssStyleRulesSplitFromSameRule() once directly in the range-for
header so its result is bound to the loop rather than kept alive for the
whole function,. No change in behavior.

* Source/WebCore/inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::selectorsForCSSStyleRule):

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



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

Reply via email to