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

Unified Diff: Source/core/css/CSSCalculationValue.cpp

Issue 470903003: Remove CSSParserValue::createCSSValue and unused callers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pp4
Patch Set: fix forward decl Created 6 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
« no previous file with comments | « no previous file | Source/core/css/CSSFunctionValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSCalculationValue.cpp
diff --git a/Source/core/css/CSSCalculationValue.cpp b/Source/core/css/CSSCalculationValue.cpp
index 07ed153f10117da48d578ea5662e424fa7a2ca6e..08ddc91b01d465fb94e149ffcf4db0c41969e4c7 100644
--- a/Source/core/css/CSSCalculationValue.cpp
+++ b/Source/core/css/CSSCalculationValue.cpp
@@ -644,18 +644,18 @@ private:
bool parseValue(CSSParserValueList* tokens, unsigned* index, Value* result)
{
CSSParserValue* parserValue = tokens->valueAt(*index);
- if (parserValue->unit == CSSParserValue::Operator)
+ if (parserValue->unit >= CSSParserValue::Operator)
return false;
- RefPtrWillBeRawPtr<CSSValue> value = parserValue->createCSSValue();
- if (!value || !value->isPrimitiveValue())
+ CSSPrimitiveValue::UnitType type = static_cast<CSSPrimitiveValue::UnitType>(parserValue->unit);
+ if (unitCategory(type) == CalcOther)
return false;
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get());
- if (unitCategory(primitiveValue->primitiveType()) == CalcOther)
- return false;
+ if (type == CSSPrimitiveValue::CSS_NUMBER && parserValue->isInt)
+ type = CSSPrimitiveValue::CSS_PARSER_INTEGER;
- result->value = CSSCalcPrimitiveValue::create(primitiveValue, parserValue->isInt);
+ result->value = CSSCalcPrimitiveValue::create(
+ CSSPrimitiveValue::create(parserValue->fValue, type), parserValue->isInt);
++*index;
return true;
« no previous file with comments | « no previous file | Source/core/css/CSSFunctionValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698