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

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

Issue 216803002: Implement all shorthand property. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed parseAnimationProperty Created 6 years, 9 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 a2c0284fe3123bdd4d58ec7ee5725aaa0873869b..dcd0b1eff4977d7204e226f2c1a152bcf5d75f3e 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1616,6 +1616,15 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important)
case CSSPropertyPerspectiveOrigin:
case CSSPropertyTransformOrigin:
return false;
+
+ case CSSPropertyAll:
+ // FIXME: need to add CSSValueUnset here.
+ if (id == CSSValueInitial || id == CSSValueInherit) {
+ validPrimitive = true;
+ break;
+ }
+ return false;
+
default:
return parseSVGValue(propId, important);
}
@@ -3089,13 +3098,14 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationProperty(Anima
CSSParserValue* value = m_valueList->current();
if (value->unit != CSSPrimitiveValue::CSS_IDENT)
return nullptr;
- CSSPropertyID result = cssPropertyID(value->string);
- if (result && RuntimeCSSEnabled::isCSSPropertyEnabled(result))
- return cssValuePool().createIdentifierValue(result);
+ // We should treat "all" as CSSValue here.
if (equalIgnoringCase(value, "all")) {
context.sawAnimationPropertyKeyword();
return cssValuePool().createIdentifierValue(CSSValueAll);
}
+ CSSPropertyID result = cssPropertyID(value->string);
+ if (result && RuntimeCSSEnabled::isCSSPropertyEnabled(result))
+ return cssValuePool().createIdentifierValue(result);
if (equalIgnoringCase(value, "none")) {
context.commitAnimationPropertyKeyword();
context.sawAnimationPropertyKeyword();
@@ -7033,7 +7043,9 @@ bool CSSPropertyParser::parseWillChange(bool important)
CSSPropertyID property = cssPropertyID(currentValue->string);
if (property && RuntimeCSSEnabled::isCSSPropertyEnabled(property)) {
- if (property == CSSPropertyWillChange)
+ // Now "all" is used by both CSSValue and CSSPropertyValue.
+ // Need to return false when currentValue is CSSPropertyAll.
+ if (property == CSSPropertyWillChange || property == CSSPropertyAll)
return false;
values->append(cssValuePool().createIdentifierValue(property));
} else {

Powered by Google App Engine
This is Rietveld 408576698