Title: [147448] branches/chromium/1453
Revision
147448
Author
[email protected]
Date
2013-04-02 10:41:15 -0700 (Tue, 02 Apr 2013)

Log Message

Merge 147127 "RenderBox::backgroundIsKnownToBeOpaqueInRect may b..."

> RenderBox::backgroundIsKnownToBeOpaqueInRect may be wrong for theme-painted elements
> https://bugs.webkit.org/show_bug.cgi?id=113419
> 
> Reviewed by Simon Fraser.
> 
> Source/WebCore:
> 
> Do not consider control elements as opaque. They are typically theme painted, and we cannot assume opaqueness on the behalf of theme. It can be improved by asking the theme if it paints opaque.
> 
> Test: compositing/contents-opaque/control-layer.html
> 
> * rendering/RenderBox.cpp:
> (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect):
> 
> LayoutTests:
> 
> * compositing/contents-opaque/control-layer-expected.txt: Added.
> * compositing/contents-opaque/control-layer.html: Added.
> * platform/chromium/compositing/contents-opaque/control-layer-expected.txt: Added.

[email protected]
BUG=223490
Review URL: https://codereview.chromium.org/13465009

Modified Paths

Added Paths

Diff

Copied: branches/chromium/1453/LayoutTests/compositing/contents-opaque/control-layer-expected.txt (from rev 147127, trunk/LayoutTests/compositing/contents-opaque/control-layer-expected.txt) (0 => 147448)


--- branches/chromium/1453/LayoutTests/compositing/contents-opaque/control-layer-expected.txt	                        (rev 0)
+++ branches/chromium/1453/LayoutTests/compositing/contents-opaque/control-layer-expected.txt	2013-04-02 17:41:15 UTC (rev 147448)
@@ -0,0 +1,19 @@
+
+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 1
+        (GraphicsLayer
+          (position 5.00 6.00)
+          (anchor 0.50 0.46)
+          (bounds 129.00 28.00)
+          (drawsContent 1)
+        )
+      )
+    )
+  )
+)
+

Copied: branches/chromium/1453/LayoutTests/compositing/contents-opaque/control-layer.html (from rev 147127, trunk/LayoutTests/compositing/contents-opaque/control-layer.html) (0 => 147448)


--- branches/chromium/1453/LayoutTests/compositing/contents-opaque/control-layer.html	                        (rev 0)
+++ branches/chromium/1453/LayoutTests/compositing/contents-opaque/control-layer.html	2013-04-02 17:41:15 UTC (rev 147448)
@@ -0,0 +1,27 @@
+<html>
+    <head>
+        <style type="text/css">
+            .composited {
+                -webkit-transform: translateZ(0);
+            }
+        </style>
+        <script type="text/_javascript_">
+            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>
+        <!-- Composited control element. -->
+        <!-- Control elements are rendered by native theme. ->
+        <!-- GraphicsLayer::contentsOpaque for control element should be false. -->
+        <input class="composited" type="button" value="Composited Button">
+
+        <pre id="layertree"></pre>
+    </body>
+</html>

Copied: branches/chromium/1453/LayoutTests/platform/chromium/compositing/contents-opaque/control-layer-expected.txt (from rev 147127, trunk/LayoutTests/platform/chromium/compositing/contents-opaque/control-layer-expected.txt) (0 => 147448)


--- branches/chromium/1453/LayoutTests/platform/chromium/compositing/contents-opaque/control-layer-expected.txt	                        (rev 0)
+++ branches/chromium/1453/LayoutTests/platform/chromium/compositing/contents-opaque/control-layer-expected.txt	2013-04-02 17:41:15 UTC (rev 147448)
@@ -0,0 +1,18 @@
+
+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 1
+        (GraphicsLayer
+          (position 10.00 10.00)
+          (bounds 127.00 22.00)
+          (drawsContent 1)
+        )
+      )
+    )
+  )
+)
+

Modified: branches/chromium/1453/Source/WebCore/rendering/RenderBox.cpp (147447 => 147448)


--- branches/chromium/1453/Source/WebCore/rendering/RenderBox.cpp	2013-04-02 17:35:33 UTC (rev 147447)
+++ branches/chromium/1453/Source/WebCore/rendering/RenderBox.cpp	2013-04-02 17:41:15 UTC (rev 147448)
@@ -1171,6 +1171,12 @@
     if (!backgroundColor.isValid() || backgroundColor.hasAlpha())
         return false;
 
+    // If the element has appearance, it might be painted by theme.
+    // We cannot be sure if theme paints the background opaque.
+    // In this case it is safe to not assume opaqueness.
+    // FIXME: May be ask theme if it paints opaque.
+    if (style()->hasAppearance())
+        return false;
     // FIXME: Check the opaqueness of background images.
 
     // FIXME: Use rounded rect if border radius is present.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to