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

Side by Side Diff: Source/core/animation/ElementAnimation.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: Remove class in BisonCSSParserTest and change to new license text 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 if (direction == "reverse") { 113 if (direction == "reverse") {
114 timing.direction = Timing::PlaybackDirectionReverse; 114 timing.direction = Timing::PlaybackDirectionReverse;
115 } else if (direction == "alternate") { 115 } else if (direction == "alternate") {
116 timing.direction = Timing::PlaybackDirectionAlternate; 116 timing.direction = Timing::PlaybackDirectionAlternate;
117 } else if (direction == "alternate-reverse") { 117 } else if (direction == "alternate-reverse") {
118 timing.direction = Timing::PlaybackDirectionAlternateReverse; 118 timing.direction = Timing::PlaybackDirectionAlternateReverse;
119 } 119 }
120 120
121 String timingFunctionString; 121 String timingFunctionString;
122 timingInputDictionary.get("easing", timingFunctionString); 122 timingInputDictionary.get("easing", timingFunctionString);
123 RefPtr<CSSValue> timingFunctionValue = BisonCSSParser::parseAnimationTimingF unctionValue(timingFunctionString); 123 RefPtr<CSSValue> timingFunctionValue = BisonCSSParser::parseAnimationTimingF unctionValue(timingFunctionString, true);
124 if (timingFunctionValue) { 124 if (timingFunctionValue) {
125 RefPtr<TimingFunction> timingFunction = CSSToStyleMap::animationTimingFu nction(timingFunctionValue.get(), false); 125 RefPtr<TimingFunction> timingFunction = CSSToStyleMap::animationTimingFu nction(timingFunctionValue.get(), false);
126 if (timingFunction) 126 if (timingFunction)
127 timing.timingFunction = timingFunction; 127 timing.timingFunction = timingFunction;
128 } 128 }
129 129
130 timing.assertValid(); 130 timing.assertValid();
131 } 131 }
132 132
133 static bool checkDocumentAndRenderer(Element* element) 133 static bool checkDocumentAndRenderer(Element* element)
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 265
266 RefPtr<Animation> animation = Animation::create(element, effect, timing); 266 RefPtr<Animation> animation = Animation::create(element, effect, timing);
267 DocumentTimeline* timeline = element->document().timeline(); 267 DocumentTimeline* timeline = element->document().timeline();
268 ASSERT(timeline); 268 ASSERT(timeline);
269 timeline->play(animation.get()); 269 timeline->play(animation.get());
270 270
271 return animation.get(); 271 return animation.get();
272 } 272 }
273 273
274 } // namespace WebCore 274 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698