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

Side by Side Diff: Source/core/animation/css/CSSAnimations.cpp

Issue 23327003: Web Animations: Set the DocumentTimeline's zero time when the Document reaches the 'loading' phase (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/dom/Document.cpp » ('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) 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 inactive.remove(animationName.impl()); 182 inactive.remove(animationName.impl());
183 continue; 183 continue;
184 } 184 }
185 185
186 KeyframeAnimationEffect::KeyframeVector keyframes; 186 KeyframeAnimationEffect::KeyframeVector keyframes;
187 element->document()->styleResolver()->resolveKeyframes(element, styl e, animationName.impl(), keyframes); 187 element->document()->styleResolver()->resolveKeyframes(element, styl e, animationName.impl(), keyframes);
188 if (!keyframes.isEmpty()) { 188 if (!keyframes.isEmpty()) {
189 Timing timing; 189 Timing timing;
190 timingFromAnimationData(animationData, timing); 190 timingFromAnimationData(animationData, timing);
191 OwnPtr<CSSAnimations::EventDelegate> eventDelegate = adoptPtr(ne w EventDelegate(element, animationName)); 191 OwnPtr<CSSAnimations::EventDelegate> eventDelegate = adoptPtr(ne w EventDelegate(element, animationName));
192 ASSERT(!isNull(element->document()->timeline()->currentTime()));
192 // FIXME: crbug.com/268791 - Keyframes are already normalized, p erhaps there should be a flag on KeyframeAnimationEffect to skip normalization. 193 // FIXME: crbug.com/268791 - Keyframes are already normalized, p erhaps there should be a flag on KeyframeAnimationEffect to skip normalization.
193 m_animations.set(animationName.impl(), element->document()->time line()->play( 194 m_animations.set(animationName.impl(), element->document()->time line()->play(
194 Animation::create(element, KeyframeAnimationEffect::create(k eyframes), timing, eventDelegate.release()).get()).get()); 195 Animation::create(element, KeyframeAnimationEffect::create(k eyframes), timing, eventDelegate.release()).get()).get());
195 } 196 }
196 } 197 }
197 } 198 }
198 199
199 for (HashSet<StringImpl*>::const_iterator iter = inactive.begin(); iter != i nactive.end(); ++iter) 200 for (HashSet<StringImpl*>::const_iterator iter = inactive.begin(); iter != i nactive.end(); ++iter)
200 m_animations.take(*iter)->cancel(); 201 m_animations.take(*iter)->cancel();
201 } 202 }
(...skipping 28 matching lines...) Expand all
230 maybeDispatch(Document::ANIMATIONITERATION_LISTENER, eventNames().webkit AnimationIterationEvent, elapsedTime); 231 maybeDispatch(Document::ANIMATIONITERATION_LISTENER, eventNames().webkit AnimationIterationEvent, elapsedTime);
231 return; 232 return;
232 } 233 }
233 if (wasInPlay && !isInPlay) { 234 if (wasInPlay && !isInPlay) {
234 maybeDispatch(Document::ANIMATIONEND_LISTENER, eventNames().webkitAnimat ionEndEvent, elapsedTime); 235 maybeDispatch(Document::ANIMATIONEND_LISTENER, eventNames().webkitAnimat ionEndEvent, elapsedTime);
235 return; 236 return;
236 } 237 }
237 } 238 }
238 239
239 } // namespace WebCore 240 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698