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/FrameView.h" | 10 #include "core/frame/FrameView.h" |
(...skipping 11 matching lines...) Expand all Loading... | |
22 , m_servicingAnimations(false) | 22 , m_servicingAnimations(false) |
23 , m_updatingLayoutAndStyleForPainting(false) | 23 , m_updatingLayoutAndStyleForPainting(false) |
24 { | 24 { |
25 } | 25 } |
26 | 26 |
27 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) | 27 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) |
28 { | 28 { |
29 m_animationFramePending = false; | 29 m_animationFramePending = false; |
30 TemporaryChange<bool> servicing(m_servicingAnimations, true); | 30 TemporaryChange<bool> servicing(m_servicingAnimations, true); |
31 | 31 |
32 Vector<RefPtr<Document> > documents; | |
33 | |
32 for (RefPtr<LocalFrame> frame = m_page->mainFrame(); frame; frame = frame->t ree().traverseNext()) { | 34 for (RefPtr<LocalFrame> frame = m_page->mainFrame(); frame; frame = frame->t ree().traverseNext()) { |
33 frame->view()->serviceScrollAnimations(); | 35 frame->view()->serviceScrollAnimations(); |
36 | |
37 if (const FrameView::ScrollableAreaSet* scrollableAreas = frame->view()- >scrollableAreas()) { | |
38 for (FrameView::ScrollableAreaSet::iterator it = scrollableAreas->be gin(); it != scrollableAreas->end(); ++it) | |
39 (*it)->serviceScrollAnimations(); | |
40 } | |
41 | |
34 DocumentAnimations::updateAnimationTimingForAnimationFrame(*frame->docum ent(), monotonicAnimationStartTime); | 42 DocumentAnimations::updateAnimationTimingForAnimationFrame(*frame->docum ent(), monotonicAnimationStartTime); |
35 SVGDocumentExtensions::serviceOnAnimationFrame(*frame->document(), monot onicAnimationStartTime); | 43 SVGDocumentExtensions::serviceOnAnimationFrame(*frame->document(), monot onicAnimationStartTime); |
44 documents.append(frame->document()); | |
36 } | 45 } |
37 | 46 |
38 Vector<RefPtr<Document> > documents; | |
39 for (LocalFrame* frame = m_page->mainFrame(); frame; frame = frame->tree().t raverseNext()) | |
40 documents.append(frame->document()); | |
abarth-chromium
2014/04/14 18:52:25
Please just move this loop to the top of the funct
abarth-chromium
2014/04/14 18:52:57
By the top of the function, I mean between lines 3
| |
41 | |
42 for (size_t i = 0; i < documents.size(); ++i) | 47 for (size_t i = 0; i < documents.size(); ++i) |
43 documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); | 48 documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); |
44 | 49 |
45 // Frame callbacks might have started new players or caused existing players to become outdated. | 50 // Frame callbacks might have started new players or caused existing players to become outdated. |
46 for (size_t i = 0; i < documents.size(); ++i) | 51 for (size_t i = 0; i < documents.size(); ++i) |
47 DocumentAnimations::updateOutdatedAnimationPlayersAfterFrameCallbacks(*d ocuments[i]); | 52 DocumentAnimations::updateOutdatedAnimationPlayersAfterFrameCallbacks(*d ocuments[i]); |
48 } | 53 } |
49 | 54 |
50 void PageAnimator::scheduleVisualUpdate() | 55 void PageAnimator::scheduleVisualUpdate() |
51 { | 56 { |
(...skipping 16 matching lines...) Expand all Loading... | |
68 // setFrameRect(). This will be a quick operation for most frames, but the | 73 // setFrameRect(). This will be a quick operation for most frames, but the |
69 // NativeWindowWidgets will update a proper clipping region. | 74 // NativeWindowWidgets will update a proper clipping region. |
70 view->setFrameRect(view->frameRect()); | 75 view->setFrameRect(view->frameRect()); |
71 | 76 |
72 // setFrameRect may have the side-effect of causing existing page layout to | 77 // setFrameRect may have the side-effect of causing existing page layout to |
73 // be invalidated, so layout needs to be called last. | 78 // be invalidated, so layout needs to be called last. |
74 view->updateLayoutAndStyleForPainting(); | 79 view->updateLayoutAndStyleForPainting(); |
75 } | 80 } |
76 | 81 |
77 } | 82 } |
OLD | NEW |