Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a24a25b87e86c3c62d9e4ca0cc1e8f4d3939c8eb
      
https://github.com/WebKit/WebKit/commit/a24a25b87e86c3c62d9e4ca0cc1e8f4d3939c8eb
  Author: Antti Koivisto <[email protected]>
  Date:   2024-02-27 (Tue, 27 Feb 2024)

  Changed paths:
    M Source/WebCore/css/CSSVariableData.cpp
    M Source/WebCore/css/parser/CSSParserToken.cpp
    M Source/WebCore/css/parser/CSSParserToken.h

  Log Message:
  -----------
  Back identifier tokens in custom properties with string literals
https://bugs.webkit.org/show_bug.cgi?id=269986
rdar://123506269

Reviewed by Cameron McCormack.

Tokens don't own the underlying string so we construct a separate backing 
string for tokens that need it.
Identifier tokens can in mosts cases be backed by their string literals, saving 
memory and work.

* Source/WebCore/css/CSSVariableData.cpp:
(WebCore::CSSVariableData::updateBackingStringsInTokens):
(WebCore::CSSVariableData::CSSVariableData):

Point the string backing to a literal if possible.

* Source/WebCore/css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::id const):
(WebCore::CSSParserToken::functionId const):
(WebCore::CSSParserToken::identOrFunctionId const):
(WebCore::CSSParserToken::tryUseStringLiteralBacking):

Known identifier tokens can use literal backing if cases match (usually all 
lowercase).

(WebCore::CSSParserToken::copyWithUpdatedString const): Deleted.

Remove unsed function.

* Source/WebCore/css/parser/CSSParserToken.h:
(WebCore::CSSParserToken::isBackedByStringLiteral const):
(WebCore::CSSParserToken::initValueFromStringView):

* Source/WebCore/css/parser/CSSParserToken.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to