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

Unified Diff: Source/core/css/CSSTimingFunctionValue.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/CSSTimingFunctionValue.h ('k') | Source/core/css/CSSValueKeywords.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSTimingFunctionValue.cpp
diff --git a/Source/core/css/CSSTimingFunctionValue.cpp b/Source/core/css/CSSTimingFunctionValue.cpp
index 49420cbb26b6b54bb0b0e278abbe146e88b51f0a..b8eee452acaf826b7ecec3c1ad647283d421f8b6 100644
--- a/Source/core/css/CSSTimingFunctionValue.cpp
+++ b/Source/core/css/CSSTimingFunctionValue.cpp
@@ -46,12 +46,28 @@ bool CSSCubicBezierTimingFunctionValue::equals(const CSSCubicBezierTimingFunctio
String CSSStepsTimingFunctionValue::customCSSText() const
{
- return "steps(" + String::number(m_steps) + ", " + (m_stepAtStart ? "start" : "end") + ')';
+ String stepAtPositionString;
+ switch (m_stepAtPosition) {
+ case StepsTimingFunction::StepAtStart:
+ stepAtPositionString = "start";
+ break;
+ case StepsTimingFunction::StepAtMiddle:
+ stepAtPositionString = "middle";
+ break;
+ case StepsTimingFunction::StepAtEnd:
+ stepAtPositionString = "end";
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ stepAtPositionString = "end";
+ break;
+ }
+ return "steps(" + String::number(m_steps) + ", " + stepAtPositionString + ')';
}
bool CSSStepsTimingFunctionValue::equals(const CSSStepsTimingFunctionValue& other) const
{
- return m_steps == other.m_steps && m_stepAtStart == other.m_stepAtStart;
+ return m_steps == other.m_steps && m_stepAtPosition == other.m_stepAtPosition;
}
} // namespace WebCore
« no previous file with comments | « Source/core/css/CSSTimingFunctionValue.h ('k') | Source/core/css/CSSValueKeywords.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698