Title: [225092] trunk
Revision
225092
Author
fred.w...@free.fr
Date
2017-11-21 23:17:09 -0800 (Tue, 21 Nov 2017)

Log Message

Async frame scrolling: handle fixed root backgrounds in frames
https://bugs.webkit.org/show_bug.cgi?id=176261

Source/WebCore:

Based on patch by Simon Fraser <simon.fra...@apple.com>
Patch by Frederic Wang <fw...@igalia.com> on 2017-11-21
Reviewed by Antonio Gomes.

For frames with tiled backing, we register a slow-repaint object because we hit
RenderElement::styleWillChange() before we've made a backing for the iframe's RenderView so
view().compositor().supportsFixedRootBackgroundCompositing() returns false. This patch
ensures that this object is removed when setBackgroundLayerPaintsFixedRootBackground is
called. It also removes the opaque background of non-main frames with tiled backing.
This fixes a possible hit of ASSERT(!m_backgroundLayer) after r221615.

Test: compositing/tiling/tiled-drawing-async-frame-scrolling.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry): Do not set opaque contents for frames with
tiled backing. We keep !m_isMainFrameRenderViewLayer for backward compatibility with WK1.
(WebCore::RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground): Add an early
return when m_backgroundLayerPaintsFixedRootBackground is not changed. Remove the slow
repaint object previously registered for this frame. Also add an ASSERT to ensure that a
fixed root background is only set for frames with async scrolling.
(WebCore::RenderLayerBacking::updateRootLayerConfiguration): Restrict some special handling
of background and opaqueness to the main frame.

LayoutTests:

Patch by Frederic Wang <fw...@igalia.com> on 2017-11-21
Reviewed by Antonio Gomes.

Extend tiled-drawing-async-frame-scrolling with new test cases and update expectations.

* compositing/tiling/tiled-drawing-async-frame-scrolling.html: Add two test cases with
non-white and fixed gradient background. The latter exhibits a crash fixed by that commit.
* compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt: Adjust expectation due
to spacing changes.
* platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt: Ditto.
Update expectation for the first case to remove the white background and add expectations for
the two new cases.
* platform/mac-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt: Ditto.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (225091 => 225092)


--- trunk/LayoutTests/ChangeLog	2017-11-22 06:54:50 UTC (rev 225091)
+++ trunk/LayoutTests/ChangeLog	2017-11-22 07:17:09 UTC (rev 225092)
@@ -1,3 +1,21 @@
+2017-11-21  Frederic Wang  <fw...@igalia.com>
+
+        Async frame scrolling: handle fixed root backgrounds in frames
+        https://bugs.webkit.org/show_bug.cgi?id=176261
+
+        Reviewed by Antonio Gomes.
+
+        Extend tiled-drawing-async-frame-scrolling with new test cases and update expectations.
+
+        * compositing/tiling/tiled-drawing-async-frame-scrolling.html: Add two test cases with
+        non-white and fixed gradient background. The latter exhibits a crash fixed by that commit.
+        * compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt: Adjust expectation due
+        to spacing changes.
+        * platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt: Ditto.
+        Update expectation for the first case to remove the white background and add expectations for
+        the two new cases.
+        * platform/mac-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt: Ditto.
+
 2017-11-21  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r225089.

Modified: trunk/LayoutTests/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt (225091 => 225092)


--- trunk/LayoutTests/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt	2017-11-22 06:54:50 UTC (rev 225091)
+++ trunk/LayoutTests/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt	2017-11-22 07:17:09 UTC (rev 225092)
@@ -1,2 +1,2 @@
+   
 
-

Modified: trunk/LayoutTests/compositing/tiling/tiled-drawing-async-frame-scrolling.html (225091 => 225092)


--- trunk/LayoutTests/compositing/tiling/tiled-drawing-async-frame-scrolling.html	2017-11-22 06:54:50 UTC (rev 225091)
+++ trunk/LayoutTests/compositing/tiling/tiled-drawing-async-frame-scrolling.html	2017-11-22 07:17:09 UTC (rev 225092)
@@ -18,10 +18,32 @@
                 testRunner.notifyDone();
             }
         }
+
+	var frameToLoadCount = 3;
+	function newFrameLoaded() {
+	    frameToLoadCount--;
+	    if (frameToLoadCount === 0)
+	        doTest();
+        }
     </script>
+    <style>
+        frame {
+            width: 200px;
+            height: 100px;
+        }
+    </style>
   </head>
   <body>
-    <iframe _onload_="setTimeout(doTest, 0)" id="frame" style="height: 100px; width: 200px;" scrolling="yes" srcdoc="&lt;div style='height: 300px; width: 400px;'&gt;&lt;/div&gt;"></iframe>
-    <pre id="layers">Layer tree goes here</p>
+    <iframe _onload_="newFrameLoaded()" scrolling="yes" srcdoc="<html style='
+            background: transparent;
+            height: 300px; width: 400px;'></html>"></iframe>
+    <iframe _onload_="newFrameLoaded()" scrolling="yes" srcdoc="<html style='
+            background: #ABCDEF;
+            height: 300px; width: 400px;'></html>"></iframe>
+    <iframe _onload_="newFrameLoaded()" scrolling="yes" srcdoc="<html style='
+            background-image: linear-gradient(45deg, black, white);
+            background-attachment: fixed;
+	    height: 300px; width: 400px;'></html>"></iframe>
+    <pre id="layers">Layer tree goes here</pre>
   </body>
 </html>

Modified: trunk/LayoutTests/platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt (225091 => 225092)


--- trunk/LayoutTests/platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt	2017-11-22 06:54:50 UTC (rev 225091)
+++ trunk/LayoutTests/platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt	2017-11-22 07:17:09 UTC (rev 225092)
@@ -1,4 +1,4 @@
-
+   
 (GraphicsLayer
   (anchor 0.00 0.00)
   (bounds 800.00 600.00)
@@ -20,13 +20,13 @@
       (tile size 800 x 600)
       (top left tile 0, 0 tiles grid 1 x 1)
       (in window 1)
-      (children 1
+      (children 3
         (GraphicsLayer
           (position 8.00 8.00)
-          (bounds 204.00 104.00)
+          (bounds 304.00 154.00)
           (drawsContent 1)
           (backingStoreAttached 1)
-          (visible rect 0.00, 0.00 204.00 x 104.00)
+          (visible rect 0.00, 0.00 304.00 x 154.00)
           (coverage rect -8.00, -8.00 800.00 x 600.00)
           (intersects coverage rect 1)
           (contentsScale 2.00)
@@ -41,10 +41,10 @@
               (children 1
                 (GraphicsLayer
                   (anchor 0.00 0.00)
-                  (bounds 200.00 100.00)
+                  (bounds 300.00 150.00)
                   (backingStoreAttached 1)
-                  (visible rect 0.00, 0.00 200.00 x 100.00)
-                  (coverage rect 0.00, 0.00 200.00 x 100.00)
+                  (visible rect 0.00, 0.00 300.00 x 150.00)
+                  (coverage rect 0.00, 0.00 300.00 x 150.00)
                   (intersects coverage rect 1)
                   (contentsScale 2.00)
                   (children 1
@@ -51,29 +51,28 @@
                     (GraphicsLayer
                       (backingStoreAttached 0)
                       (visible rect 0.00, 0.00 0.00 x 0.00)
-                      (coverage rect 0.00, 0.00 200.00 x 100.00)
+                      (coverage rect 0.00, 0.00 300.00 x 150.00)
                       (intersects coverage rect 0)
                       (contentsScale 2.00)
                       (children 1
                         (GraphicsLayer
                           (anchor 0.00 0.00)
-                          (bounds 408.00 316.00)
+                          (bounds 400.00 300.00)
                           (backingStoreAttached 1)
-                          (visible rect 0.00, 0.00 200.00 x 100.00)
-                          (coverage rect 0.00, 0.00 200.00 x 100.00)
+                          (visible rect 0.00, 0.00 300.00 x 150.00)
+                          (coverage rect 0.00, 0.00 300.00 x 150.00)
                           (intersects coverage rect 1)
                           (contentsScale 2.00)
                           (children 1
                             (GraphicsLayer
-                              (bounds 408.00 316.00)
+                              (bounds 400.00 300.00)
                               (drawsContent 1)
-                              (backgroundColor #FFFFFF)
                               (backingStoreAttached 1)
-                              (visible rect 0.00, 0.00 200.00 x 100.00)
-                              (coverage rect 0.00, 0.00 200.00 x 100.00)
+                              (visible rect 0.00, 0.00 300.00 x 150.00)
+                              (coverage rect 0.00, 0.00 300.00 x 150.00)
                               (intersects coverage rect 1)
                               (contentsScale 2.00)
-                              (tile cache coverage 0, 0 408 x 316)
+                              (tile cache coverage 0, 0 400 x 300)
                               (tile size 512 x 512)
                               (top left tile 0, 0 tiles grid 1 x 1)
                               (in window 1)
@@ -81,7 +80,7 @@
                                 (GraphicsLayer
                                   (backingStoreAttached 0)
                                   (visible rect 0.00, 0.00 0.00 x 0.00)
-                                  (coverage rect 0.00, 0.00 200.00 x 100.00)
+                                  (coverage rect 0.00, 0.00 300.00 x 150.00)
                                   (intersects coverage rect 0)
                                   (contentsScale 2.00)
                                 )
@@ -97,6 +96,156 @@
             )
           )
         )
+        (GraphicsLayer
+          (position 316.00 8.00)
+          (bounds 304.00 154.00)
+          (drawsContent 1)
+          (backingStoreAttached 1)
+          (visible rect 0.00, 0.00 304.00 x 154.00)
+          (coverage rect -316.00, -8.00 800.00 x 600.00)
+          (intersects coverage rect 1)
+          (contentsScale 2.00)
+          (children 1
+            (GraphicsLayer
+              (position 2.00 2.00)
+              (backingStoreAttached 0)
+              (visible rect 0.00, 0.00 0.00 x 0.00)
+              (coverage rect -318.00, -10.00 800.00 x 600.00)
+              (intersects coverage rect 0)
+              (contentsScale 2.00)
+              (children 1
+                (GraphicsLayer
+                  (anchor 0.00 0.00)
+                  (bounds 300.00 150.00)
+                  (backingStoreAttached 1)
+                  (visible rect 0.00, 0.00 300.00 x 150.00)
+                  (coverage rect 0.00, 0.00 300.00 x 150.00)
+                  (intersects coverage rect 1)
+                  (contentsScale 2.00)
+                  (children 1
+                    (GraphicsLayer
+                      (backingStoreAttached 0)
+                      (visible rect 0.00, 0.00 0.00 x 0.00)
+                      (coverage rect 0.00, 0.00 300.00 x 150.00)
+                      (intersects coverage rect 0)
+                      (contentsScale 2.00)
+                      (children 1
+                        (GraphicsLayer
+                          (anchor 0.00 0.00)
+                          (bounds 400.00 300.00)
+                          (backingStoreAttached 1)
+                          (visible rect 0.00, 0.00 300.00 x 150.00)
+                          (coverage rect 0.00, 0.00 300.00 x 150.00)
+                          (intersects coverage rect 1)
+                          (contentsScale 2.00)
+                          (children 1
+                            (GraphicsLayer
+                              (bounds 400.00 300.00)
+                              (drawsContent 1)
+                              (backingStoreAttached 1)
+                              (visible rect 0.00, 0.00 300.00 x 150.00)
+                              (coverage rect 0.00, 0.00 300.00 x 150.00)
+                              (intersects coverage rect 1)
+                              (contentsScale 2.00)
+                              (tile cache coverage 0, 0 400 x 300)
+                              (tile size 512 x 512)
+                              (top left tile 0, 0 tiles grid 1 x 1)
+                              (in window 1)
+                              (children 1
+                                (GraphicsLayer
+                                  (backingStoreAttached 0)
+                                  (visible rect 0.00, 0.00 0.00 x 0.00)
+                                  (coverage rect 0.00, 0.00 300.00 x 150.00)
+                                  (intersects coverage rect 0)
+                                  (contentsScale 2.00)
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 167.00)
+          (bounds 304.00 154.00)
+          (drawsContent 1)
+          (backingStoreAttached 1)
+          (visible rect 0.00, 0.00 304.00 x 154.00)
+          (coverage rect -8.00, -167.00 800.00 x 600.00)
+          (intersects coverage rect 1)
+          (contentsScale 2.00)
+          (children 1
+            (GraphicsLayer
+              (position 2.00 2.00)
+              (backingStoreAttached 0)
+              (visible rect 0.00, 0.00 0.00 x 0.00)
+              (coverage rect -10.00, -169.00 800.00 x 600.00)
+              (intersects coverage rect 0)
+              (contentsScale 2.00)
+              (children 1
+                (GraphicsLayer
+                  (anchor 0.00 0.00)
+                  (bounds 300.00 150.00)
+                  (backingStoreAttached 1)
+                  (visible rect 0.00, 0.00 300.00 x 150.00)
+                  (coverage rect 0.00, 0.00 300.00 x 150.00)
+                  (intersects coverage rect 1)
+                  (contentsScale 2.00)
+                  (children 1
+                    (GraphicsLayer
+                      (backingStoreAttached 0)
+                      (visible rect 0.00, 0.00 0.00 x 0.00)
+                      (coverage rect 0.00, 0.00 300.00 x 150.00)
+                      (intersects coverage rect 0)
+                      (contentsScale 2.00)
+                      (children 1
+                        (GraphicsLayer
+                          (anchor 0.00 0.00)
+                          (bounds 400.00 300.00)
+                          (backingStoreAttached 1)
+                          (visible rect 0.00, 0.00 300.00 x 150.00)
+                          (coverage rect 0.00, 0.00 300.00 x 150.00)
+                          (intersects coverage rect 1)
+                          (contentsScale 2.00)
+                          (children 1
+                            (GraphicsLayer
+                              (bounds 400.00 300.00)
+                              (drawsContent 1)
+                              (backingStoreAttached 1)
+                              (visible rect 0.00, 0.00 300.00 x 150.00)
+                              (coverage rect 0.00, 0.00 300.00 x 150.00)
+                              (intersects coverage rect 1)
+                              (contentsScale 2.00)
+                              (tile cache coverage 0, 0 400 x 300)
+                              (tile size 512 x 512)
+                              (top left tile 0, 0 tiles grid 1 x 1)
+                              (in window 1)
+                              (children 1
+                                (GraphicsLayer
+                                  (backingStoreAttached 0)
+                                  (visible rect 0.00, 0.00 0.00 x 0.00)
+                                  (coverage rect 0.00, 0.00 300.00 x 150.00)
+                                  (intersects coverage rect 0)
+                                  (contentsScale 2.00)
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
       )
     )
   )

Modified: trunk/LayoutTests/platform/mac-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt (225091 => 225092)


--- trunk/LayoutTests/platform/mac-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt	2017-11-22 06:54:50 UTC (rev 225091)
+++ trunk/LayoutTests/platform/mac-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt	2017-11-22 07:17:09 UTC (rev 225092)
@@ -1,4 +1,4 @@
-
+   
 (GraphicsLayer
   (anchor 0.00 0.00)
   (bounds 800.00 600.00)
@@ -20,13 +20,13 @@
       (tile size 800 x 600)
       (top left tile 0, 0 tiles grid 1 x 1)
       (in window 1)
-      (children 1
+      (children 3
         (GraphicsLayer
           (position 8.00 8.00)
-          (bounds 204.00 104.00)
+          (bounds 304.00 154.00)
           (drawsContent 1)
           (backingStoreAttached 1)
-          (visible rect 0.00, 0.00 204.00 x 104.00)
+          (visible rect 0.00, 0.00 304.00 x 154.00)
           (coverage rect -8.00, -8.00 800.00 x 600.00)
           (intersects coverage rect 1)
           (contentsScale 1.00)
@@ -41,10 +41,10 @@
               (children 4
                 (GraphicsLayer
                   (anchor 0.00 0.00)
-                  (bounds 185.00 85.00)
+                  (bounds 285.00 135.00)
                   (backingStoreAttached 1)
-                  (visible rect 0.00, 0.00 185.00 x 85.00)
-                  (coverage rect 0.00, 0.00 185.00 x 85.00)
+                  (visible rect 0.00, 0.00 285.00 x 135.00)
+                  (coverage rect 0.00, 0.00 285.00 x 135.00)
                   (intersects coverage rect 1)
                   (contentsScale 1.00)
                   (children 1
@@ -51,29 +51,28 @@
                     (GraphicsLayer
                       (backingStoreAttached 0)
                       (visible rect 0.00, 0.00 0.00 x 0.00)
-                      (coverage rect 0.00, 0.00 185.00 x 85.00)
+                      (coverage rect 0.00, 0.00 285.00 x 135.00)
                       (intersects coverage rect 0)
                       (contentsScale 1.00)
                       (children 1
                         (GraphicsLayer
                           (anchor 0.00 0.00)
-                          (bounds 408.00 316.00)
+                          (bounds 400.00 300.00)
                           (backingStoreAttached 1)
-                          (visible rect 0.00, 0.00 185.00 x 85.00)
-                          (coverage rect 0.00, 0.00 185.00 x 85.00)
+                          (visible rect 0.00, 0.00 285.00 x 135.00)
+                          (coverage rect 0.00, 0.00 285.00 x 135.00)
                           (intersects coverage rect 1)
                           (contentsScale 1.00)
                           (children 1
                             (GraphicsLayer
-                              (bounds 408.00 316.00)
+                              (bounds 400.00 300.00)
                               (drawsContent 1)
-                              (backgroundColor #FFFFFF)
                               (backingStoreAttached 1)
-                              (visible rect 0.00, 0.00 185.00 x 85.00)
-                              (coverage rect 0.00, 0.00 185.00 x 85.00)
+                              (visible rect 0.00, 0.00 285.00 x 135.00)
+                              (coverage rect 0.00, 0.00 285.00 x 135.00)
                               (intersects coverage rect 1)
                               (contentsScale 1.00)
-                              (tile cache coverage 0, 0 408 x 316)
+                              (tile cache coverage 0, 0 400 x 300)
                               (tile size 512 x 512)
                               (top left tile 0, 0 tiles grid 1 x 1)
                               (in window 1)
@@ -81,7 +80,7 @@
                                 (GraphicsLayer
                                   (backingStoreAttached 0)
                                   (visible rect 0.00, 0.00 0.00 x 0.00)
-                                  (coverage rect 0.00, 0.00 185.00 x 85.00)
+                                  (coverage rect 0.00, 0.00 285.00 x 135.00)
                                   (intersects coverage rect 0)
                                   (contentsScale 1.00)
                                 )
@@ -94,32 +93,32 @@
                   )
                 )
                 (GraphicsLayer
-                  (position 0.00 85.00)
-                  (bounds 185.00 15.00)
+                  (position 0.00 135.00)
+                  (bounds 285.00 15.00)
                   (drawsContent 1)
                   (backingStoreAttached 1)
-                  (visible rect 0.00, 0.00 185.00 x 15.00)
-                  (coverage rect -10.00, -95.00 800.00 x 600.00)
+                  (visible rect 0.00, 0.00 285.00 x 15.00)
+                  (coverage rect -10.00, -145.00 800.00 x 600.00)
                   (intersects coverage rect 1)
                   (contentsScale 1.00)
                 )
                 (GraphicsLayer
-                  (position 185.00 0.00)
-                  (bounds 15.00 85.00)
+                  (position 285.00 0.00)
+                  (bounds 15.00 135.00)
                   (drawsContent 1)
                   (backingStoreAttached 1)
-                  (visible rect 0.00, 0.00 15.00 x 85.00)
-                  (coverage rect -195.00, -10.00 800.00 x 600.00)
+                  (visible rect 0.00, 0.00 15.00 x 135.00)
+                  (coverage rect -295.00, -10.00 800.00 x 600.00)
                   (intersects coverage rect 1)
                   (contentsScale 1.00)
                 )
                 (GraphicsLayer
-                  (position 185.00 85.00)
+                  (position 285.00 135.00)
                   (bounds 15.00 15.00)
                   (drawsContent 1)
                   (backingStoreAttached 1)
                   (visible rect 0.00, 0.00 15.00 x 15.00)
-                  (coverage rect -195.00, -95.00 800.00 x 600.00)
+                  (coverage rect -295.00, -145.00 800.00 x 600.00)
                   (intersects coverage rect 1)
                   (contentsScale 1.00)
                 )
@@ -127,6 +126,236 @@
             )
           )
         )
+        (GraphicsLayer
+          (position 316.00 8.00)
+          (bounds 304.00 154.00)
+          (drawsContent 1)
+          (backingStoreAttached 1)
+          (visible rect 0.00, 0.00 304.00 x 154.00)
+          (coverage rect -316.00, -8.00 800.00 x 600.00)
+          (intersects coverage rect 1)
+          (contentsScale 1.00)
+          (children 1
+            (GraphicsLayer
+              (position 2.00 2.00)
+              (backingStoreAttached 0)
+              (visible rect 0.00, 0.00 0.00 x 0.00)
+              (coverage rect -318.00, -10.00 800.00 x 600.00)
+              (intersects coverage rect 0)
+              (contentsScale 1.00)
+              (children 4
+                (GraphicsLayer
+                  (anchor 0.00 0.00)
+                  (bounds 285.00 135.00)
+                  (backingStoreAttached 1)
+                  (visible rect 0.00, 0.00 285.00 x 135.00)
+                  (coverage rect 0.00, 0.00 285.00 x 135.00)
+                  (intersects coverage rect 1)
+                  (contentsScale 1.00)
+                  (children 1
+                    (GraphicsLayer
+                      (backingStoreAttached 0)
+                      (visible rect 0.00, 0.00 0.00 x 0.00)
+                      (coverage rect 0.00, 0.00 285.00 x 135.00)
+                      (intersects coverage rect 0)
+                      (contentsScale 1.00)
+                      (children 1
+                        (GraphicsLayer
+                          (anchor 0.00 0.00)
+                          (bounds 400.00 300.00)
+                          (backingStoreAttached 1)
+                          (visible rect 0.00, 0.00 285.00 x 135.00)
+                          (coverage rect 0.00, 0.00 285.00 x 135.00)
+                          (intersects coverage rect 1)
+                          (contentsScale 1.00)
+                          (children 1
+                            (GraphicsLayer
+                              (bounds 400.00 300.00)
+                              (drawsContent 1)
+                              (backingStoreAttached 1)
+                              (visible rect 0.00, 0.00 285.00 x 135.00)
+                              (coverage rect 0.00, 0.00 285.00 x 135.00)
+                              (intersects coverage rect 1)
+                              (contentsScale 1.00)
+                              (tile cache coverage 0, 0 400 x 300)
+                              (tile size 512 x 512)
+                              (top left tile 0, 0 tiles grid 1 x 1)
+                              (in window 1)
+                              (children 1
+                                (GraphicsLayer
+                                  (backingStoreAttached 0)
+                                  (visible rect 0.00, 0.00 0.00 x 0.00)
+                                  (coverage rect 0.00, 0.00 285.00 x 135.00)
+                                  (intersects coverage rect 0)
+                                  (contentsScale 1.00)
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+                (GraphicsLayer
+                  (position 0.00 135.00)
+                  (bounds 285.00 15.00)
+                  (drawsContent 1)
+                  (backingStoreAttached 1)
+                  (visible rect 0.00, 0.00 285.00 x 15.00)
+                  (coverage rect -318.00, -145.00 800.00 x 600.00)
+                  (intersects coverage rect 1)
+                  (contentsScale 1.00)
+                )
+                (GraphicsLayer
+                  (position 285.00 0.00)
+                  (bounds 15.00 135.00)
+                  (drawsContent 1)
+                  (backingStoreAttached 1)
+                  (visible rect 0.00, 0.00 15.00 x 135.00)
+                  (coverage rect -603.00, -10.00 800.00 x 600.00)
+                  (intersects coverage rect 1)
+                  (contentsScale 1.00)
+                )
+                (GraphicsLayer
+                  (position 285.00 135.00)
+                  (bounds 15.00 15.00)
+                  (drawsContent 1)
+                  (backingStoreAttached 1)
+                  (visible rect 0.00, 0.00 15.00 x 15.00)
+                  (coverage rect -603.00, -145.00 800.00 x 600.00)
+                  (intersects coverage rect 1)
+                  (contentsScale 1.00)
+                )
+              )
+            )
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 166.00)
+          (bounds 304.00 154.00)
+          (drawsContent 1)
+          (backingStoreAttached 1)
+          (visible rect 0.00, 0.00 304.00 x 154.00)
+          (coverage rect -8.00, -166.00 800.00 x 600.00)
+          (intersects coverage rect 1)
+          (contentsScale 1.00)
+          (children 1
+            (GraphicsLayer
+              (position 2.00 2.00)
+              (backingStoreAttached 0)
+              (visible rect 0.00, 0.00 0.00 x 0.00)
+              (coverage rect -10.00, -168.00 800.00 x 600.00)
+              (intersects coverage rect 0)
+              (contentsScale 1.00)
+              (children 4
+                (GraphicsLayer
+                  (anchor 0.00 0.00)
+                  (bounds 285.00 135.00)
+                  (backingStoreAttached 1)
+                  (visible rect 0.00, 0.00 285.00 x 135.00)
+                  (coverage rect 0.00, 0.00 285.00 x 135.00)
+                  (intersects coverage rect 1)
+                  (contentsScale 1.00)
+                  (children 1
+                    (GraphicsLayer
+                      (backingStoreAttached 0)
+                      (visible rect 0.00, 0.00 0.00 x 0.00)
+                      (coverage rect 0.00, 0.00 285.00 x 135.00)
+                      (intersects coverage rect 0)
+                      (contentsScale 1.00)
+                      (children 1
+                        (GraphicsLayer
+                          (anchor 0.00 0.00)
+                          (bounds 400.00 300.00)
+                          (backingStoreAttached 1)
+                          (visible rect 0.00, 0.00 285.00 x 135.00)
+                          (coverage rect 0.00, 0.00 285.00 x 135.00)
+                          (intersects coverage rect 1)
+                          (contentsScale 1.00)
+                          (children 1
+                            (GraphicsLayer
+                              (bounds 400.00 300.00)
+                              (backingStoreAttached 1)
+                              (visible rect 0.00, 0.00 285.00 x 135.00)
+                              (coverage rect 0.00, 0.00 285.00 x 135.00)
+                              (intersects coverage rect 1)
+                              (contentsScale 1.00)
+                              (children 2
+                                (GraphicsLayer
+                                  (anchor 0.00 0.00)
+                                  (bounds 285.00 135.00)
+                                  (drawsContent 1)
+                                  (backingStoreAttached 1)
+                                  (visible rect 0.00, 0.00 285.00 x 135.00)
+                                  (coverage rect 0.00, 0.00 285.00 x 135.00)
+                                  (intersects coverage rect 1)
+                                  (contentsScale 1.00)
+                                )
+                                (GraphicsLayer
+                                  (bounds 400.00 300.00)
+                                  (drawsContent 1)
+                                  (backingStoreAttached 1)
+                                  (visible rect 0.00, 0.00 285.00 x 135.00)
+                                  (coverage rect 0.00, 0.00 285.00 x 135.00)
+                                  (intersects coverage rect 1)
+                                  (contentsScale 1.00)
+                                  (tile cache coverage 0, 0 400 x 300)
+                                  (tile size 512 x 512)
+                                  (top left tile 0, 0 tiles grid 1 x 1)
+                                  (in window 1)
+                                  (children 1
+                                    (GraphicsLayer
+                                      (backingStoreAttached 0)
+                                      (visible rect 0.00, 0.00 0.00 x 0.00)
+                                      (coverage rect 0.00, 0.00 285.00 x 135.00)
+                                      (intersects coverage rect 0)
+                                      (contentsScale 1.00)
+                                    )
+                                  )
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+                (GraphicsLayer
+                  (position 0.00 135.00)
+                  (bounds 285.00 15.00)
+                  (drawsContent 1)
+                  (backingStoreAttached 1)
+                  (visible rect 0.00, 0.00 285.00 x 15.00)
+                  (coverage rect -10.00, -303.00 800.00 x 600.00)
+                  (intersects coverage rect 1)
+                  (contentsScale 1.00)
+                )
+                (GraphicsLayer
+                  (position 285.00 0.00)
+                  (bounds 15.00 135.00)
+                  (drawsContent 1)
+                  (backingStoreAttached 1)
+                  (visible rect 0.00, 0.00 15.00 x 135.00)
+                  (coverage rect -295.00, -168.00 800.00 x 600.00)
+                  (intersects coverage rect 1)
+                  (contentsScale 1.00)
+                )
+                (GraphicsLayer
+                  (position 285.00 135.00)
+                  (bounds 15.00 15.00)
+                  (drawsContent 1)
+                  (backingStoreAttached 1)
+                  (visible rect 0.00, 0.00 15.00 x 15.00)
+                  (coverage rect -295.00, -303.00 800.00 x 600.00)
+                  (intersects coverage rect 1)
+                  (contentsScale 1.00)
+                )
+              )
+            )
+          )
+        )
       )
     )
   )

Modified: trunk/Source/WebCore/ChangeLog (225091 => 225092)


--- trunk/Source/WebCore/ChangeLog	2017-11-22 06:54:50 UTC (rev 225091)
+++ trunk/Source/WebCore/ChangeLog	2017-11-22 07:17:09 UTC (rev 225092)
@@ -1,3 +1,30 @@
+2017-11-21  Frederic Wang  <fw...@igalia.com>
+
+        Async frame scrolling: handle fixed root backgrounds in frames
+        https://bugs.webkit.org/show_bug.cgi?id=176261
+
+        Based on patch by Simon Fraser <simon.fra...@apple.com>
+        Reviewed by Antonio Gomes.
+
+        For frames with tiled backing, we register a slow-repaint object because we hit
+        RenderElement::styleWillChange() before we've made a backing for the iframe's RenderView so
+        view().compositor().supportsFixedRootBackgroundCompositing() returns false. This patch
+        ensures that this object is removed when setBackgroundLayerPaintsFixedRootBackground is
+        called. It also removes the opaque background of non-main frames with tiled backing.
+        This fixes a possible hit of ASSERT(!m_backgroundLayer) after r221615.
+
+        Test: compositing/tiling/tiled-drawing-async-frame-scrolling.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateGeometry): Do not set opaque contents for frames with
+        tiled backing. We keep !m_isMainFrameRenderViewLayer for backward compatibility with WK1.
+        (WebCore::RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground): Add an early
+        return when m_backgroundLayerPaintsFixedRootBackground is not changed. Remove the slow
+        repaint object previously registered for this frame. Also add an ASSERT to ensure that a
+        fixed root background is only set for frames with async scrolling.
+        (WebCore::RenderLayerBacking::updateRootLayerConfiguration): Restrict some special handling
+        of background and opaqueness to the main frame.
+
 2017-11-21  Zan Dobersek  <zdober...@igalia.com>
 
         Drop ENABLE_IMAGE_DECODER_DOWN_SAMPLING code

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (225091 => 225092)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2017-11-22 06:54:50 UTC (rev 225091)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2017-11-22 07:17:09 UTC (rev 225092)
@@ -1019,7 +1019,7 @@
         positionOverflowControlsLayers();
     }
 
-    if (!m_isMainFrameRenderViewLayer) {
+    if (!m_isMainFrameRenderViewLayer && !m_isFrameLayerWithTiledBacking) {
         // For non-root layers, background is always painted by the primary graphics layer.
         ASSERT(!m_backgroundLayer);
         // Subpixel offset from graphics layer or size changed.
@@ -1421,7 +1421,15 @@
 
 void RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground(bool backgroundLayerPaintsFixedRootBackground)
 {
+    if (backgroundLayerPaintsFixedRootBackground == m_backgroundLayerPaintsFixedRootBackground)
+        return;
+
     m_backgroundLayerPaintsFixedRootBackground = backgroundLayerPaintsFixedRootBackground;
+
+    if (m_backgroundLayerPaintsFixedRootBackground) {
+        ASSERT(m_isFrameLayerWithTiledBacking);
+        renderer().view().frameView().removeSlowRepaintObject(*renderer().view().rendererForRootBackground());
+    }
 }
 
 bool RenderLayerBacking::requiresHorizontalScrollbarLayer() const
@@ -1923,12 +1931,14 @@
     bool viewIsTransparent = compositor().viewHasTransparentBackground(&backgroundColor);
 
     if (m_backgroundLayerPaintsFixedRootBackground && m_backgroundLayer) {
-        m_backgroundLayer->setBackgroundColor(backgroundColor);
-        m_backgroundLayer->setContentsOpaque(!viewIsTransparent);
+        if (m_isMainFrameRenderViewLayer) {
+            m_backgroundLayer->setBackgroundColor(backgroundColor);
+            m_backgroundLayer->setContentsOpaque(!viewIsTransparent);
+        }
 
         m_graphicsLayer->setBackgroundColor(Color());
         m_graphicsLayer->setContentsOpaque(false);
-    } else {
+    } else if (m_isMainFrameRenderViewLayer) {
         m_graphicsLayer->setBackgroundColor(backgroundColor);
         m_graphicsLayer->setContentsOpaque(!viewIsTransparent);
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to