haikuwebkit/LayoutTests/webanimations/animation-of-accelerated-pr...

70 lines
1.1 KiB
HTML
Raw Permalink Normal View History

Animations stop if new tab opened (and closed) https://bugs.webkit.org/show_bug.cgi?id=202360 <rdar://problem/55923261> Patch by Antoine Quint <graouts@apple.com> on 2019-12-18 Reviewed by Dean Jackson. Source/WebCore: In the case where we would have a fill-forwards software animation when an animation that could be accelerated started, we would fail to start an accelerated animation because we had no composited renderer. However, we would still advertise a state of "running accelerated" and the DocumentTimeline would not schedule ticks to run the animation in software. We now only schedule accelerated animations once their delay phase is over and the animation is in its "active" phase, which helps to only schedule accelerated animations once they actually have an effect that is worth accelerating, and reset pending accelerated actions in case we try to start an accelerated animation but fail to because we don't have a composited renderer. Test: webanimations/animation-of-accelerated-property-after-non-accelerated-property.html * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::apply): (WebCore::KeyframeEffect::updateAcceleratedAnimationState): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): * animation/KeyframeEffect.h: LayoutTests: Add a ref test that checks that an element with a software animation followed by an animation of a property that can be accelerated yields animations in both cases. Also, somehow, the WPT test dom/events/Event-dispatch-on-disabled-elements.html seems to now pass an extra test that would fail on iOS and now behaves like macOS, so we remove that platform-specific expectation. * platform/ios/imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements-expected.txt * webanimations/animation-of-accelerated-property-after-non-accelerated-property-expected.html: Added. * webanimations/animation-of-accelerated-property-after-non-accelerated-property.html: Added. Canonical link: https://commits.webkit.org/218619@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-19 00:30:46 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
#target {
position: absolute;
top: 0;
left: 0;
width: 100px;
height: 100px;
background-color: black;
animation: anim1 50ms forwards, anim2 5s 50ms;
}
@keyframes anim1 {
0%, 100% { background-color: red; }
50% { background-color: orange; }
}
@keyframes anim2 {
0% { transform: translateX(0) }
5%, 100% { transform: translateX(500px) }
}
body {
background-color: white;
}
#cache > div {
position: absolute;
background-color: white;
}
#cache > div:nth-of-type(1) {
top: 0;
left: 100px;
right: 0;
height: 100%;
}
#cache > div:nth-of-type(2) {
top: 100px;
left: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div id="target"></div>
<div id="cache">
<div></div>
<div></div>
</div>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
document.getElementById("target").addEventListener("animationstart", event => {
if (event.animationName == "anim2")
setTimeout(() => testRunner.notifyDone(), 100);
});
}
</script>
</body>
</html>