Remove RenderElement::isCSSAnimating boolean
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Sep 2017 15:31:41 +0000 (15:31 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Sep 2017 15:31:41 +0000 (15:31 +0000)
commit89d0e146be278ba834b22e481b9bf035a478cb5c
treee3c53255da29a81a20b9f282405c07b919c9e6ad
parent1bad048b49da7589f499e919ce76ca1bad986fd3
Remove RenderElement::isCSSAnimating boolean
https://bugs.webkit.org/show_bug.cgi?id=176779

Reviewed by Andreas Kling.

This optimization can be replaced with a simple style test that doesn't require keeping
two sources of truth in sync.

* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation):
(WebCore::CSSAnimationControllerPrivate::clear):

    Can't test here as style might have become non-animating and we don't clear animation when that happens.
    This is only called on renderer destruction so it is not an important optimization.

(WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
(WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
(WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer):
(WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
(WebCore::CSSAnimationController::cancelAnimations):
(WebCore::CSSAnimationController::getAnimatedStyleForRenderer):
(WebCore::CSSAnimationController::computeExtentOfAnimation const):
(WebCore::CSSAnimationController::isRunningAnimationOnRenderer const):
(WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer const):

    Test if the style has any animations. This is roughly equivalent of the old test.
    (it is actually somewhat better as the boolean was never cleared on style changes)

* rendering/RenderElement.cpp:
(WebCore::RenderElement::RenderElement):
* rendering/RenderElement.h:
(WebCore::RenderElement::isCSSAnimating const): Deleted.
(WebCore::RenderElement::setIsCSSAnimating): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::hasAnimationsOrTransitions const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/animation/CSSAnimationController.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderElement.h
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.h