haikuwebkit/LayoutTests/animations/stacking-context-fill-forwa...

63 lines
1.4 KiB
HTML
Raw Permalink Normal View History

If an animation's keyframes affect stacking context properties, create stacking context while the animation is running https://bugs.webkit.org/show_bug.cgi?id=164094 Reviewed by Dean Jackson. Source/WebCore: The CSS animations spec <https://drafts.csswg.org/css-animations-1/> now makes it clear that a keyframe animation animating properties which can affect stacking context should establish stacking context while it's running, or filling-forwards. This is part of the "the user agent must act as if the will-change property...includes all the properties animated by the animation" clause. Implement by having CompositeAnimation::animate() track whether running animations should create stacking context, replacing existing code in AnimationController::updateAnimations() which only looked at opacity and transform. Transitions are also checked to see if they need to trigger stacking context. This allows for the removal of a 0.9999 hack when blending opacity. Tests: animations/stacking-context-fill-forwards.html animations/stacking-context-not-fill-forwards.html animations/stacking-context-unchanged-while-running.html * page/animation/AnimationController.cpp: (WebCore::AnimationController::updateAnimations): * page/animation/CSSPropertyAnimation.cpp: * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::animate): * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::KeyframeAnimation): (WebCore::KeyframeAnimation::computeStackingContextImpact): (WebCore::KeyframeAnimation::animate): * page/animation/KeyframeAnimation.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::currentTransform): * rendering/style/WillChangeData.cpp: (WebCore::WillChangeData::propertyCreatesStackingContext): (WebCore::propertyCreatesStackingContext): Deleted. * rendering/style/WillChangeData.h: LayoutTests: * animations/stacking-context-fill-forwards-expected.html: Added. * animations/stacking-context-fill-forwards.html: Added. * animations/stacking-context-not-fill-forwards-expected.html: Added. * animations/stacking-context-not-fill-forwards.html: Added. * animations/stacking-context-unchanged-while-running-expected.html: Added. * animations/stacking-context-unchanged-while-running.html: Added. Canonical link: https://commits.webkit.org/181812@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208025 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-28 03:20:32 +00:00
<!DOCTYPE html>
<html>
<head>
<title>Tests that a fill-forwards animation causes stacking context when finished.</title>
<style>
.box {
position: absolute;
top: 0;
left: 0;
height: 100px;
width: 100px;
}
#animating {
animation: move 0.1s 1 forwards;
background-color: orange;
}
@keyframes move {
from { transform: translateX(400px); }
to { transform: none }
}
.behind {
background-color: blue;
top: 50px;
left: 50px;
z-index: 1;
}
.front {
top: 25px;
left: 25px;
background-color: green;
z-index: 2;
}
</style>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
window.addEventListener('load', function() {
document.getElementById('animating').addEventListener('animationend', function() {
// Wait until filling forwards.
window.setTimeout(function() {
if (window.testRunner)
testRunner.notifyDone();
}, 0);
})
}, false);
</script>
</head>
<body>
<div class="behind box"></div>
<div id="animating" class="box">
<div class="front box"></div>
</div>
</body>
</html>