Chromium Code Reviews| 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 for (RefPtr<LocalFrame> frame = m_page->mainFrame(); frame; frame = frame->t ree().traverseNext()) | |
| 34 documents.append(frame->document()); | |
|
weiliangc
2014/04/14 19:04:32
Like this?
abarth-chromium
2014/04/14 20:15:34
Yes, thank you.
| |
| 35 | |
| 32 for (RefPtr<LocalFrame> frame = m_page->mainFrame(); frame; frame = frame->t ree().traverseNext()) { | 36 for (RefPtr<LocalFrame> frame = m_page->mainFrame(); frame; frame = frame->t ree().traverseNext()) { |
|
abarth-chromium
2014/04/14 20:15:34
Please iterate the documents collection instead of
weiliangc
2014/04/14 20:29:38
I need to use FrameViews. as long as document->fra
| |
| 33 frame->view()->serviceScrollAnimations(); | 37 frame->view()->serviceScrollAnimations(); |
| 34 DocumentAnimations::updateAnimationTimingForAnimationFrame(*frame->docum ent(), monotonicAnimationStartTime); | 38 |
| 35 SVGDocumentExtensions::serviceOnAnimationFrame(*frame->document(), monot onicAnimationStartTime); | 39 if (const FrameView::ScrollableAreaSet* scrollableAreas = frame->view()- >scrollableAreas()) { |
| 40 for (FrameView::ScrollableAreaSet::iterator it = scrollableAreas->be gin(); it != scrollableAreas->end(); ++it) | |
| 41 (*it)->serviceScrollAnimations(); | |
| 42 } | |
| 36 } | 43 } |
| 37 | 44 |
| 38 Vector<RefPtr<Document> > documents; | 45 for (size_t i = 0; i < documents.size(); ++i) { |
| 39 for (LocalFrame* frame = m_page->mainFrame(); frame; frame = frame->tree().t raverseNext()) | 46 DocumentAnimations::updateAnimationTimingForAnimationFrame(*documents[i] , monotonicAnimationStartTime); |
| 40 documents.append(frame->document()); | 47 SVGDocumentExtensions::serviceOnAnimationFrame(*documents[i], monotonicA nimationStartTime); |
| 48 } | |
| 41 | 49 |
| 42 for (size_t i = 0; i < documents.size(); ++i) | 50 for (size_t i = 0; i < documents.size(); ++i) |
| 43 documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); | 51 documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); |
| 44 | 52 |
| 45 // Frame callbacks might have started new players or caused existing players to become outdated. | 53 // Frame callbacks might have started new players or caused existing players to become outdated. |
| 46 for (size_t i = 0; i < documents.size(); ++i) | 54 for (size_t i = 0; i < documents.size(); ++i) |
| 47 DocumentAnimations::updateOutdatedAnimationPlayersAfterFrameCallbacks(*d ocuments[i]); | 55 DocumentAnimations::updateOutdatedAnimationPlayersAfterFrameCallbacks(*d ocuments[i]); |
| 48 } | 56 } |
| 49 | 57 |
| 50 void PageAnimator::scheduleVisualUpdate() | 58 void PageAnimator::scheduleVisualUpdate() |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 68 // setFrameRect(). This will be a quick operation for most frames, but the | 76 // setFrameRect(). This will be a quick operation for most frames, but the |
| 69 // NativeWindowWidgets will update a proper clipping region. | 77 // NativeWindowWidgets will update a proper clipping region. |
| 70 view->setFrameRect(view->frameRect()); | 78 view->setFrameRect(view->frameRect()); |
| 71 | 79 |
| 72 // setFrameRect may have the side-effect of causing existing page layout to | 80 // setFrameRect may have the side-effect of causing existing page layout to |
| 73 // be invalidated, so layout needs to be called last. | 81 // be invalidated, so layout needs to be called last. |
| 74 view->updateLayoutAndStyleForPainting(); | 82 view->updateLayoutAndStyleForPainting(); |
| 75 } | 83 } |
| 76 | 84 |
| 77 } | 85 } |
| OLD | NEW |