fast/hidpi/video-controls-in-hidpi.html sometimes asserts in WK1
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 May 2019 18:26:24 +0000 (18:26 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 May 2019 18:26:24 +0000 (18:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197695

Reviewed by Zalan Bujtas.

With the backing-sharing changes that landed in r245058, some WebKit1 tests with media controls asserted in
RenderLayerBacking::computeParentGraphicsLayerRect() because a layer would have a m_ancestorClippingLayer,
but backgroundClipRect() would return an infinite rect.

This happened when a layer tree change caused the layer's compositing ancestor to no longer isolate
composited blending (which affects the behavior of RenderLayerCompositor:clippedByAncestor()), but we failed
to mark its composited children as needing the configuration update which would eliminate their m_ancestorClippingLayers.

The fix is to call setChildrenNeedCompositingGeometryUpdate() when isolatesCompositedBlending changes. We don't haev
setChildrenNeedCompositingConfigurationUpdate(), but setChildrenNeedCompositingGeometryUpdate() has the desired side-effect.

I was unable to make a standalone test case for this, but the code is exercised by media control tests.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245147 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp

index ec68d32..3d6de64 100644 (file)
@@ -1,3 +1,26 @@
+2019-05-09  Simon Fraser  <simon.fraser@apple.com>
+
+        fast/hidpi/video-controls-in-hidpi.html sometimes asserts in WK1
+        https://bugs.webkit.org/show_bug.cgi?id=197695
+
+        Reviewed by Zalan Bujtas.
+
+        With the backing-sharing changes that landed in r245058, some WebKit1 tests with media controls asserted in
+        RenderLayerBacking::computeParentGraphicsLayerRect() because a layer would have a m_ancestorClippingLayer,
+        but backgroundClipRect() would return an infinite rect.
+        
+        This happened when a layer tree change caused the layer's compositing ancestor to no longer isolate
+        composited blending (which affects the behavior of RenderLayerCompositor:clippedByAncestor()), but we failed
+        to mark its composited children as needing the configuration update which would eliminate their m_ancestorClippingLayers.
+        
+        The fix is to call setChildrenNeedCompositingGeometryUpdate() when isolatesCompositedBlending changes. We don't haev
+        setChildrenNeedCompositingConfigurationUpdate(), but setChildrenNeedCompositingGeometryUpdate() has the desired side-effect.
+
+        I was unable to make a standalone test case for this, but the code is exercised by media control tests.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+
 2019-05-09  Brent Fulgham  <bfulgham@apple.com>
 
         Correct delayed load event handling
index 0306e0c..3c6f90f 100644 (file)
@@ -955,7 +955,13 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
         addToOverlapMap(overlapMap, layer, layerExtent);
 
 #if ENABLE(CSS_COMPOSITING)
+    bool isolatedCompositedBlending = layer.isolatesCompositedBlending();
     layer.setHasNotIsolatedCompositedBlendingDescendants(childState.hasNotIsolatedCompositedBlendingDescendants);
+    if (layer.isolatesCompositedBlending() != isolatedCompositedBlending) {
+        // isolatedCompositedBlending affects the result of clippedByAncestor().
+        layer.setChildrenNeedCompositingGeometryUpdate();
+    }
+
     ASSERT(!layer.hasNotIsolatedCompositedBlendingDescendants() || layer.hasNotIsolatedBlendingDescendants());
 #endif
     // Now check for reasons to become composited that depend on the state of descendant layers.