X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=WebCore%2Fpage%2Fanimation%2FAnimationController.cpp;h=e8e990cd185404379be395969814c4041222bbad;hb=28040489d744e0c5d475a88663056c9040ed5320;hp=b5d87e617ae205460bf141b1a70094d9a538550e;hpb=eff9be92c41913c92fb1d3b7983c071f3e718678;p=android-x86%2Fexternal-webkit.git diff --git a/WebCore/page/animation/AnimationController.cpp b/WebCore/page/animation/AnimationController.cpp index b5d87e617..e8e990cd1 100644 --- a/WebCore/page/animation/AnimationController.cpp +++ b/WebCore/page/animation/AnimationController.cpp @@ -81,7 +81,7 @@ bool AnimationControllerPrivate::clear(RenderObject* renderer) if (!animation) return false; animation->clearRenderer(); - return animation->isSuspended(); + return animation->suspended(); } void AnimationControllerPrivate::updateAnimationTimer(bool callSetChanged/* = false*/) @@ -92,7 +92,7 @@ void AnimationControllerPrivate::updateAnimationTimer(bool callSetChanged/* = fa RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end(); for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) { CompositeAnimation* compAnim = it->second.get(); - if (!compAnim->isSuspended() && compAnim->hasAnimations()) { + if (!compAnim->suspended() && compAnim->hasAnimations()) { double t = compAnim->timeToNextService(); if (t != -1 && (t < needsService || needsService == -1)) needsService = t; @@ -227,7 +227,25 @@ bool AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer(RenderO return animation->isAnimatingProperty(property, true, isRunningNow); } -void AnimationControllerPrivate::suspendAnimations(Document* document) +void AnimationControllerPrivate::suspendAnimations() +{ + suspendAnimationsForDocument(m_frame->document()); + + // Traverse subframes + for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) + child->animation()->suspendAnimations(); +} + +void AnimationControllerPrivate::resumeAnimations() +{ + resumeAnimationsForDocument(m_frame->document()); + + // Traverse subframes + for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) + child->animation()->resumeAnimations(); +} + +void AnimationControllerPrivate::suspendAnimationsForDocument(Document* document) { setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet); @@ -243,7 +261,7 @@ void AnimationControllerPrivate::suspendAnimations(Document* document) updateAnimationTimer(); } -void AnimationControllerPrivate::resumeAnimations(Document* document) +void AnimationControllerPrivate::resumeAnimationsForDocument(Document* document) { setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet); @@ -551,14 +569,24 @@ bool AnimationController::isRunningAcceleratedAnimationOnRenderer(RenderObject* return m_data->isRunningAcceleratedAnimationOnRenderer(renderer, property, isRunningNow); } -void AnimationController::suspendAnimations(Document* document) +void AnimationController::suspendAnimations() +{ + m_data->suspendAnimations(); +} + +void AnimationController::resumeAnimations() +{ + m_data->resumeAnimations(); +} + +void AnimationController::suspendAnimationsForDocument(Document* document) { - m_data->suspendAnimations(document); + m_data->suspendAnimationsForDocument(document); } -void AnimationController::resumeAnimations(Document* document) +void AnimationController::resumeAnimationsForDocument(Document* document) { - m_data->resumeAnimations(document); + m_data->resumeAnimationsForDocument(document); } void AnimationController::beginAnimationUpdate()