[webkit-changes] [WebKit/WebKit] 5c5316: Cache CSSParserContext in document

Antti Koivisto noreply at github.com
Thu Feb 15 03:03:59 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5c53168684f12f4d5f715dd9440523fe3c75c4e3
      https://github.com/WebKit/WebKit/commit/5c53168684f12f4d5f715dd9440523fe3c75c4e3
  Author: Antti Koivisto <antti at apple.com>
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
    M Source/WebCore/css/parser/CSSParserContext.cpp
    M Source/WebCore/css/parser/CSSParserContext.h
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/style/StyleScope.cpp

  Log Message:
  -----------
  Cache CSSParserContext in document
https://bugs.webkit.org/show_bug.cgi?id=269436
rdar://122993740

Reviewed by Ryosuke Niwa.

Repeatedly reconstructing it can be expensive as it accesses many settings fields.

* Source/WebCore/css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* Source/WebCore/css/parser/CSSParserContext.h:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::setCompatibilityMode):
(WebCore::Document::updateBaseURL):
(WebCore::Document::cssParserContext const):
(WebCore::Document::invalidateCachedCSSParserContext):
* Source/WebCore/dom/Document.h:
* Source/WebCore/style/StyleScope.cpp:
(WebCore::Style::Scope::didChangeStyleSheetEnvironment):

Invalidate when needed.

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




More information about the webkit-changes mailing list