This source file includes following definitions.
- m_updatingLayoutAndStyleForPainting
- serviceScriptedAnimations
- scheduleVisualUpdate
- updateLayoutAndStyleForPainting
#include "config.h"
#include "core/page/PageAnimator.h"
#include "core/animation/DocumentAnimations.h"
#include "core/dom/Document.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/page/Chrome.h"
#include "core/page/ChromeClient.h"
#include "core/page/Page.h"
#include "core/svg/SVGDocumentExtensions.h"
namespace WebCore {
PageAnimator::PageAnimator(Page* page)
: m_page(page)
, m_animationFramePending(false)
, m_servicingAnimations(false)
, m_updatingLayoutAndStyleForPainting(false)
{
}
void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime)
{
m_animationFramePending = false;
TemporaryChange<bool> servicing(m_servicingAnimations, true);
for (RefPtr<LocalFrame> frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
frame->view()->serviceScrollAnimations();
DocumentAnimations::updateAnimationTimingForAnimationFrame(*frame->document(), monotonicAnimationStartTime);
SVGDocumentExtensions::serviceOnAnimationFrame(*frame->document(), monotonicAnimationStartTime);
}
Vector<RefPtr<Document> > documents;
for (LocalFrame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext())
documents.append(frame->document());
for (size_t i = 0; i < documents.size(); ++i)
documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime);
for (size_t i = 0; i < documents.size(); ++i)
DocumentAnimations::updateOutdatedAnimationPlayersAfterFrameCallbacks(*documents[i]);
}
void PageAnimator::scheduleVisualUpdate()
{
if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting)
return;
m_page->chrome().scheduleAnimation();
}
void PageAnimator::updateLayoutAndStyleForPainting()
{
RefPtr<FrameView> view = m_page->mainFrame()->view();
TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true);
view->setFrameRect(view->frameRect());
view->updateLayoutAndStyleForPainting();
}
}