[webkit-changes] [WebKit/WebKit] 3ff376: [CSS] Don't construct CSSSelectorList when not needed

Matthieu Dubet noreply at github.com
Wed Nov 29 11:03:04 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3ff376ea3d2a1dfc297cbb114f416641bc475e0a
      https://github.com/WebKit/WebKit/commit/3ff376ea3d2a1dfc297cbb114f416641bc475e0a
  Author: Matthieu Dubet <m_dubet at apple.com>
  Date:   2023-11-29 (Wed, 29 Nov 2023)

  Changed paths:
    M Source/WebCore/css/parser/CSSParserImpl.cpp
    M Source/WebCore/css/parser/CSSSelectorParser.cpp
    M Source/WebCore/css/parser/CSSSelectorParser.h

  Log Message:
  -----------
  [CSS] Don't construct CSSSelectorList when not needed
https://bugs.webkit.org/show_bug.cgi?id=265518
rdar://118931010

Reviewed by Antti Koivisto.

CSSSelectorList is an optimized data structure,
we should only construct it when it's actually needed (so not when empty or error)
and keep the editable CSSParserSelector data structure until then.

* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeStyleRule):
* Source/WebCore/css/parser/CSSSelectorParser.cpp:
(WebCore::parseCSSParserSelectorList):
(WebCore::parseCSSSelectorList):
(WebCore::CSSSelectorParser::consumeSelectorList):
(WebCore::CSSSelectorParser::consumeComplexSelectorList):
(WebCore::CSSSelectorParser::consumeRelativeSelectorList):
(WebCore::CSSSelectorParser::consumeNestedSelectorList):
(WebCore::CSSSelectorParser::consumeForgivingSelectorList):
(WebCore::CSSSelectorParser::consumeComplexForgivingSelectorList):
(WebCore::CSSSelectorParser::consumeNestedComplexForgivingSelectorList):
(WebCore::CSSSelectorParser::consumeCompoundSelectorList):
(WebCore::CSSSelectorParser::consumePseudo):
* Source/WebCore/css/parser/CSSSelectorParser.h:

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




More information about the webkit-changes mailing list