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

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

Issue 2089593002: Add expansion of shorthands with custom properties to longhands using a pending substition value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renames, signature update and master merge Created 4 years, 6 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/StyleBuilderCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
index b33285e6b06094c9b5b12135c706cf12eef7ddf0..4342ecb04a073b6a6fc2bd80d3b4658271e60408 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -51,6 +51,7 @@
#include "core/css/CSSHelper.h"
#include "core/css/CSSImageSetValue.h"
#include "core/css/CSSPathValue.h"
+#include "core/css/CSSPendingSubstitutionValue.h"
#include "core/css/CSSPrimitiveValueMappings.h"
#include "core/css/CSSPropertyMetadata.h"
#include "core/css/CSSURIValue.h"
@@ -112,8 +113,14 @@ static inline bool isValidVisitedLinkProperty(CSSPropertyID id)
void StyleBuilder::applyProperty(CSSPropertyID id, StyleResolverState& state, const CSSValue& value)
{
- if (RuntimeEnabledFeatures::cssVariablesEnabled() && id != CSSPropertyVariable && value.isVariableReferenceValue()) {
- CSSVariableResolver::resolveAndApplyVariableReferences(state, id, toCSSVariableReferenceValue(value));
+ if (RuntimeEnabledFeatures::cssVariablesEnabled() && id != CSSPropertyVariable
+ && (value.isVariableReferenceValue() || value.isPendingSubstitutionValue())) {
+
+ const CSSValue* resolvedValue = value.isVariableReferenceValue() ?
+ CSSVariableResolver::resolveVariableReferences(state, id, toCSSVariableReferenceValue(value)) :
+ CSSVariableResolver::resolvePendingSubstitutions(state, id, toCSSPendingSubstitutionValue(value));
+ applyProperty(id, state, *resolvedValue);
+
if (!state.style()->hasVariableReferenceFromNonInheritedProperty() && !CSSPropertyMetadata::isInheritedProperty(id))
state.style()->setHasVariableReferenceFromNonInheritedProperty();
return;

Powered by Google App Engine
This is Rietveld 408576698