Garbage texture data with composited table row
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Oct 2015 21:50:03 +0000 (21:50 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Oct 2015 21:50:03 +0000 (21:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=148984

Reviewed by Zalan Bujtas.
Source/WebCore:

Don't pretend to know if the layer for a table header, section or cell is
opaque, since table painting is special.

Test: compositing/contents-opaque/table-parts.html

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

LayoutTests:

* compositing/contents-opaque/table-parts-expected.txt: Added.
* compositing/contents-opaque/table-parts.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/compositing/contents-opaque/table-parts-expected.txt [new file with mode: 0644]
LayoutTests/compositing/contents-opaque/table-parts.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp

index 0e4b8c47a88b00e927689196d87329c0fb25630a..503e0381c9675fcb96714f22e786826e96711dac 100644 (file)
@@ -1,3 +1,13 @@
+2015-10-09  Simon Fraser  <simon.fraser@apple.com>
+
+        Garbage texture data with composited table row
+        https://bugs.webkit.org/show_bug.cgi?id=148984
+
+        Reviewed by Zalan Bujtas.
+
+        * compositing/contents-opaque/table-parts-expected.txt: Added.
+        * compositing/contents-opaque/table-parts.html: Added.
+
 2015-10-09  Simon Fraser  <simon.fraser@apple.com>
 
         Garbage pixels on enphaseenergy.com site
diff --git a/LayoutTests/compositing/contents-opaque/table-parts-expected.txt b/LayoutTests/compositing/contents-opaque/table-parts-expected.txt
new file mode 100644 (file)
index 0000000..907a353
--- /dev/null
@@ -0,0 +1,25 @@
+Table cell
+Table cell
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 2
+        (GraphicsLayer
+          (position 28.00 20.00)
+          (bounds 252.00 102.00)
+          (drawsContent 1)
+        )
+        (GraphicsLayer
+          (position 28.00 142.00)
+          (bounds 252.00 102.00)
+          (drawsContent 1)
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/compositing/contents-opaque/table-parts.html b/LayoutTests/compositing/contents-opaque/table-parts.html
new file mode 100644 (file)
index 0000000..5a7edf0
--- /dev/null
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+
+        table {
+            border-collapse: collapse;
+            margin: 20px;
+        }
+
+        tr {
+            background-color: silver;
+            border-right: 100px solid gray;
+        }
+        
+        td {
+            width: 200px;
+            height: 100px;
+        }
+        
+        .composited {
+            -webkit-transform: translateZ(0);
+        }
+        
+        td.composited {
+            background-color: silver;
+        }
+    </style>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        function doTest() {
+            if (window.testRunner && window.internals)
+                document.getElementById('layertree').innerText = window.internals.layerTreeAsText(document);
+        }
+        window.addEventListener('load', doTest, false);
+    </script>
+</head>
+<body>
+<table>
+    <tr class="composited">
+        <td>Table cell</td>
+    </tr>
+</table>
+
+<table>
+    <tr>
+        <td class="composited">Table cell</td>
+    </tr>
+</table>
+<pre id="layertree"></pre> 
+</body>
+</html>
index deb24e8e1be87736dcb21a0bbd7ca6cf36b749c3..aba108f31f83d2f9f90761d9fd27824f66a7510f 100644 (file)
@@ -1,3 +1,18 @@
+2015-10-09  Simon Fraser  <simon.fraser@apple.com>
+
+        Garbage texture data with composited table row
+        https://bugs.webkit.org/show_bug.cgi?id=148984
+
+        Reviewed by Zalan Bujtas.
+        
+        Don't pretend to know if the layer for a table header, section or cell is
+        opaque, since table painting is special.
+
+        Test: compositing/contents-opaque/table-parts.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::backgroundIsKnownToBeOpaqueInRect):
+
 2015-10-09  Simon Fraser  <simon.fraser@apple.com>
 
         Garbage pixels on enphaseenergy.com site
index 8e5def8b83e903d052ce35bc6d541a0a50a491b2..0b2519f157f990936b44a9deec35ebc6af53e53e 100644 (file)
@@ -6151,6 +6151,10 @@ bool RenderLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect)
     if (m_zOrderListsDirty || m_normalFlowListDirty)
         return false;
 
+    // Table painting is special; a table paints its sections.
+    if (renderer().isTablePart())
+        return false;
+
     // FIXME: We currently only check the immediate renderer,
     // which will miss many cases.
     if (renderer().backgroundIsKnownToBeOpaqueInRect(localRect))