haikuwebkit/LayoutTests/animations/stacking-during-opacity-ani...

35 lines
586 B
HTML
Raw Permalink Normal View History

REGRESSION (r208025) GraphicsContext state stack assertions loading webkit.org https://bugs.webkit.org/show_bug.cgi?id=164350 rdar://problem/29053414 Reviewed by Dean Jackson. Source/WebCore: After r208025 it as possible for KeyframeAnimation::animate() to produce a RenderStyle with a non-1 opacity, but without the explicit z-index that triggers stacking context. This confused the RenderLayer paintWithTransparency code, triggering mismsatched GraphicsContext save/restores. This occurred when the runningOrFillingForwards state was mis-computed. keyframeAnim->animate() can spit out a new style when in the StartWaitTimer sometimes, so "!keyframeAnim->waitingToStart() && !keyframeAnim->postActive()" gave the wrong answser. Rather than depend on the super-confusing animation state, use a bool out param from animate() to say when it actually produced a new style, and when true, do the setZIndex(0). Test: animations/stacking-during-opacity-animation.html * page/animation/AnimationBase.h: * page/animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimation::blendProperties): Log after blending so the log shows the blended style. * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::animate): * page/animation/ImplicitAnimation.cpp: (WebCore::ImplicitAnimation::animate): * page/animation/ImplicitAnimation.h: * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::animate): * page/animation/KeyframeAnimation.h: * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::restore): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (PlatformCALayer::drawLayerContents): No functional change, but created scope for the GraphicsContext so that it didn't outlive the CGContextRestoreGState(context). * rendering/RenderLayer.cpp: (WebCore::RenderLayer::beginTransparencyLayers): New assertion that catches the problem earlier. LayoutTests: Test was reduced from webkit.org. * animations/stacking-during-opacity-animation-expected.txt: Added. * animations/stacking-during-opacity-animation.html: Added. Canonical link: https://commits.webkit.org/182073@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208314 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-11-03 00:19:54 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
.background-image {
position: relative;
margin-top: -1px;
height: 0;
padding-bottom: 80%;
opacity: 0.1;
}
.tile {
animation: fade-in 0.4s;
}
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
</style>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
</head>
<body>
<div class="tile">
<div class="background-image"></div>
<p>This test should not crash or assert.</p>
</div>
</body>
</html>