Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r235843 - [Web Animations] Interrupting an accelerated CSS tran…
…sition 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.
- Loading branch information
1 parent
833ca1d
commit 4e93695
Showing
6 changed files
with
86 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...ests/webanimations/accelerated-transition-interrupted-on-composited-element-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<body> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background-color: black; | ||
will-change: transform; | ||
transform: translateX(100px); | ||
} | ||
</style> | ||
<div></div> | ||
</body> |
32 changes: 32 additions & 0 deletions
32
LayoutTests/webanimations/accelerated-transition-interrupted-on-composited-element.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html><!-- webkit-test-runner [ enableWebAnimationsCSSIntegration=true ] --> | ||
<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"; | ||
if (window.testRunner) | ||
requestAnimationFrame(() => testRunner.notifyDone()); | ||
}); | ||
|
||
// Initiate a transform transition. | ||
setTimeout(() => { | ||
div.style.transition = "transform 2s"; | ||
div.style.transform = "translateX(100px)"; | ||
}); | ||
|
||
</script> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters