[webkit-changes] [WebKit/WebKit] 72e9a6: Cache complex CSS variable values
Antti Koivisto
noreply at github.com
Tue Nov 7 22:50:45 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 72e9a6afd35e3cbfbf80e2b3584292fe668e0b3c
https://github.com/WebKit/WebKit/commit/72e9a6afd35e3cbfbf80e2b3584292fe668e0b3c
Author: Antti Koivisto <antti at apple.com>
Date: 2023-11-07 (Tue, 07 Nov 2023)
Changed paths:
M Source/WebCore/Sources.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
A Source/WebCore/css/CSSPendingSubstitutionValue.cpp
M Source/WebCore/css/CSSPendingSubstitutionValue.h
M Source/WebCore/css/CSSVariableReferenceValue.cpp
M Source/WebCore/css/CSSVariableReferenceValue.h
M Source/WebCore/style/StyleBuilder.cpp
Log Message:
-----------
Cache complex CSS variable values
https://bugs.webkit.org/show_bug.cgi?id=264250
rdar://117996144
Reviewed by Alan Baradlay.
Cache the final CSSValue for variable references in all cases.
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/css/CSSPendingSubstitutionValue.cpp: Added.
(WebCore::CSSPendingSubstitutionValue::resolveValue const):
For shortcut references cache each individual longhand.
* Source/WebCore/css/CSSPendingSubstitutionValue.h:
* Source/WebCore/css/CSSVariableReferenceValue.cpp:
(WebCore::CSSVariableReferenceValue::cacheSimpleReference):
(WebCore::CSSVariableReferenceValue::resolveSingleValue const):
(WebCore::CSSVariableReferenceValue::resolveAndCacheValue const): Deleted.
(WebCore::CSSVariableReferenceValue::resolveSubstitutionValue const): Deleted.
* Source/WebCore/css/CSSVariableReferenceValue.h:
(WebCore::CSSVariableReferenceValue::resolveAndCacheValue const):
Cache also in non-simple reference case. In these cases we still resolve the tokens and
use their equaivalence to test the validity of the cached value.
* Source/WebCore/style/StyleBuilder.cpp:
(WebCore::Style::Builder::resolveVariableReferences):
Canonical link: https://commits.webkit.org/270376@main
More information about the webkit-changes
mailing list