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

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: Created 6 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: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index 6a73395a84860308455206e880ec42b9447cadae..830f209bd30af362b9a386734b4388e9040defce 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1612,6 +1612,14 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important)
case CSSPropertyUserZoom:
validPrimitive = false;
break;
+
+ case CSSPropertyAll:
+ if (id == CSSValueInitial || id == CSSValueInherit || id == CSSValueUnset) {
+ validPrimitive = true;
+ break;
+ }
+ return false;
+
default:
return parseSVGValue(propId, important);
}
@@ -3073,11 +3081,14 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationProperty()
CSSParserValue* value = m_valueList->current();
if (value->unit != CSSPrimitiveValue::CSS_IDENT)
return nullptr;
+ // Since all is valid css property keyword, cssPropertyID for all
+ // returns non-null value. We need to check "all" before
+ // cssPropertyID check.
+ if (equalIgnoringCase(value, "all"))
+ return cssValuePool().createIdentifierValue(CSSValueAll);
CSSPropertyID result = cssPropertyID(value->string);
if (result && RuntimeCSSEnabled::isCSSPropertyEnabled(result))
return cssValuePool().createIdentifierValue(result);
- if (equalIgnoringCase(value, "all"))
- return cssValuePool().createIdentifierValue(CSSValueAll);
if (equalIgnoringCase(value, "none"))
return cssValuePool().createIdentifierValue(CSSValueNone);
return nullptr;
@@ -7178,7 +7189,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