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

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

Issue 893193005: Remove duplicated CSSValueNone checks (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | 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 539ad6ed8b536633969c16a67cce948d565f22a6..ee2484f9f05b6bd0306d55508e9a82689b2a80ec 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1194,7 +1194,10 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important)
return parseShorthand(propId, parsingShorthandForProperty(CSSPropertyMotion), important);
case CSSPropertyMotionPath:
ASSERT(RuntimeEnabledFeatures::cssMotionPathEnabled());
- parsedValue = parseMotionPath();
+ if (id == CSSValueNone)
+ validPrimitive = true;
+ else
+ parsedValue = parseMotionPath();
break;
case CSSPropertyMotionPosition:
ASSERT(RuntimeEnabledFeatures::cssMotionPathEnabled());
@@ -1516,7 +1519,10 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important)
}
break;
case CSSPropertyShapeOutside:
- parsedValue = parseShapeProperty(propId);
+ if (id == CSSValueNone)
+ validPrimitive = true;
+ else
+ parsedValue = parseShapeProperty(propId);
break;
case CSSPropertyShapeMargin:
validPrimitive = (!id && validUnit(value, FLength | FPercent | FNonNeg));
@@ -1530,7 +1536,10 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important)
break;
case CSSPropertyScrollBlocksOn:
- parsedValue = parseScrollBlocksOn();
+ if (id == CSSValueNone)
+ validPrimitive = true;
+ else
+ parsedValue = parseScrollBlocksOn();
break;
case CSSPropertyAlignContent:
@@ -4411,17 +4420,8 @@ static bool isBoxValue(CSSValueID valueId)
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseShapeProperty(CSSPropertyID propId)
{
- CSSParserValue* value = m_valueList->current();
- CSSValueID valueId = value->id;
-
- if (valueId == CSSValueNone) {
- RefPtrWillBeRawPtr<CSSPrimitiveValue> keywordValue = parseValidPrimitive(valueId, value);
- m_valueList->next();
- return keywordValue.release();
- }
-
RefPtrWillBeRawPtr<CSSValue> imageValue = nullptr;
- if (valueId != CSSValueNone && parseFillImage(m_valueList, imageValue)) {
+ if (parseFillImage(m_valueList, imageValue)) {
m_valueList->next();
return imageValue.release();
}
@@ -7493,13 +7493,8 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTouchAction()
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseScrollBlocksOn()
{
- CSSParserValue* value = m_valueList->current();
- if (value->id == CSSValueNone) {
- m_valueList->next();
- return cssValuePool().createIdentifierValue(CSSValueNone);
- }
-
RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ CSSParserValue* value = m_valueList->current();
while (value) {
switch (value->id) {
case CSSValueStartTouch:
@@ -8533,10 +8528,6 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTransformValue(CSSPrope
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseMotionPath()
{
CSSParserValue* value = m_valueList->current();
- if (value->id == CSSValueNone) {
- m_valueList->next();
- return cssValuePool().createIdentifierValue(CSSValueNone);
- }
// FIXME: Add support for <url>, <basic-shape>, <geometry-box>.
if (value->unit != CSSParserValue::Function || value->function->id != CSSValuePath)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698