Title: [149084] trunk
Revision
149084
Author
[email protected]
Date
2013-04-24 18:27:20 -0700 (Wed, 24 Apr 2013)

Log Message

Garbage at the top of http://www.technologyreview.com after scrolling
https://bugs.webkit.org/show_bug.cgi?id=114825

Source/WebCore:

Reviewed by Tim Horton.

Garbage pixels are caused by GraphicsLayerCA setting a layer to be opaque,
but then not painting anything into it. On this page, the element is
toggled to be visibility:hidden on scrolling, but RenderLayer::backgroundIsKnownToBeOpaqueInRect()
failed to consider that as something that can cause backgrounds not to be opaque.

For the bug to happen, some subtle interactions with r142012 come into play
for the layer to remain visible, hence the slightly complex testcase.

Test: compositing/contents-opaque/visibility-hidden.html

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

LayoutTests:

Reviewed by Tim Horton.

Test that sets visibility:hidden on an element with some complex
configuration of layer children, and dumps the layer tree to check
that the contents are not marked as opaque.

* compositing/contents-opaque/visibility-hidden-expected.txt: Added.
* compositing/contents-opaque/visibility-hidden.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (149083 => 149084)


--- trunk/LayoutTests/ChangeLog	2013-04-25 01:27:13 UTC (rev 149083)
+++ trunk/LayoutTests/ChangeLog	2013-04-25 01:27:20 UTC (rev 149084)
@@ -1,3 +1,17 @@
+2013-04-24  Simon Fraser  <[email protected]>
+
+        Garbage at the top of http://www.technologyreview.com after scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=114825
+
+        Reviewed by Tim Horton.
+        
+        Test that sets visibility:hidden on an element with some complex
+        configuration of layer children, and dumps the layer tree to check
+        that the contents are not marked as opaque.
+
+        * compositing/contents-opaque/visibility-hidden-expected.txt: Added.
+        * compositing/contents-opaque/visibility-hidden.html: Added.
+
 2013-04-24  David Kilzer  <[email protected]>
 
         Fix invalid test names in jsc-test-list

Added: trunk/LayoutTests/compositing/contents-opaque/visibility-hidden-expected.txt (0 => 149084)


--- trunk/LayoutTests/compositing/contents-opaque/visibility-hidden-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/compositing/contents-opaque/visibility-hidden-expected.txt	2013-04-25 01:27:20 UTC (rev 149084)
@@ -0,0 +1,17 @@
+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 20.00)
+          (bounds 200.00 50.00)
+          (drawsContent 1)
+        )
+      )
+    )
+  )
+)
+
Property changes on: trunk/LayoutTests/compositing/contents-opaque/visibility-hidden-expected.txt
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/compositing/contents-opaque/visibility-hidden.html (0 => 149084)


--- trunk/LayoutTests/compositing/contents-opaque/visibility-hidden.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/contents-opaque/visibility-hidden.html	2013-04-25 01:27:20 UTC (rev 149084)
@@ -0,0 +1,54 @@
+<html>
+    <head>
+        <style type="text/css">
+            header {
+                position: absolute;
+                top: 20px;
+                width: 200px;
+                height: 50px;
+                background-color: silver;
+                -webkit-transform: translateZ(0);
+            }
+            
+            header.hidden {
+                visibility: hidden;
+            }
+            
+            nav {
+                height: 37px;
+                overflow: hidden;
+            }
+            
+            nav ul li {
+                height: 50px;
+                float: left;
+                overflow: hidden;
+            }
+            
+        </style>
+        <script type="text/_javascript_">
+            if (window.testRunner)
+                testRunner.dumpAsText();
+
+            function doTest() {
+                var header = document.getElementsByTagName('header')[0];
+                header.classList.toggle('hidden');
+                if (window.testRunner && window.internals)
+                    document.getElementById('layertree').innerText = window.internals.layerTreeAsText(document);
+            }
+            window.addEventListener('load', doTest, false);
+        </script>
+    </head>
+
+<body>
+    <header> 
+        <nav> 
+            <ul>
+                <li>Some text here</li>
+            </ul>
+        </nav> 
+    </header>
+    
+    <pre id="layertree"></pre> 
+</body>
+</html>
Property changes on: trunk/LayoutTests/compositing/contents-opaque/visibility-hidden.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (149083 => 149084)


--- trunk/Source/WebCore/ChangeLog	2013-04-25 01:27:13 UTC (rev 149083)
+++ trunk/Source/WebCore/ChangeLog	2013-04-25 01:27:20 UTC (rev 149084)
@@ -1,5 +1,25 @@
 2013-04-24  Simon Fraser  <[email protected]>
 
+        Garbage at the top of http://www.technologyreview.com after scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=114825
+
+        Reviewed by Tim Horton.
+
+        Garbage pixels are caused by GraphicsLayerCA setting a layer to be opaque,
+        but then not painting anything into it. On this page, the element is
+        toggled to be visibility:hidden on scrolling, but RenderLayer::backgroundIsKnownToBeOpaqueInRect()
+        failed to consider that as something that can cause backgrounds not to be opaque.
+        
+        For the bug to happen, some subtle interactions with r142012 come into play
+        for the layer to remain visible, hence the slightly complex testcase.
+        
+        Test: compositing/contents-opaque/visibility-hidden.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::backgroundIsKnownToBeOpaqueInRect):
+
+2013-04-24  Simon Fraser  <[email protected]>
+
         Dump layer opaqueness in the Compositing log output
         https://bugs.webkit.org/show_bug.cgi?id=115132
 

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (149083 => 149084)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2013-04-25 01:27:13 UTC (rev 149083)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2013-04-25 01:27:20 UTC (rev 149084)
@@ -5564,6 +5564,10 @@
     if (paintsWithTransparency(PaintBehaviorNormal))
         return false;
 
+    ASSERT(!m_visibleContentStatusDirty);
+    if (!hasVisibleContent())
+        return false;
+
 #if ENABLE(CSS_FILTERS)
     if (paintsWithFilters() && renderer()->style()->filter().hasFilterThatAffectsOpacity())
         return false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to