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

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

Issue 149363002: Web Animations API: Implement step-middle and steps(x, middle) timing functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Merged patch into fresh branch (to avoid scary rebase) Created 6 years, 10 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/BisonCSSParserTest.cpp ('k') | Source/core/css/resolver/CSSToStyleMap.cpp » ('j') | 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 09ce7ac4fa2bb41de1c6190f3f4523392c13f3b7..6bb18f41dcb44e202693c6f09b9c2e74f8e81777 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -3127,7 +3127,8 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::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 && RuntimeEnabledFeatures::webAnimationsAPIEnabled()))
return cssValuePool().createIdentifierValue(value->id);
// We must be a function.
@@ -3143,7 +3144,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationTimingFunction
// There are two values.
int numSteps;
- bool stepAtStart = false;
+ StepsTimingFunction::StepAtPosition stepAtPosition = StepsTimingFunction::StepAtEnd;
CSSParserValue* v = args->current();
if (!validUnit(v, FInteger))
@@ -3158,12 +3159,24 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationTimingFunction
if (!isComma(v))
return nullptr;
v = args->next();
- if (v->id != CSSValueStart && v->id != CSSValueEnd)
+ switch (v->id) {
+ case CSSValueMiddle:
+ if (!RuntimeEnabledFeatures::webAnimationsAPIEnabled())
+ return nullptr;
+ stepAtPosition = StepsTimingFunction::StepAtMiddle;
+ break;
+ case CSSValueStart:
+ stepAtPosition = StepsTimingFunction::StepAtStart;
+ break;
+ case CSSValueEnd:
+ stepAtPosition = StepsTimingFunction::StepAtEnd;
+ break;
+ default:
return nullptr;
- stepAtStart = v->id == CSSValueStart;
+ }
}
- return CSSStepsTimingFunctionValue::create(numSteps, stepAtStart);
+ return CSSStepsTimingFunctionValue::create(numSteps, stepAtPosition);
}
if (equalIgnoringCase(value->function->name, "cubic-bezier(")) {
« no previous file with comments | « Source/core/css/parser/BisonCSSParserTest.cpp ('k') | Source/core/css/resolver/CSSToStyleMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698