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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp

Issue 2288633002: Recognise variable names when parsing CSS property names (Closed)
Patch Set: fix long var names Created 4 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: third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
index 59c96a646cdd6bc98f2765b1a43d5e7d62918f6a..f311f428f82330de06dd36bf35afc0f5869f89b8 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
@@ -766,7 +766,8 @@ void CSSParserImpl::consumeDeclaration(CSSParserTokenRange range, StyleRule::Rul
}
size_t propertiesCount = m_parsedProperties.size();
- if (unresolvedProperty == CSSPropertyInvalid && CSSVariableParser::isValidVariableName(token)) {
+ // TODO(timloh): This only be for StyleRule::Style, crbug.com/641873.
+ if (unresolvedProperty == CSSPropertyVariable) {
AtomicString variableName = token.value().toAtomicString();
consumeVariableValue(range.makeSubRange(&range.peek(), declarationValueEnd), variableName, important);
}
@@ -774,7 +775,7 @@ void CSSParserImpl::consumeDeclaration(CSSParserTokenRange range, StyleRule::Rul
if (important && (ruleType == StyleRule::FontFace || ruleType == StyleRule::Keyframe))
return;
- if (unresolvedProperty != CSSPropertyInvalid) {
+ if (unresolvedProperty != CSSPropertyInvalid && unresolvedProperty != CSSPropertyVariable) {
if (m_styleSheet && m_styleSheet->singleOwnerDocument())
Deprecation::warnOnDeprecatedProperties(m_styleSheet->singleOwnerDocument()->frame(), unresolvedProperty);
consumeDeclarationValue(range.makeSubRange(&range.peek(), declarationValueEnd), unresolvedProperty, important, ruleType);

Powered by Google App Engine
This is Rietveld 408576698