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

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: Add comment to timing-functions test re. invalidity of step-middle in CSS 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 unified diff | Download patch
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 {
eseidel 2014/02/05 01:41:18 Indent looks wrong.
rjwright 2014/02/17 07:16:53 Done.
53 stepAtPositionString = "start";
54 break;
55 }
56 case StepsTimingFunction::StepAtMiddle:
57 {
58 stepAtPositionString = "middle";
59 break;
60 }
61 case StepsTimingFunction::StepAtEnd:
62 {
63 stepAtPositionString = "end";
64 break;
65 }
66 default:
67 {
68 ASSERT_NOT_REACHED();
69 stepAtPositionString = "end";
70 break;
71 }
72 }
73 return "steps(" + String::number(m_steps) + ", " + stepAtPositionString + ') ';
50 } 74 }
51 75
52 bool CSSStepsTimingFunctionValue::equals(const CSSStepsTimingFunctionValue& othe r) const 76 bool CSSStepsTimingFunctionValue::equals(const CSSStepsTimingFunctionValue& othe r) const
53 { 77 {
54 return m_steps == other.m_steps && m_stepAtStart == other.m_stepAtStart; 78 return m_steps == other.m_steps && m_stepAtPosition == other.m_stepAtPositio n;
55 } 79 }
56 80
57 } // namespace WebCore 81 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698