Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Unified Diff: third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp

Issue 2340893003: Support interpolation of animatable shorthand properties containing var() (Closed)
Patch Set: Update DCHECK Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
index cee2426bda3e5a155e78144841cff46de775a2b8..3e16a9ecf3240761382af71ff95884f1207f3358 100644
--- a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
@@ -153,10 +153,22 @@ bool CSSVariableResolver::resolveTokenRange(CSSParserTokenRange range,
return success;
}
-const CSSValue* CSSVariableResolver::resolveVariableReferences(const StyleResolverState& state, CSSPropertyID id, const CSSVariableReferenceValue& value)
+const CSSValue* CSSVariableResolver::resolveVariableReferences(const StyleResolverState& state, CSSPropertyID id, const CSSValue& value)
{
ASSERT(!isShorthandProperty(id));
+ if (value.isPendingSubstitutionValue())
+ return resolvePendingSubstitutions(state, id, toCSSPendingSubstitutionValue(value));
+
+ if (value.isVariableReferenceValue())
+ return resolveVariableReferences(state, id, toCSSVariableReferenceValue(value));
+
+ NOTREACHED();
+ return nullptr;
+}
+
+const CSSValue* CSSVariableResolver::resolveVariableReferences(const StyleResolverState& state, CSSPropertyID id, const CSSVariableReferenceValue& value)
+{
CSSVariableResolver resolver(state);
Vector<CSSParserToken> tokens;
if (!resolver.resolveTokenRange(value.variableDataValue()->tokens(), tokens))
@@ -167,10 +179,10 @@ const CSSValue* CSSVariableResolver::resolveVariableReferences(const StyleResolv
return result;
}
-const CSSValue* CSSVariableResolver::resolvePendingSubstitutions(StyleResolverState& state, CSSPropertyID id, const CSSPendingSubstitutionValue& pendingValue)
+const CSSValue* CSSVariableResolver::resolvePendingSubstitutions(const StyleResolverState& state, CSSPropertyID id, const CSSPendingSubstitutionValue& pendingValue)
{
// Longhands from shorthand references follow this path.
- HeapHashMap<CSSPropertyID, Member<const CSSValue>>& propertyCache = state.parsedPropertiesForPendingSubstitution(pendingValue);
+ HeapHashMap<CSSPropertyID, Member<const CSSValue>>& propertyCache = state.parsedPropertiesForPendingSubstitutionCache(pendingValue);
const CSSValue* value = propertyCache.get(id);
if (!value) {

Powered by Google App Engine
This is Rietveld 408576698