haikuwebkit/LayoutTests/animations/animation-initial-inheritan...

24 lines
342 B
HTML
Raw Permalink Normal View History

REGRESSION (r207372) Visibility property is not inherited when used in an animation https://bugs.webkit.org/show_bug.cgi?id=171883 <rdar://problem/32086550> Reviewed by Simon Fraser. Source/WebCore: The problem here is that our animation code is tied to renderers. We don't have renderers during the initial style resolution so animations are not applied yet. When constructing renderers we set their style to the initial animated style but this step can't implement inheritance. Normally this is invisible as the first animation frame will immediately inherit the style correctly. However in this case the animation is discrete and the first frame is the same as the initial state. With r207372 we optimize the descendant style change away. This patch fixes the problem by tracking that the renderer has initial animated style and inheriting it to descendants during next style resolution even if it doesn't change. Test: animations/animation-initial-inheritance.html * rendering/RenderElement.cpp: (WebCore::RenderElement::RenderElement): * rendering/RenderElement.h: (WebCore::RenderElement::hasInitialAnimatedStyle): (WebCore::RenderElement::setHasInitialAnimatedStyle): * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::createRenderer): Set a bit on renderer indicating it has initial animated style. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): Return at least 'Inherit' for style change when updating renderer with initial animated style. LayoutTests: * animations/animation-initial-inheritance-expected.html: Added. * animations/animation-initial-inheritance.html: Added. Canonical link: https://commits.webkit.org/188870@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-10 22:23:11 +00:00
<!doctype html>
<html>
<head>
<style>
#test1 {
visibility: hidden;
}
#test2 {
color: green;
}
</style>
</head>
<body>
<div id=test1>
This shouldn't be initially visible
<div>This shouldn't be initially visible</div>
</div>
<div id=test2>
This should be initially green
<div>This should be initially green</div>
</div>
</body>
</html>