Title: [225983] trunk/Source/WebCore
Revision
225983
Author
simon.fra...@apple.com
Date
2017-12-15 13:18:59 -0800 (Fri, 15 Dec 2017)

Log Message

Elements animated on-screen are missing sometimes
https://bugs.webkit.org/show_bug.cgi?id=180773
rdar://problem/34923438

Reviewed by Zalan Bujtas.

After r225310 it was still possible for elements to be missing backing store when brought
on-screen via an animation. This occurred if a child element was outside the bounds of the
element being animated.

Fix by making sure that GraphicsLayer's "animatedExtent" took composited child layers into account.

As for r225310, no test because this is timing sensitive and hard to reliably make a test for.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (225982 => 225983)


--- trunk/Source/WebCore/ChangeLog	2017-12-15 21:15:17 UTC (rev 225982)
+++ trunk/Source/WebCore/ChangeLog	2017-12-15 21:18:59 UTC (rev 225983)
@@ -1,3 +1,25 @@
+2017-12-15  Simon Fraser  <simon.fra...@apple.com>
+
+        Elements animated on-screen are missing sometimes
+        https://bugs.webkit.org/show_bug.cgi?id=180773
+        rdar://problem/34923438
+
+        Reviewed by Zalan Bujtas.
+        
+        After r225310 it was still possible for elements to be missing backing store when brought
+        on-screen via an animation. This occurred if a child element was outside the bounds of the
+        element being animated.
+
+        Fix by making sure that GraphicsLayer's "animatedExtent" took composited child layers into account.
+
+        As for r225310, no test because this is timing sensitive and hard to reliably make a test for.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateClipRects const):
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateGeometry):
+
 2017-12-15  Chris Dumez  <cdu...@apple.com>
 
         imported/w3c/web-platform-tests/service-workers/service-worker/update.https.html is sometimes crashing in Debug builds

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (225982 => 225983)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2017-12-15 21:15:17 UTC (rev 225982)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2017-12-15 21:18:59 UTC (rev 225983)
@@ -5821,10 +5821,10 @@
     return result;
 }
 
-bool RenderLayer::getOverlapBoundsIncludingChildrenAccountingForTransformAnimations(LayoutRect& bounds) const
+bool RenderLayer::getOverlapBoundsIncludingChildrenAccountingForTransformAnimations(LayoutRect& bounds, CalculateLayerBoundsFlags additionalFlags) const
 {
     // The animation will override the display transform, so don't include it.
-    CalculateLayerBoundsFlags boundsFlags = DefaultCalculateLayerBoundsFlags & ~IncludeSelfTransform;
+    CalculateLayerBoundsFlags boundsFlags = additionalFlags | (DefaultCalculateLayerBoundsFlags & ~IncludeSelfTransform);
     
     bounds = calculateLayerBounds(this, LayoutSize(), boundsFlags);
     

Modified: trunk/Source/WebCore/rendering/RenderLayer.h (225982 => 225983)


--- trunk/Source/WebCore/rendering/RenderLayer.h	2017-12-15 21:15:17 UTC (rev 225982)
+++ trunk/Source/WebCore/rendering/RenderLayer.h	2017-12-15 21:18:59 UTC (rev 225983)
@@ -569,7 +569,7 @@
     
     // Takes transform animations into account, returning true if they could be cheaply computed.
     // Unlike overlapBounds, these bounds include descendant layers.
-    bool getOverlapBoundsIncludingChildrenAccountingForTransformAnimations(LayoutRect&) const;
+    bool getOverlapBoundsIncludingChildrenAccountingForTransformAnimations(LayoutRect&, CalculateLayerBoundsFlags additionalFlags = 0) const;
 
     // If true, this layer's children are included in its bounds for overlap testing.
     // We can't rely on the children's positions if this layer has a filter that could have moved the children's pixels around.

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (225982 => 225983)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2017-12-15 21:15:17 UTC (rev 225982)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2017-12-15 21:18:59 UTC (rev 225983)
@@ -985,7 +985,7 @@
 
     auto computeAnimationExtent = [&] () -> std::optional<FloatRect> {
         LayoutRect animatedBounds;
-        if (isRunningAcceleratedTransformAnimation && m_owningLayer.getOverlapBoundsIncludingChildrenAccountingForTransformAnimations(animatedBounds))
+        if (isRunningAcceleratedTransformAnimation && m_owningLayer.getOverlapBoundsIncludingChildrenAccountingForTransformAnimations(animatedBounds, RenderLayer::IncludeCompositedDescendants))
             return FloatRect(animatedBounds);
         return { };
     };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to