Changeset 216591 in webkit
- Timestamp:
- May 10, 2017 9:50:56 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r216588 r216591 1 2017-05-10 Antti Koivisto <antti@apple.com> 2 3 REGRESSION (r207372) Visibility property is not inherited when used in an animation 4 https://bugs.webkit.org/show_bug.cgi?id=171883 5 <rdar://problem/32086550> 6 7 Reviewed by Simon Fraser. 8 9 * animations/animation-initial-inheritance-expected.html: Added. 10 * animations/animation-initial-inheritance.html: Added. 11 1 12 2017-05-10 Per Arne Vollan <pvollan@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r216586 r216591 1 2017-05-10 Antti Koivisto <antti@apple.com> 2 3 REGRESSION (r207372) Visibility property is not inherited when used in an animation 4 https://bugs.webkit.org/show_bug.cgi?id=171883 5 <rdar://problem/32086550> 6 7 Reviewed by Simon Fraser. 8 9 The problem here is that our animation code is tied to renderers. We don't have renderers during 10 the initial style resolution so animations are not applied yet. When constructing renderers we set 11 their style to the initial animated style but this step can't implement inheritance. 12 13 Normally this is invisible as the first animation frame will immediately inherit the style correctly. 14 However in this case the animation is discrete and the first frame is the same as the initial state. 15 With r207372 we optimize the descendant style change away. 16 17 This patch fixes the problem by tracking that the renderer has initial animated style and inheriting 18 it to descendants during next style resolution even if it doesn't change. 19 20 Test: animations/animation-initial-inheritance.html 21 22 * rendering/RenderElement.cpp: 23 (WebCore::RenderElement::RenderElement): 24 * rendering/RenderElement.h: 25 (WebCore::RenderElement::hasInitialAnimatedStyle): 26 (WebCore::RenderElement::setHasInitialAnimatedStyle): 27 * style/RenderTreeUpdater.cpp: 28 (WebCore::RenderTreeUpdater::createRenderer): 29 30 Set a bit on renderer indicating it has initial animated style. 31 32 * style/StyleTreeResolver.cpp: 33 (WebCore::Style::TreeResolver::createAnimatedElementUpdate): 34 35 Return at least 'Inherit' for style change when updating renderer with initial animated style. 36 1 37 2017-05-10 Myles C. Maxfield <mmaxfield@apple.com> 2 38 -
trunk/Source/WebCore/rendering/RenderElement.cpp
r216549 r216591 103 103 , m_ancestorLineBoxDirty(false) 104 104 , m_hasInitializedStyle(false) 105 , m_hasInitialAnimatedStyle(false) 105 106 , m_renderInlineAlwaysCreatesLineBoxes(false) 106 107 , m_renderBoxNeedsLazyRepaint(false) -
trunk/Source/WebCore/rendering/RenderElement.h
r216549 r216591 134 134 void setStyleInternal(RenderStyle&& style) { m_style = WTFMove(style); } 135 135 136 bool hasInitialAnimatedStyle() const { return m_hasInitialAnimatedStyle; } 137 void setHasInitialAnimatedStyle(bool b) { m_hasInitialAnimatedStyle = b; } 138 136 139 // Repaint only if our old bounds and new bounds are different. The caller may pass in newBounds and newOutlineBox if they are known. 137 140 bool repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContainer, const LayoutRect& oldBounds, const LayoutRect& oldOutlineBox, const LayoutRect* newBoundsPtr = nullptr, const LayoutRect* newOutlineBoxPtr = nullptr); … … 330 333 unsigned m_ancestorLineBoxDirty : 1; 331 334 unsigned m_hasInitializedStyle : 1; 335 unsigned m_hasInitialAnimatedStyle : 1; 332 336 333 337 unsigned m_renderInlineAlwaysCreatesLineBoxes : 1; -
trunk/Source/WebCore/style/RenderTreeUpdater.cpp
r214501 r216591 354 354 std::unique_ptr<RenderStyle> animatedStyle; 355 355 newRenderer->animation().updateAnimations(*newRenderer, initialStyle, animatedStyle); 356 if (animatedStyle) 356 if (animatedStyle) { 357 357 newRenderer->setStyleInternal(WTFMove(*animatedStyle)); 358 newRenderer->setHasInitialAnimatedStyle(true); 359 } 358 360 359 361 newRenderer->initializeStyle(); -
trunk/Source/WebCore/style/StyleTreeResolver.cpp
r214435 r216591 259 259 if (animatedStyle) { 260 260 auto change = determineChange(renderer->style(), *animatedStyle); 261 if (renderer->hasInitialAnimatedStyle()) { 262 renderer->setHasInitialAnimatedStyle(false); 263 // When we initialize a newly created renderer with initial animated style we don't inherit it to descendants. 264 // The first animation frame needs to correct this. 265 // FIXME: We should compute animated style correctly during initial style resolution when we don't have renderers yet. 266 // https://bugs.webkit.org/show_bug.cgi?id=171926 267 change = std::max(change, Inherit); 268 } 261 269 // If animation forces render tree reconstruction pass the original style. The animation will be applied on renderer construction. 262 270 // FIXME: We should always use the animated style here.
Note: See TracChangeset
for help on using the changeset viewer.