| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/page/PageAnimator.h" | 6 #include "core/page/PageAnimator.h" |
| 7 | 7 |
| 8 #include "core/animation/DocumentAnimations.h" | 8 #include "core/animation/DocumentAnimations.h" |
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/frame/Frame.h" | 10 #include "core/frame/Frame.h" |
| 11 #include "core/frame/FrameView.h" | 11 #include "core/frame/FrameView.h" |
| 12 #include "core/page/Page.h" | 12 #include "core/page/Page.h" |
| 13 | 13 |
| 14 namespace WebCore { | 14 namespace WebCore { |
| 15 | 15 |
| 16 PageAnimator::PageAnimator(Page* page) | 16 PageAnimator::PageAnimator(Page* page) |
| 17 : m_page(page) | 17 : m_page(page) |
| 18 , m_servicingAnimations(false) | 18 , m_servicingAnimations(false) |
| 19 { | 19 { |
| 20 } | 20 } |
| 21 | 21 |
| 22 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) | 22 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) |
| 23 { | 23 { |
| 24 TemporaryChange<bool> servicing(m_servicingAnimations, true); | 24 TemporaryChange<bool> servicing(m_servicingAnimations, true); |
| 25 | 25 |
| 26 for (RefPtr<Frame> frame = m_page->mainFrame(); frame; frame = frame->tree()
.traverseNext()) { | 26 for (RefPtr<Frame> frame = m_page->mainFrame(); frame; frame = frame->tree()
.traverseNext()) { |
| 27 frame->view()->serviceScrollAnimations(); | 27 frame->view()->serviceScrollAnimations(); |
| 28 DocumentAnimations::serviceOnAnimationFrame(*frame->document(), monotoni
cAnimationStartTime); | 28 DocumentAnimations::updateAnimationTimingForAnimationFrame(*frame->docum
ent(), monotonicAnimationStartTime); |
| 29 // FIXME: animation event dispatch should move to the ScriptedAnimationC
ontroller |
| 30 DocumentAnimations::dispatchAnimationEvents(*frame->document()); |
| 29 } | 31 } |
| 30 | 32 |
| 31 Vector<RefPtr<Document> > documents; | 33 Vector<RefPtr<Document> > documents; |
| 32 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver
seNext()) | 34 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver
seNext()) |
| 33 documents.append(frame->document()); | 35 documents.append(frame->document()); |
| 34 | 36 |
| 35 for (size_t i = 0; i < documents.size(); ++i) | 37 for (size_t i = 0; i < documents.size(); ++i) |
| 36 documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); | 38 documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); |
| 37 } | 39 } |
| 38 | 40 |
| 39 } | 41 } |
| OLD | NEW |