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

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: Fix autoclose problem 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
Index: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index 98e638f9ab8ea36b52381bdd2c08714ac522a16f..1259aee55c49c47661b47309d0ecdebea439d87b 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->unit = CSSPrimitiveValue::CSS_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->unit == CSSParserValue::CalcFunction;
+}
+
bool CSSPropertyParser::validUnit(CSSParserValue* value, Units unitflags, CSSParserMode cssParserMode, ReleaseParsedCalcValueCondition releaseCalc)
{
if (isCalculation(value))
@@ -4955,13 +4960,6 @@ PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseFontFaceUnicodeRang
}
-bool CSSPropertyParser::isCalculation(CSSParserValue* value)
-{
- return (value->unit == CSSParserValue::Function)
- && (value->function->id == CSSValueCalc
- || value->function->id == CSSValueWebkitCalc);
-}
-
inline int CSSPropertyParser::colorIntFromValue(CSSParserValue* v)
{
bool isPercent;
@@ -7429,9 +7427,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);
« Source/core/css/parser/CSSParserValues.cpp ('K') | « Source/core/css/parser/CSSPropertyParser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698