haikuwebkit/LayoutTests/webanimations/accelerated-transition-inte...

42 lines
991 B
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
[Web Animations] Interrupting an accelerated CSS transition on a composited element in flight fails https://bugs.webkit.org/show_bug.cgi?id=189405 <rdar://problem/43342639> Reviewed by Simon Fraser. Source/WebCore: Test: webanimations/accelerated-transition-interrupted-on-composited-element.html If we interrupt an animation on an element that is composited also outside of the duration of the animation, the "stop" accelerated action would fail to be performed because we no longer had a resolved current time and the accelerated animation applied to the layer would never be removed. However, having a resolved current time is not necessary to stop an animation, only for the other types of actions (play, pause and seek). So we now simply default to a 0s time for an unresolved current time for a simple fix to this issue. * animation/KeyframeEffectReadOnly.cpp: (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): LayoutTests: Add a new test that checks that interrupting a CSS transition targeting an accelerated property for an element that is composited outside the duration of the transition correctly interrupts the animation and jumps straight to the target value. * platform/win/TestExpectations: * webanimations/accelerated-transition-interrupted-on-composited-element-expected.html: Added. * webanimations/accelerated-transition-interrupted-on-composited-element.html: Added. Canonical link: https://commits.webkit.org/204429@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235843 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-10 07:13:19 +00:00
<body>
<style>
div {
width: 100px;
height: 100px;
background-color: black;
will-change: transform;
}
</style>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
const div = document.body.appendChild(document.createElement("div"));
// Wait for a transition to start and abort it.
div.addEventListener("transitionstart", event => {
div.style.transition = "none";
});
// When notified the transition was aborted, finish the test once we've ensured that animations
// have been updated (one rAF) and that accelerated animations will have been committed (two rAFs).
div.addEventListener("transitioncancel", event => {
if (window.testRunner) {
requestAnimationFrame(() => {
requestAnimationFrame(() => testRunner.notifyDone());
});
}
});
[Web Animations] Interrupting an accelerated CSS transition on a composited element in flight fails https://bugs.webkit.org/show_bug.cgi?id=189405 <rdar://problem/43342639> Reviewed by Simon Fraser. Source/WebCore: Test: webanimations/accelerated-transition-interrupted-on-composited-element.html If we interrupt an animation on an element that is composited also outside of the duration of the animation, the "stop" accelerated action would fail to be performed because we no longer had a resolved current time and the accelerated animation applied to the layer would never be removed. However, having a resolved current time is not necessary to stop an animation, only for the other types of actions (play, pause and seek). So we now simply default to a 0s time for an unresolved current time for a simple fix to this issue. * animation/KeyframeEffectReadOnly.cpp: (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): LayoutTests: Add a new test that checks that interrupting a CSS transition targeting an accelerated property for an element that is composited outside the duration of the transition correctly interrupts the animation and jumps straight to the target value. * platform/win/TestExpectations: * webanimations/accelerated-transition-interrupted-on-composited-element-expected.html: Added. * webanimations/accelerated-transition-interrupted-on-composited-element.html: Added. Canonical link: https://commits.webkit.org/204429@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235843 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-10 07:13:19 +00:00
// Initiate a transform transition.
setTimeout(() => {
div.style.transition = "transform 2s";
div.style.transform = "translateX(100px)";
});
</script>
</body>