haikuwebkit/LayoutTests/webanimations/animation-page-cache-expect...

3 lines
328 B
Plaintext
Raw Permalink Normal View History

WebAnimation should never prevent entering the back/forward cache https://bugs.webkit.org/show_bug.cgi?id=203088 <rdar://problem/56374249> Patch by Antoine Quint <graouts@apple.com> on 2019-10-29 Reviewed by Antti Koivisto. Source/WebCore: Test: webanimations/animation-page-cache.html We remove the Web Animation override of the deprecated method ActiveDOMObject::shouldPreventEnteringBackForwardCache_DEPRECATED() and instead ensure event dispatch is suspended along with the WebAnimation object through the adoption of a SuspendableTaskQueue. We also ensure an animation correctly suspends itself when ActiveDOMObject::suspend() and ActiveDOMObject::resume() are called. Implementing these methods showed that we have some placeholders in DeclarativeAnimation that were not necessary, so we remove those. Finally, we no longer need to track the stopped state since the SuspendableTaskQueue will close itself when ActiveDOMObject::stop() is called. * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::stop): Deleted. (WebCore::DeclarativeAnimation::suspend): Deleted. (WebCore::DeclarativeAnimation::resume): Deleted. * animation/DeclarativeAnimation.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::WebAnimation): (WebCore::WebAnimation::enqueueAnimationPlaybackEvent): (WebCore::WebAnimation::suspend): (WebCore::WebAnimation::resume): (WebCore::WebAnimation::stop): (WebCore::WebAnimation::hasPendingActivity): (WebCore::WebAnimation::shouldPreventEnteringBackForwardCache_DEPRECATED const): Deleted. * animation/WebAnimation.h: LayoutTests: Add a new test that checks that an Animation that would run past a page's navigation is correctly suspended and resumed as it enters and leaves the back/forward cache. * webanimations/animation-page-cache-expected.txt: Added. * webanimations/animation-page-cache.html: Added. Canonical link: https://commits.webkit.org/216959@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-29 23:07:16 +00:00
This test verifies that the page cache suspends and resumes Web Animations from the page cache. The test starts an animation, then navigates away, waits a bit, navigates back, confirming that the timeline froze at a given time and resumed in the same spot, advancing the animation. If successful, it outputs 'PASS' below.
PASS.