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

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

Issue 1239983004: Make CSSCalcValue work with CSSParserTokenRange (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add more subtests Created 5 years, 5 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 | « Source/core/css/parser/CSSPropertyParser.h ('k') | 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 e726f738334bebd4ff43fea37c39c5209d6139e9..dec461d15a9cd94c32b91565961a6fb6be3b9e74 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -184,7 +184,7 @@ bool CSSPropertyParser::validCalculationUnit(CSSParserValue* value, Units unitfl
if ((unitflags & FPositiveInteger) && number <= 0) {
b = false;
} else {
- delete value->function;
+ delete value->calcFunction;
value->setUnit(CSSPrimitiveValue::UnitType::Number);
value->fValue = number;
value->isInt = m_parsedCalculation->isInt();
@@ -230,6 +230,11 @@ inline bool CSSPropertyParser::shouldAcceptUnitLessValues(CSSParserValue* value,
|| (cssParserMode == HTMLQuirksMode && (unitflags & FUnitlessQuirk)));
}
+inline bool isCalculation(CSSParserValue* value)
+{
+ return value->m_unit == CSSParserValue::CalcFunction;
+}
+
bool CSSPropertyParser::validUnit(CSSParserValue* value, Units unitflags, CSSParserMode cssParserMode, ReleaseParsedCalcValueCondition releaseCalc)
{
if (isCalculation(value))
@@ -4961,14 +4966,6 @@ PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseFontFaceUnicodeRang
return values.release();
}
-
-bool CSSPropertyParser::isCalculation(CSSParserValue* value)
-{
- return (value->m_unit == CSSParserValue::Function)
- && (value->function->id == CSSValueCalc
- || value->function->id == CSSValueWebkitCalc);
-}
-
inline int CSSPropertyParser::colorIntFromValue(CSSParserValue* v)
{
bool isPercent;
@@ -7442,9 +7439,7 @@ bool CSSPropertyParser::parseCalculation(CSSParserValue* value, ValueRange range
{
ASSERT(isCalculation(value));
- CSSParserValueList* args = value->function->args.get();
- if (!args || !args->size())
- return false;
+ CSSParserTokenRange args = value->calcFunction->args;
ASSERT(!m_parsedCalculation);
m_parsedCalculation = CSSCalcValue::create(args, range);
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698