Title: [238229] trunk/Source/WebCore
Revision
238229
Author
[email protected]
Date
2018-11-15 07:57:14 -0800 (Thu, 15 Nov 2018)

Log Message

REGRESSION(r238090): Composited iframe contents disappear after switching tabs in Safari
https://bugs.webkit.org/show_bug.cgi?id=191673
rdar://problem/46083440

Reviewed by Antti Koivisto.

Switching tabs in Safari triggers the "setIsInWindow" code path, that detaches the layer
tree for every Frame. They get re-attached on tab show, and for subframes this involves
the triggering of a fake style recalc in the parent document via scheduleInvalidateStyleAndLayerComposition().

The style diff that's sent to RenderLayerCompositor::layerStyleChanged() as a result of that
fake style recalc is RecompositeLayer, but the code was failing to trigger the necessary
layer configuration update that gets iframe layers parented.

This stop-gap patch triggers layer config updates on every RecompositeLayer diff. A future
patch will optimize this, and add a layout test.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (238228 => 238229)


--- trunk/Source/WebCore/ChangeLog	2018-11-15 15:41:14 UTC (rev 238228)
+++ trunk/Source/WebCore/ChangeLog	2018-11-15 15:57:14 UTC (rev 238229)
@@ -1,3 +1,25 @@
+2018-11-15  Simon Fraser  <[email protected]>
+
+        REGRESSION(r238090): Composited iframe contents disappear after switching tabs in Safari
+        https://bugs.webkit.org/show_bug.cgi?id=191673
+        rdar://problem/46083440
+
+        Reviewed by Antti Koivisto.
+
+        Switching tabs in Safari triggers the "setIsInWindow" code path, that detaches the layer
+        tree for every Frame. They get re-attached on tab show, and for subframes this involves
+        the triggering of a fake style recalc in the parent document via scheduleInvalidateStyleAndLayerComposition().
+        
+        The style diff that's sent to RenderLayerCompositor::layerStyleChanged() as a result of that
+        fake style recalc is RecompositeLayer, but the code was failing to trigger the necessary
+        layer configuration update that gets iframe layers parented.
+        
+        This stop-gap patch triggers layer config updates on every RecompositeLayer diff. A future
+        patch will optimize this, and add a layout test.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::layerStyleChanged):
+
 2018-11-15  Zalan Bujtas  <[email protected]>
 
         [LFC][IFC] Skip non-inflow boxes while splitting the inline runs.

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (238228 => 238229)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2018-11-15 15:41:14 UTC (rev 238228)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2018-11-15 15:57:14 UTC (rev 238229)
@@ -1387,6 +1387,11 @@
         }
     }
 
+    // FIXME: this is necessary to get iframe layers hooked up in response to scheduleInvalidateStyleAndLayerComposition(),
+    // but we should avoid triggering config updates on every recompositeLayer.
+    if (diff == StyleDifference::RecompositeLayer)
+        layer.setNeedsCompositingConfigurationUpdate();
+
     if (diff >= StyleDifference::RecompositeLayer && oldStyle) {
         if (oldStyle->transform() != newStyle.transform()) {
             // FIXME: transform changes really need to trigger layout. See RenderElement::adjustStyleDifference().
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to