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

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

Issue 1085873002: Only accept inherit/initial/unset in single value declarations (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add subtests Created 5 years, 8 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
« no previous file with comments | « LayoutTests/css3/supports-dom-api-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index 667750ead0a019866b5b317f9e90a9eb207b7d06..762a30db60cc4916187116b2f9a17f211c799334 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -446,25 +446,25 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important)
CSSValueID id = value->id;
- int num = inShorthand() ? 1 : m_valueList->size();
-
if (id == CSSValueInherit) {
- if (num != 1)
+ if (m_valueList->size() != 1)
return false;
addExpandedPropertyForValue(propId, cssValuePool().createInheritedValue(), important);
return true;
} else if (id == CSSValueInitial) {
- if (num != 1)
+ if (m_valueList->size() != 1)
return false;
addExpandedPropertyForValue(propId, cssValuePool().createExplicitInitialValue(), important);
return true;
} else if (id == CSSValueUnset) {
- if (num != 1)
+ if (m_valueList->size() != 1)
return false;
addExpandedPropertyForValue(propId, cssValuePool().createUnsetValue(), important);
return true;
}
+ int num = inShorthand() ? 1 : m_valueList->size();
+
if (CSSParserFastPaths::isKeywordPropertyID(propId)) {
if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id))
return false;
« no previous file with comments | « LayoutTests/css3/supports-dom-api-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698