[webkit-changes] [WebKit/WebKit] b63783: [@property] Cache tokens in CSSCustomPropertyValue

Antti Koivisto noreply at github.com
Fri Feb 3 05:56:45 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b63783f818783e6859c645186f4c98a09f4bab2d
      https://github.com/WebKit/WebKit/commit/b63783f818783e6859c645186f4c98a09f4bab2d
  Author: Antti Koivisto <antti at apple.com>
  Date:   2023-02-03 (Fri, 03 Feb 2023)

  Changed paths:
    M Source/WebCore/animation/CSSPropertyAnimation.cpp
    M Source/WebCore/css/CSSCustomPropertyValue.cpp
    M Source/WebCore/css/CSSCustomPropertyValue.h

  Log Message:
  -----------
  [@property] Cache tokens in CSSCustomPropertyValue
https://bugs.webkit.org/show_bug.cgi?id=251672
rdar://104997649

Reviewed by Antoine Quint.

We currently generate tokens on every access by tokenizing a (cached) string.

* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::blendedCSSCustomPropertyValue):
* Source/WebCore/css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::customCSSText const):
(WebCore::CSSCustomPropertyValue::tokens const):

Add a token cache for registered custom properties.
Also avoid copying by returning a reference.

* Source/WebCore/css/CSSCustomPropertyValue.h:

Also remove an unneeded copy constructor.

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




More information about the webkit-changes mailing list