haikuwebkit/LayoutTests/fast/animation/css-animation-resuming-when...

19 lines
684 B
Plaintext
Raw Permalink Normal View History

REGRESSION (r217997): mint.com header renders incorrectly when initially loaded https://bugs.webkit.org/show_bug.cgi?id=173302 <rdar://problem/32731747> Reviewed by Darin Adler. Source/WebCore: r217997 updated ImplicitAnimation::reset() to not call updateStateMachine(AnimationStateInput::RestartAnimation) if the compositeAnimation is suspended. If the compositeAnimation is suspended, we would call updateStateMachine(AnimationStateInput::AnimationStateInput::PlayStatePaused), which was expected to be a no-op. This was needed because otherwise, changing the style of the animated element would restart the animation even though it was supposed to be suspended. One thing I did not realize is that calling updateStateMachine(AnimationStateInput::AnimationStateInput::PlayStatePaused) on an animation that is already in PausedNew state, will cause it to move to PausedWaitResponse state. This is an issue because upon resuming we would call AnimationBase::updatePlayState(AnimPlayStatePlaying) which would return early because AnimationBase::paused() would return false. To address the issue, we no longer call updateStateMachine(PlayStatePaused) in ImplicitAnimation::reset() when the compositeAnimation is suspended, so that the animation stays in PausedNew state until we resume. When we resume, AnimationBase::paused() returns false and we actually resume the animation. Tests: fast/animation/css-animation-resuming-when-visible-with-style-change.html fast/animation/css-animation-resuming-when-visible-with-style-change2.html * page/animation/ImplicitAnimation.cpp: (WebCore::ImplicitAnimation::reset): LayoutTests: Add layout test coverage. We change the style of the animated element while the animation is paused, and then we resume the animations. * fast/animation/css-animation-resuming-when-visible-with-style-change-expected.txt: Added. * fast/animation/css-animation-resuming-when-visible-with-style-change.html: Added. * fast/animation/css-animation-resuming-when-visible-with-style-change2-expected.txt: Added. * fast/animation/css-animation-resuming-when-visible-with-style-change2.html: Added. Canonical link: https://commits.webkit.org/190233@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-14 15:40:51 +00:00
Tests that CSS animations that are created while the page is hidden are properly resumed when the page becomes visible.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS internals.animationsAreSuspended() is false
PASS internals.numberOfActiveAnimations() is 1
Suspend animations
PASS internals.animationsAreSuspended() is true
PASS internals.animationsAreSuspended() is true
PASS internals.animationsAreSuspended() is true
PASS window.getComputedStyle(testDiv).transform is pausedTransform
Resume animations...
PASS window.getComputedStyle(testDiv).transform != pausedTransform became true
PASS successfullyParsed is true
TEST COMPLETE
TEST