[webkit-changes] [WebKit/WebKit] c8893f: [CSS] Improve performance of visitAllSimpleSelecto...

Matthieu Dubet noreply at github.com
Mon Aug 7 12:31:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c8893f6f23dfc9d9cdb32a715457c77a70d9102f
      https://github.com/WebKit/WebKit/commit/c8893f6f23dfc9d9cdb32a715457c77a70d9102f
  Author: Matthieu Dubet <m_dubet at apple.com>
  Date:   2023-08-07 (Mon, 07 Aug 2023)

  Changed paths:
    M Source/WebCore/css/CSSSelector.cpp
    M Source/WebCore/css/CSSSelector.h

  Log Message:
  -----------
  [CSS] Improve performance of visitAllSimpleSelectors()
https://bugs.webkit.org/show_bug.cgi?id=259828
rdar://113397883

Reviewed by Brent Fulgham.

This patch makes the visitAllSimpleSelectors() function more optimized by:
 - being iterative instead of recursive
 - allowing the functor argument to early return.

It improves performance on really long selectors.

* Source/WebCore/css/CSSSelector.cpp:
(WebCore::CSSSelector::visitAllSimpleSelectors const):
(WebCore::CSSSelector::resolveNestingParentSelectors):
(WebCore::CSSSelector::replaceNestingParentByPseudoClassScope):
(WebCore::CSSSelector::hasExplicitNestingParent const):
* Source/WebCore/css/CSSSelector.h:

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




More information about the webkit-changes mailing list