haikuwebkit/LayoutTests/transitions/interrupted-transition-hard...

65 lines
1.3 KiB
HTML
Raw Permalink Normal View History

REGRESSION (r230574): Interrupted hardware transitions don't behave correctly https://bugs.webkit.org/show_bug.cgi?id=185299 <rdar://problem/39630230> Reviewed by Simon Fraser. Source/WebCore: In r230574, the fix for webkit.org/b/184518, we changed the processing order in GraphicsLayerCA::updateAnimations() to first process m_uncomittedAnimations and then m_animationsToProcess, so we are guaranteed animations exist before we attempt to pause or seek them. This broke interrupting and resuming hardware animations (such as an interrupted CSS Transition or an animation running in a non-visible tab) since a pause operation recorded _before_ an animation was added would be paused anyway since the animation was now first added, and then paused. The fix is simply to clear any pending AnimationProcessingAction for a newly-uncommitted animation. Test: transitions/interrupted-transition-hardware.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/GraphicsLayerCA.h: (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation): LayoutTests: Add a new test where we interrupt a transition and check that upon returning to the original value, an animated value is still used and not the initial value. This test fails prior to this patch. * transitions/interrupted-transition-hardware-expected.html: Added. * transitions/interrupted-transition-hardware.html: Added. Canonical link: https://commits.webkit.org/201139@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-16 08:27:54 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
div {
position: absolute;
left: 0;
top: 0;
height: 100px;
width: 100px;
}
#test {
background-color: red;
transition: transform calc(24 * 60 * 60s) linear;
transition-delay: calc(-12 * 60 * 60s);
transform: none;
}
#test.transitions {
transform: translateX(100px);
}
#cover {
transform: translateX(25px);
background-color: green;
}
</style>
</head>
<body>
<div id="test"></div>
<div id="cover"></div>
<script type="text/javascript">
if (window.testRunner)
testRunner.waitUntilDone();
const test = document.getElementById("test");
function waitForCompositedAnimationUpdate(callback)
{
setTimeout(callback, 500);
}
setTimeout(() => {
REGRESSION (r230574): Interrupted hardware transitions don't behave correctly https://bugs.webkit.org/show_bug.cgi?id=185299 <rdar://problem/39630230> Reviewed by Simon Fraser. Source/WebCore: In r230574, the fix for webkit.org/b/184518, we changed the processing order in GraphicsLayerCA::updateAnimations() to first process m_uncomittedAnimations and then m_animationsToProcess, so we are guaranteed animations exist before we attempt to pause or seek them. This broke interrupting and resuming hardware animations (such as an interrupted CSS Transition or an animation running in a non-visible tab) since a pause operation recorded _before_ an animation was added would be paused anyway since the animation was now first added, and then paused. The fix is simply to clear any pending AnimationProcessingAction for a newly-uncommitted animation. Test: transitions/interrupted-transition-hardware.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/GraphicsLayerCA.h: (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation): LayoutTests: Add a new test where we interrupt a transition and check that upon returning to the original value, an animated value is still used and not the initial value. This test fails prior to this patch. * transitions/interrupted-transition-hardware-expected.html: Added. * transitions/interrupted-transition-hardware.html: Added. Canonical link: https://commits.webkit.org/201139@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-16 08:27:54 +00:00
test.classList.add("transitions");
waitForCompositedAnimationUpdate(() => {
REGRESSION (r230574): Interrupted hardware transitions don't behave correctly https://bugs.webkit.org/show_bug.cgi?id=185299 <rdar://problem/39630230> Reviewed by Simon Fraser. Source/WebCore: In r230574, the fix for webkit.org/b/184518, we changed the processing order in GraphicsLayerCA::updateAnimations() to first process m_uncomittedAnimations and then m_animationsToProcess, so we are guaranteed animations exist before we attempt to pause or seek them. This broke interrupting and resuming hardware animations (such as an interrupted CSS Transition or an animation running in a non-visible tab) since a pause operation recorded _before_ an animation was added would be paused anyway since the animation was now first added, and then paused. The fix is simply to clear any pending AnimationProcessingAction for a newly-uncommitted animation. Test: transitions/interrupted-transition-hardware.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/GraphicsLayerCA.h: (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation): LayoutTests: Add a new test where we interrupt a transition and check that upon returning to the original value, an animated value is still used and not the initial value. This test fails prior to this patch. * transitions/interrupted-transition-hardware-expected.html: Added. * transitions/interrupted-transition-hardware.html: Added. Canonical link: https://commits.webkit.org/201139@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-16 08:27:54 +00:00
test.classList.remove("transitions");
waitForCompositedAnimationUpdate(() => {
if (window.testRunner)
testRunner.notifyDone();
});
REGRESSION (r230574): Interrupted hardware transitions don't behave correctly https://bugs.webkit.org/show_bug.cgi?id=185299 <rdar://problem/39630230> Reviewed by Simon Fraser. Source/WebCore: In r230574, the fix for webkit.org/b/184518, we changed the processing order in GraphicsLayerCA::updateAnimations() to first process m_uncomittedAnimations and then m_animationsToProcess, so we are guaranteed animations exist before we attempt to pause or seek them. This broke interrupting and resuming hardware animations (such as an interrupted CSS Transition or an animation running in a non-visible tab) since a pause operation recorded _before_ an animation was added would be paused anyway since the animation was now first added, and then paused. The fix is simply to clear any pending AnimationProcessingAction for a newly-uncommitted animation. Test: transitions/interrupted-transition-hardware.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/GraphicsLayerCA.h: (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation): LayoutTests: Add a new test where we interrupt a transition and check that upon returning to the original value, an animated value is still used and not the initial value. This test fails prior to this patch. * transitions/interrupted-transition-hardware-expected.html: Added. * transitions/interrupted-transition-hardware.html: Added. Canonical link: https://commits.webkit.org/201139@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-16 08:27:54 +00:00
});
});
</script>
</body>
</html>