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/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 DEFINE_TRACE(PageAnimator) | 30 DEFINE_TRACE(PageAnimator) |
31 { | 31 { |
32 visitor->trace(m_page); | 32 visitor->trace(m_page); |
33 } | 33 } |
34 | 34 |
35 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) | 35 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) |
36 { | 36 { |
37 RefPtrWillBeRawPtr<PageAnimator> protector(this); | 37 RefPtrWillBeRawPtr<PageAnimator> protector(this); |
38 TemporaryChange<bool> servicing(m_servicingAnimations, true); | 38 TemporaryChange<bool> servicing(m_servicingAnimations, true); |
| 39 clock().updateTime(monotonicAnimationStartTime); |
39 | 40 |
40 WillBeHeapVector<RefPtrWillBeMember<Document>> documents; | 41 WillBeHeapVector<RefPtrWillBeMember<Document>> documents; |
41 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver
seNext()) { | 42 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver
seNext()) { |
42 if (frame->isLocalFrame()) | 43 if (frame->isLocalFrame()) |
43 documents.append(toLocalFrame(frame)->document()); | 44 documents.append(toLocalFrame(frame)->document()); |
44 } | 45 } |
45 | 46 |
46 for (auto& document : documents) { | 47 for (auto& document : documents) { |
47 DocumentAnimations::updateAnimationTimingForAnimationFrame(*document, mo
notonicAnimationStartTime); | 48 DocumentAnimations::updateAnimationTimingForAnimationFrame(*document); |
48 if (document->view()) { | 49 if (document->view()) { |
49 if (document->view()->shouldThrottleRendering()) | 50 if (document->view()->shouldThrottleRendering()) |
50 continue; | 51 continue; |
51 document->view()->scrollableArea()->serviceScrollAnimations(monotoni
cAnimationStartTime); | 52 document->view()->scrollableArea()->serviceScrollAnimations(monotoni
cAnimationStartTime); |
52 | 53 |
53 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d
ocument->view()->animatingScrollableAreas()) { | 54 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d
ocument->view()->animatingScrollableAreas()) { |
54 // Iterate over a copy, since ScrollableAreas may deregister | 55 // Iterate over a copy, since ScrollableAreas may deregister |
55 // themselves during the iteration. | 56 // themselves during the iteration. |
56 WillBeHeapVector<RawPtrWillBeMember<ScrollableArea>> animatingSc
rollableAreasCopy; | 57 WillBeHeapVector<RawPtrWillBeMember<ScrollableArea>> animatingSc
rollableAreasCopy; |
57 copyToVector(*animatingScrollableAreas, animatingScrollableAreas
Copy); | 58 copyToVector(*animatingScrollableAreas, animatingScrollableAreas
Copy); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 } | 102 } |
102 | 103 |
103 void PageAnimator::updateAllLifecyclePhases(LocalFrame& rootFrame) | 104 void PageAnimator::updateAllLifecyclePhases(LocalFrame& rootFrame) |
104 { | 105 { |
105 RefPtrWillBeRawPtr<FrameView> view = rootFrame.view(); | 106 RefPtrWillBeRawPtr<FrameView> view = rootFrame.view(); |
106 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); | 107 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); |
107 view->updateAllLifecyclePhases(); | 108 view->updateAllLifecyclePhases(); |
108 } | 109 } |
109 | 110 |
110 } | 111 } |
OLD | NEW |