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

Side by Side 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, 9 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 unified diff | Download patch
« no previous file with comments | « Source/core/css/CSSTimingFunctionValue.h ('k') | Source/core/css/CSSValueKeywords.in » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 28 matching lines...) Expand all
39 + String::number(m_y2) + ")"; 39 + String::number(m_y2) + ")";
40 } 40 }
41 41
42 bool CSSCubicBezierTimingFunctionValue::equals(const CSSCubicBezierTimingFunctio nValue& other) const 42 bool CSSCubicBezierTimingFunctionValue::equals(const CSSCubicBezierTimingFunctio nValue& other) const
43 { 43 {
44 return m_x1 == other.m_x1 && m_x2 == other.m_x2 && m_y1 == other.m_y1 && m_y 2 == other.m_y2; 44 return m_x1 == other.m_x1 && m_x2 == other.m_x2 && m_y1 == other.m_y1 && m_y 2 == other.m_y2;
45 } 45 }
46 46
47 String CSSStepsTimingFunctionValue::customCSSText() const 47 String CSSStepsTimingFunctionValue::customCSSText() const
48 { 48 {
49 return "steps(" + String::number(m_steps) + ", " + (m_stepAtStart ? "start" : "end") + ')'; 49 String stepAtPositionString;
50 switch (m_stepAtPosition) {
51 case StepsTimingFunction::StepAtStart:
52 stepAtPositionString = "start";
53 break;
54 case StepsTimingFunction::StepAtMiddle:
55 stepAtPositionString = "middle";
56 break;
57 case StepsTimingFunction::StepAtEnd:
58 stepAtPositionString = "end";
59 break;
60 default:
61 ASSERT_NOT_REACHED();
62 stepAtPositionString = "end";
63 break;
64 }
65 return "steps(" + String::number(m_steps) + ", " + stepAtPositionString + ') ';
50 } 66 }
51 67
52 bool CSSStepsTimingFunctionValue::equals(const CSSStepsTimingFunctionValue& othe r) const 68 bool CSSStepsTimingFunctionValue::equals(const CSSStepsTimingFunctionValue& othe r) const
53 { 69 {
54 return m_steps == other.m_steps && m_stepAtStart == other.m_stepAtStart; 70 return m_steps == other.m_steps && m_stepAtPosition == other.m_stepAtPositio n;
55 } 71 }
56 72
57 } // namespace WebCore 73 } // namespace WebCore
OLDNEW
« 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