Title: [213812] releases/WebKitGTK/webkit-2.16
Revision
213812
Author
[email protected]
Date
2017-03-13 03:40:05 -0700 (Mon, 13 Mar 2017)

Log Message

Merge r213440 - Avoid backing store for layers with empty text nodes in a few more cases
https://bugs.webkit.org/show_bug.cgi?id=169185

Reviewed by Dan Bernstein.

Source/WebCore:

In hasPaintingNonLayerDescendants() we can check whether the RenderText's linesBoundingBox()
is empty to avoid backing store in a few more cases. Also use containsOnlyWhitespace() rather
than isAllCollapsibleWhitespace(), because there's no need for backing store for non-selectable
whitespace text.

Covered by existing tests.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):

LayoutTests:

inline-block-no-backing.html enhanced to have a layer with non-collapsible whitespace (an  ).

Rebaselined other tests.

* compositing/backing/inline-block-no-backing-expected.txt:
* compositing/backing/inline-block-no-backing.html:
* compositing/iframes/page-cache-layer-tree-expected.txt:
* css3/blending/blend-mode-clip-accelerated-blending-canvas-expected.txt:
* platform/ios-simulator-wk2/compositing/backing/inline-block-no-backing-expected.txt:
* platform/ios-simulator-wk2/compositing/iframes/page-cache-layer-tree-expected.txt:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog (213811 => 213812)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog	2017-03-13 10:38:43 UTC (rev 213811)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog	2017-03-13 10:40:05 UTC (rev 213812)
@@ -1,3 +1,21 @@
+2017-03-05  Simon Fraser  <[email protected]>
+
+        Avoid backing store for layers with empty text nodes in a few more cases
+        https://bugs.webkit.org/show_bug.cgi?id=169185
+
+        Reviewed by Dan Bernstein.
+
+        inline-block-no-backing.html enhanced to have a layer with non-collapsible whitespace (an &nbsp;).
+
+        Rebaselined other tests.
+
+        * compositing/backing/inline-block-no-backing-expected.txt:
+        * compositing/backing/inline-block-no-backing.html:
+        * compositing/iframes/page-cache-layer-tree-expected.txt:
+        * css3/blending/blend-mode-clip-accelerated-blending-canvas-expected.txt:
+        * platform/ios-simulator-wk2/compositing/backing/inline-block-no-backing-expected.txt:
+        * platform/ios-simulator-wk2/compositing/iframes/page-cache-layer-tree-expected.txt:
+
 2017-03-05  Chris Dumez  <[email protected]>
 
         Using <form> in <template> causes following <form> to get swallowed

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/compositing/backing/inline-block-no-backing-expected.txt (213811 => 213812)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/compositing/backing/inline-block-no-backing-expected.txt	2017-03-13 10:38:43 UTC (rev 213811)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/compositing/backing/inline-block-no-backing-expected.txt	2017-03-13 10:40:05 UTC (rev 213812)
@@ -1,4 +1,4 @@
-      
 
  (GraphicsLayer
   (anchor 0.00 0.00)
@@ -7,7 +7,7 @@
     (GraphicsLayer
       (bounds 800.00 600.00)
       (contentsOpaque 1)
-      (children 3
+      (children 4
         (GraphicsLayer
           (position 18.00 18.00)
           (bounds 160.00 320.00)
@@ -14,7 +14,7 @@
           (drawsContent 1)
           (children 2
             (GraphicsLayer
-              (position 10.00 10.00)
+              (position 18.00 10.00)
               (bounds 120.00 120.00)
             )
             (GraphicsLayer
@@ -51,6 +51,20 @@
             )
           )
         )
+        (GraphicsLayer
+          (position 570.00 18.00)
+          (bounds 160.00 320.00)
+          (children 2
+            (GraphicsLayer
+              (position 10.00 10.00)
+              (bounds 120.00 120.00)
+            )
+            (GraphicsLayer
+              (position 10.00 154.00)
+              (bounds 120.00 120.00)
+            )
+          )
+        )
       )
     )
   )

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/compositing/backing/inline-block-no-backing.html (213811 => 213812)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/compositing/backing/inline-block-no-backing.html	2017-03-13 10:38:43 UTC (rev 213811)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/compositing/backing/inline-block-no-backing.html	2017-03-13 10:40:05 UTC (rev 213812)
@@ -42,6 +42,10 @@
     </script>
 </head>
 <body>
+    <div class="composited container">&nbsp;
+        <img class="composited child" src=""
+        <img class="composited child" src=""
+    </div>
     <div class="composited container">
         <img class="composited child" src=""
         <img class="composited child" src=""

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/compositing/iframes/page-cache-layer-tree-expected.txt (213811 => 213812)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/compositing/iframes/page-cache-layer-tree-expected.txt	2017-03-13 10:38:43 UTC (rev 213811)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/compositing/iframes/page-cache-layer-tree-expected.txt	2017-03-13 10:40:05 UTC (rev 213812)
@@ -61,7 +61,6 @@
         (GraphicsLayer
           (position 8.00 274.00)
           (bounds 784.00 224.00)
-          (drawsContent 1)
           (children 1
             (GraphicsLayer
               (position -8.00 -8.00)

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/css3/blending/blend-mode-clip-accelerated-blending-canvas-expected.txt (213811 => 213812)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/css3/blending/blend-mode-clip-accelerated-blending-canvas-expected.txt	2017-03-13 10:38:43 UTC (rev 213811)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/css3/blending/blend-mode-clip-accelerated-blending-canvas-expected.txt	2017-03-13 10:40:05 UTC (rev 213812)
@@ -10,7 +10,6 @@
           (position 8.00 8.00)
           (bounds 100.00 100.00)
           (contentsOpaque 1)
-          (drawsContent 1)
           (children 1
             (GraphicsLayer
               (bounds 100.00 100.00)

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/platform/ios-simulator-wk2/compositing/backing/inline-block-no-backing-expected.txt (213811 => 213812)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/platform/ios-simulator-wk2/compositing/backing/inline-block-no-backing-expected.txt	2017-03-13 10:38:43 UTC (rev 213811)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/platform/ios-simulator-wk2/compositing/backing/inline-block-no-backing-expected.txt	2017-03-13 10:40:05 UTC (rev 213812)
@@ -1,4 +1,4 @@
-      
 
  (GraphicsLayer
   (anchor 0.00 0.00)
@@ -7,7 +7,7 @@
     (GraphicsLayer
       (bounds 800.00 600.00)
       (contentsOpaque 1)
-      (children 3
+      (children 4
         (GraphicsLayer
           (position 18.00 18.00)
           (bounds 160.00 320.00)
@@ -14,7 +14,7 @@
           (drawsContent 1)
           (children 2
             (GraphicsLayer
-              (position 10.00 10.00)
+              (position 18.00 10.00)
               (bounds 120.00 120.00)
               (drawsContent 1)
             )
@@ -57,6 +57,22 @@
             )
           )
         )
+        (GraphicsLayer
+          (position 570.00 18.00)
+          (bounds 160.00 320.00)
+          (children 2
+            (GraphicsLayer
+              (position 10.00 10.00)
+              (bounds 120.00 120.00)
+              (drawsContent 1)
+            )
+            (GraphicsLayer
+              (position 10.00 155.00)
+              (bounds 120.00 120.00)
+              (drawsContent 1)
+            )
+          )
+        )
       )
     )
   )

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/platform/ios-simulator-wk2/compositing/iframes/page-cache-layer-tree-expected.txt (213811 => 213812)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/platform/ios-simulator-wk2/compositing/iframes/page-cache-layer-tree-expected.txt	2017-03-13 10:38:43 UTC (rev 213811)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/platform/ios-simulator-wk2/compositing/iframes/page-cache-layer-tree-expected.txt	2017-03-13 10:40:05 UTC (rev 213812)
@@ -61,7 +61,6 @@
         (GraphicsLayer
           (position 8.00 277.00)
           (bounds 784.00 225.00)
-          (drawsContent 1)
           (children 1
             (GraphicsLayer
               (position -8.00 -8.00)

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog (213811 => 213812)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog	2017-03-13 10:38:43 UTC (rev 213811)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog	2017-03-13 10:40:05 UTC (rev 213812)
@@ -1,3 +1,20 @@
+2017-03-05  Simon Fraser  <[email protected]>
+
+        Avoid backing store for layers with empty text nodes in a few more cases
+        https://bugs.webkit.org/show_bug.cgi?id=169185
+
+        Reviewed by Dan Bernstein.
+
+        In hasPaintingNonLayerDescendants() we can check whether the RenderText's linesBoundingBox()
+        is empty to avoid backing store in a few more cases. Also use containsOnlyWhitespace() rather
+        than isAllCollapsibleWhitespace(), because there's no need for backing store for non-selectable
+        whitespace text.
+
+        Covered by existing tests.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateClipRects):
+
 2017-03-05  Chris Dumez  <[email protected]>
 
         Using <form> in <template> causes following <form> to get swallowed

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderLayer.cpp (213811 => 213812)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderLayer.cpp	2017-03-13 10:38:43 UTC (rev 213811)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderLayer.cpp	2017-03-13 10:40:05 UTC (rev 213812)
@@ -6587,11 +6587,17 @@
     for (const auto& child : childrenOfType<RenderObject>(renderer)) {
         if (++siblingCount > maxSiblingCount)
             return true;
-        
+
         if (is<RenderText>(child)) {
-            bool isSelectable = renderer.style().userSelect() != SELECT_NONE;
-            if (isSelectable || !downcast<RenderText>(child).isAllCollapsibleWhitespace())
+            const auto& renderText = downcast<RenderText>(child);
+            if (renderText.linesBoundingBox().isEmpty())
+                continue;
+
+            if (renderer.style().userSelect() != SELECT_NONE)
                 return true;
+
+            if (!renderText.text()->containsOnlyWhitespace())
+                return true;
         }
         
         if (!is<RenderElement>(child))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to