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

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

Issue 209353004: Remove mutation foot-gun from CSSPrimitiveValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: removed 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
« no previous file with comments | « no previous file | Source/core/css/CSSPrimitiveValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSParserValues.cpp
diff --git a/Source/core/css/CSSParserValues.cpp b/Source/core/css/CSSParserValues.cpp
index 5336c85adfc4ae3968004d2438c71035bfb1905b..11be3c15c3b168641f6f0415263e9a3005a2d0c9 100644
--- a/Source/core/css/CSSParserValues.cpp
+++ b/Source/core/css/CSSParserValues.cpp
@@ -87,14 +87,10 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSParserValue::createCSSValue()
if (id)
return CSSPrimitiveValue::createIdentifier(id);
- if (unit == CSSParserValue::Operator) {
- RefPtrWillBeRawPtr<CSSPrimitiveValue> primitiveValue = CSSPrimitiveValue::createParserOperator(iValue);
- primitiveValue->setPrimitiveType(CSSPrimitiveValue::CSS_PARSER_OPERATOR);
- return primitiveValue;
- }
- if (unit == CSSParserValue::Function) {
+ if (unit == CSSParserValue::Operator)
+ return CSSPrimitiveValue::createParserOperator(iValue);
+ if (unit == CSSParserValue::Function)
return CSSFunctionValue::create(function);
- }
if (unit == CSSParserValue::ValueList)
return CSSValueList::createFromParserValueList(valueList);
if (unit >= CSSParserValue::Q_EMS)
@@ -148,9 +144,9 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSParserValue::createCSSValue()
case CSSPrimitiveValue::CSS_DPCM:
case CSSPrimitiveValue::CSS_PAIR:
case CSSPrimitiveValue::CSS_UNICODE_RANGE:
- case CSSPrimitiveValue::CSS_PARSER_OPERATOR:
case CSSPrimitiveValue::CSS_PARSER_INTEGER:
case CSSPrimitiveValue::CSS_PARSER_IDENTIFIER:
+ case CSSPrimitiveValue::CSS_PARSER_OPERATOR:
case CSSPrimitiveValue::CSS_COUNTER_NAME:
case CSSPrimitiveValue::CSS_SHAPE:
case CSSPrimitiveValue::CSS_QUAD:
« no previous file with comments | « no previous file | Source/core/css/CSSPrimitiveValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698