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); | |
40 | 39 |
41 WillBeHeapVector<RefPtrWillBeMember<Document>> documents; | 40 WillBeHeapVector<RefPtrWillBeMember<Document>> documents; |
42 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver
seNext()) { | 41 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver
seNext()) { |
43 if (frame->isLocalFrame()) | 42 if (frame->isLocalFrame()) |
44 documents.append(toLocalFrame(frame)->document()); | 43 documents.append(toLocalFrame(frame)->document()); |
45 } | 44 } |
46 | 45 |
47 for (auto& document : documents) { | 46 for (auto& document : documents) { |
48 DocumentAnimations::updateAnimationTimingForAnimationFrame(*document); | 47 DocumentAnimations::updateAnimationTimingForAnimationFrame(*document, mo
notonicAnimationStartTime); |
49 if (document->view()) { | 48 if (document->view()) { |
50 if (document->view()->shouldThrottleRendering()) | 49 if (document->view()->shouldThrottleRendering()) |
51 continue; | 50 continue; |
52 document->view()->scrollableArea()->serviceScrollAnimations(monotoni
cAnimationStartTime); | 51 document->view()->scrollableArea()->serviceScrollAnimations(monotoni
cAnimationStartTime); |
53 | 52 |
54 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d
ocument->view()->animatingScrollableAreas()) { | 53 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d
ocument->view()->animatingScrollableAreas()) { |
55 // Iterate over a copy, since ScrollableAreas may deregister | 54 // Iterate over a copy, since ScrollableAreas may deregister |
56 // themselves during the iteration. | 55 // themselves during the iteration. |
57 WillBeHeapVector<RawPtrWillBeMember<ScrollableArea>> animatingSc
rollableAreasCopy; | 56 WillBeHeapVector<RawPtrWillBeMember<ScrollableArea>> animatingSc
rollableAreasCopy; |
58 copyToVector(*animatingScrollableAreas, animatingScrollableAreas
Copy); | 57 copyToVector(*animatingScrollableAreas, animatingScrollableAreas
Copy); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 RefPtrWillBeRawPtr<FrameView> view = rootFrame->view(); | 91 RefPtrWillBeRawPtr<FrameView> view = rootFrame->view(); |
93 | 92 |
94 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); | 93 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); |
95 | 94 |
96 // setFrameRect may have the side-effect of causing existing page layout to | 95 // setFrameRect may have the side-effect of causing existing page layout to |
97 // be invalidated, so layout needs to be called last. | 96 // be invalidated, so layout needs to be called last. |
98 view->updateAllLifecyclePhases(); | 97 view->updateAllLifecyclePhases(); |
99 } | 98 } |
100 | 99 |
101 } | 100 } |
OLD | NEW |