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

Side by Side Diff: Source/core/animation/ElementAnimation.cpp

Issue 176903004: Have Document::timeline() / Document::transitionTimeline() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
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 24 matching lines...) Expand all
35 #include "core/animation/DocumentTimeline.h" 35 #include "core/animation/DocumentTimeline.h"
36 #include "core/animation/css/CSSAnimations.h" 36 #include "core/animation/css/CSSAnimations.h"
37 37
38 namespace WebCore { 38 namespace WebCore {
39 39
40 Animation* ElementAnimation::animate(Element& element, Vector<Dictionary> keyfra meDictionaryVector, Dictionary timingInput) 40 Animation* ElementAnimation::animate(Element& element, Vector<Dictionary> keyfra meDictionaryVector, Dictionary timingInput)
41 { 41 {
42 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); 42 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
43 43
44 RefPtr<Animation> animation = Animation::create(&element, keyframeDictionary Vector, timingInput); 44 RefPtr<Animation> animation = Animation::create(&element, keyframeDictionary Vector, timingInput);
45 DocumentTimeline* timeline = element.document().timeline(); 45 DocumentTimeline& timeline = element.document().timeline();
46 ASSERT(timeline); 46 timeline.play(animation.get());
47 timeline->play(animation.get());
48 47
49 return animation.get(); 48 return animation.get();
50 } 49 }
51 50
52 Animation* ElementAnimation::animate(Element& element, Vector<Dictionary> keyfra meDictionaryVector, double timingInput) 51 Animation* ElementAnimation::animate(Element& element, Vector<Dictionary> keyfra meDictionaryVector, double timingInput)
53 { 52 {
54 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); 53 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
55 54
56 RefPtr<Animation> animation = Animation::create(&element, keyframeDictionary Vector, timingInput); 55 RefPtr<Animation> animation = Animation::create(&element, keyframeDictionary Vector, timingInput);
57 DocumentTimeline* timeline = element.document().timeline(); 56 DocumentTimeline& timeline = element.document().timeline();
58 ASSERT(timeline); 57 timeline.play(animation.get());
59 timeline->play(animation.get());
60 58
61 return animation.get(); 59 return animation.get();
62 } 60 }
63 61
64 Animation* ElementAnimation::animate(Element& element, Vector<Dictionary> keyfra meDictionaryVector) 62 Animation* ElementAnimation::animate(Element& element, Vector<Dictionary> keyfra meDictionaryVector)
65 { 63 {
66 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); 64 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
67 65
68 RefPtr<Animation> animation = Animation::create(&element, keyframeDictionary Vector); 66 RefPtr<Animation> animation = Animation::create(&element, keyframeDictionary Vector);
69 DocumentTimeline* timeline = element.document().timeline(); 67 DocumentTimeline& timeline = element.document().timeline();
70 ASSERT(timeline); 68 timeline.play(animation.get());
71 timeline->play(animation.get());
72 69
73 return animation.get(); 70 return animation.get();
74 } 71 }
75 72
76 } // namespace WebCore 73 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/animation/DocumentTimelineTest.cpp ('k') | Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698