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

Unified Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ToTed Created 5 years, 4 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: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index 1a7dd782a11896b30b0c432d377037f9a86c6bfd..b9248a6a1822f6d522c93b6a94fecbec755da31a 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -34,6 +34,7 @@
#include "core/css/CSSContentDistributionValue.h"
#include "core/css/CSSCrossfadeValue.h"
#include "core/css/CSSCursorImageValue.h"
+#include "core/css/CSSCustomVariableValue.h"
#include "core/css/CSSFontFaceSrcValue.h"
#include "core/css/CSSFontFeatureValue.h"
#include "core/css/CSSFunctionValue.h"
@@ -464,6 +465,13 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
return true;
}
+ if (RuntimeEnabledFeatures::cssVariablesEnabled() && value->unit() == CSSPrimitiveValue::UnitType::VariableReference) {
+ // We don't expand the shorthand here because crazypants.
alancutter (OOO until 2018) 2015/08/25 01:59:08 There are issues with letting shorthands into the
Timothy Loh 2015/08/25 09:21:10 I'm not sure shorthands even fall into a priority
+ m_parsedProperties.append(CSSProperty(propId, CSSPrimitiveValue::create(value->variableData), important, false, 0, m_implicitShorthand));
+ m_valueList->next();
+ return true;
+ }
+
if (CSSParserFastPaths::isKeywordPropertyID(propId)) {
if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id))
return false;

Powered by Google App Engine
This is Rietveld 408576698