Index: Source/core/css/parser/BisonCSSParser-in.cpp |
diff --git a/Source/core/css/parser/BisonCSSParser-in.cpp b/Source/core/css/parser/BisonCSSParser-in.cpp |
index ae1be585ec9f05899ea66538487b9da0b0f769db..de7119266217e6464153a9d21d6bb14999d92261 100644 |
--- a/Source/core/css/parser/BisonCSSParser-in.cpp |
+++ b/Source/core/css/parser/BisonCSSParser-in.cpp |
@@ -199,6 +199,7 @@ BisonCSSParser::BisonCSSParser(const CSSParserContext& context, UseCounter* coun |
, m_hadSyntacticallyValidCSSRule(false) |
, m_logErrors(false) |
, m_ignoreErrors(false) |
+ , m_parseStepMiddleTimingFunction(false) |
eseidel
2014/02/05 01:41:18
This can't be right. We really need to disintangl
|
, m_defaultNamespace(starAtom) |
, m_observer(0) |
, m_source(0) |
@@ -1114,12 +1115,12 @@ PassRefPtr<CSSValueList> BisonCSSParser::parseFontFaceValue(const AtomicString& |
return toCSSValueList(dummyStyle->getPropertyCSSValue(CSSPropertyFontFamily).get()); |
} |
-PassRefPtr<CSSValue> BisonCSSParser::parseAnimationTimingFunctionValue(const String& string) |
+PassRefPtr<CSSValue> BisonCSSParser::parseAnimationTimingFunctionValue(const String& string, bool parseStepMiddleTimingFunction) |
{ |
if (string.isEmpty()) |
return 0; |
RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(); |
- if (!parseValue(style.get(), CSSPropertyAnimationTimingFunction, string, false, HTMLStandardMode, 0)) |
+ if (!parseValue(style.get(), CSSPropertyAnimationTimingFunction, string, false, HTMLStandardMode, 0, parseStepMiddleTimingFunction)) |
return 0; |
return style->getPropertyCSSValue(CSSPropertyAnimationTimingFunction); |
@@ -1142,7 +1143,7 @@ bool BisonCSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropert |
return parser.parseValue(declaration, propertyID, string, important, static_cast<StyleSheetContents*>(0)); |
} |
-bool BisonCSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID propertyID, const String& string, bool important, CSSParserMode cssParserMode, StyleSheetContents* contextStyleSheet) |
+bool BisonCSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID propertyID, const String& string, bool important, CSSParserMode cssParserMode, StyleSheetContents* contextStyleSheet, bool parseStepMiddleTimingFunction) |
Timothy Loh
2014/02/03 01:49:49
Why not just inline the relevant parts of this fun
rjwright
2014/02/03 02:47:14
I could do that. Although nothing else calls the p
alancutter (OOO until 2018)
2014/02/04 02:11:15
Should we add a FIXME to make step middle part of
|
{ |
ASSERT(!string.isEmpty()); |
if (parseSimpleLengthValue(declaration, propertyID, string, important, cssParserMode)) |
@@ -1162,6 +1163,7 @@ bool BisonCSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropert |
return true; |
BisonCSSParser parser(context); |
+ parser.m_parseStepMiddleTimingFunction = parseStepMiddleTimingFunction; |
return parser.parseValue(declaration, propertyID, string, important, contextStyleSheet); |
} |
@@ -4413,7 +4415,8 @@ PassRefPtr<CSSValue> BisonCSSParser::parseAnimationTimingFunction() |
{ |
CSSParserValue* value = m_valueList->current(); |
if (value->id == CSSValueEase || value->id == CSSValueLinear || value->id == CSSValueEaseIn || value->id == CSSValueEaseOut |
- || value->id == CSSValueEaseInOut || value->id == CSSValueStepStart || value->id == CSSValueStepEnd) |
+ || value->id == CSSValueEaseInOut || value->id == CSSValueStepStart || value->id == CSSValueStepEnd |
+ || (value->id == CSSValueStepMiddle && m_parseStepMiddleTimingFunction)) |
return cssValuePool().createIdentifierValue(value->id); |
// We must be a function. |
@@ -4429,7 +4432,7 @@ PassRefPtr<CSSValue> BisonCSSParser::parseAnimationTimingFunction() |
// There are two values. |
int numSteps; |
- bool stepAtStart = false; |
+ StepsTimingFunction::StepAtPosition stepAtPosition = StepsTimingFunction::StepAtEnd; |
CSSParserValue* v = args->current(); |
if (!validUnit(v, FInteger)) |
@@ -4444,12 +4447,18 @@ PassRefPtr<CSSValue> BisonCSSParser::parseAnimationTimingFunction() |
if (!isComma(v)) |
return 0; |
v = args->next(); |
- if (v->id != CSSValueStart && v->id != CSSValueEnd) |
+ if (!m_parseStepMiddleTimingFunction && v->id == CSSValueMiddle) |
return 0; |
- stepAtStart = v->id == CSSValueStart; |
+ if (v->id != CSSValueStart && v->id != CSSValueEnd && v->id != CSSValueMiddle) |
+ return 0; |
+ if (v->id == CSSValueStart) { |
+ stepAtPosition = StepsTimingFunction::StepAtStart; |
+ } else if (v->id == CSSValueMiddle) { |
+ stepAtPosition = StepsTimingFunction::StepAtMiddle; |
+ } |
alancutter (OOO until 2018)
2014/02/04 01:19:12
The above 8 lines might be cleaner as a switch on
rjwright
2014/02/17 07:16:53
Done.
|
} |
- return CSSStepsTimingFunctionValue::create(numSteps, stepAtStart); |
+ return CSSStepsTimingFunctionValue::create(numSteps, stepAtPosition); |
} |
if (equalIgnoringCase(value->function->name, "cubic-bezier(")) { |