Title: [184421] trunk
Revision
184421
Author
[email protected]
Date
2015-05-15 16:29:29 -0700 (Fri, 15 May 2015)

Log Message

REGRESSION (r183300): Background missing on top links on apple.com
https://bugs.webkit.org/show_bug.cgi?id=145079
rdar://problem/20914252

Reviewed by Tim Horton.

Source/WebCore:

GraphicsLayerCA::setVisibleAndCoverageRects() only set the m_intersectsCoverageRect
flag if the coverage rect changed, but it doesn't if you simply change the size of
the layer.

Instead, always re-evaluate the intersection, and set the CoverageRectChanged bit
if it changes.

Test: compositing/visible-rect/backing-change-height-from-zero.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::shouldSkipLayerInDump): Don't skip any layers in a
debug layer dump, to assist debugging.

LayoutTests:

Composited box that toggles to a non-zero height and dumps layers.

* compositing/visible-rect/backing-change-height-from-zero-expected.txt: Added.
* compositing/visible-rect/backing-change-height-from-zero.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (184420 => 184421)


--- trunk/LayoutTests/ChangeLog	2015-05-15 22:55:53 UTC (rev 184420)
+++ trunk/LayoutTests/ChangeLog	2015-05-15 23:29:29 UTC (rev 184421)
@@ -1,3 +1,16 @@
+2015-05-15  Simon Fraser  <[email protected]>
+
+        REGRESSION (r183300): Background missing on top links on apple.com
+        https://bugs.webkit.org/show_bug.cgi?id=145079
+        rdar://problem/20914252
+
+        Reviewed by Tim Horton.
+
+        Composited box that toggles to a non-zero height and dumps layers.
+
+        * compositing/visible-rect/backing-change-height-from-zero-expected.txt: Added.
+        * compositing/visible-rect/backing-change-height-from-zero.html: Added.
+
 2015-05-15  Sam Weinig  <[email protected]>
 
         Move HTMLElement's children property to ParentNode

Added: trunk/LayoutTests/compositing/visible-rect/backing-change-height-from-zero-expected.txt (0 => 184421)


--- trunk/LayoutTests/compositing/visible-rect/backing-change-height-from-zero-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/compositing/visible-rect/backing-change-height-from-zero-expected.txt	2015-05-15 23:29:29 UTC (rev 184421)
@@ -0,0 +1,32 @@
+Content
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (visible rect 0.00, 0.00 800.00 x 600.00)
+  (coverage rect 0.00, 0.00 800.00 x 600.00)
+  (intersects coverage rect 1)
+  (contentsScale 1.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (visible rect 0.00, 0.00 800.00 x 600.00)
+      (coverage rect 0.00, 0.00 800.00 x 600.00)
+      (intersects coverage rect 1)
+      (contentsScale 1.00)
+      (children 1
+        (GraphicsLayer
+          (position 28.00 20.00)
+          (bounds 100.00 100.00)
+          (contentsOpaque 1)
+          (drawsContent 1)
+          (visible rect 0.00, 0.00 100.00 x 100.00)
+          (coverage rect -28.00, -20.00 800.00 x 600.00)
+          (intersects coverage rect 1)
+          (contentsScale 1.00)
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/compositing/visible-rect/backing-change-height-from-zero.html (0 => 184421)


--- trunk/LayoutTests/compositing/visible-rect/backing-change-height-from-zero.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/visible-rect/backing-change-height-from-zero.html	2015-05-15 23:29:29 UTC (rev 184421)
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <style>
+        .box {
+            margin: 20px;
+            width: 100px;
+            height: 0px;
+            overflow: hidden;
+            background-color: blue;
+            -webkit-transform: translateZ(0);
+        }
+        
+        .box.changed {
+            height: 100px;
+        }
+    </style>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        function doTest()
+        {
+            window.setTimeout(function() {
+                document.body.offsetWidth;
+
+                document.getElementById('box').classList.add('changed');
+
+                if (window.internals)
+                    document.getElementById('layers').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS)
+
+                if (window.testRunner)
+                    testRunner.notifyDone();
+
+            }, 0);
+
+        }
+        window.addEventListener('load', doTest, false);
+    </script>
+
+</head>
+<body>
+    <div id="box" class="box">Content</div>
+<pre id="layers">Layer tree goes here when testing</pre>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (184420 => 184421)


--- trunk/Source/WebCore/ChangeLog	2015-05-15 22:55:53 UTC (rev 184420)
+++ trunk/Source/WebCore/ChangeLog	2015-05-15 23:29:29 UTC (rev 184421)
@@ -1,3 +1,26 @@
+2015-05-15  Simon Fraser  <[email protected]>
+
+        REGRESSION (r183300): Background missing on top links on apple.com
+        https://bugs.webkit.org/show_bug.cgi?id=145079
+        rdar://problem/20914252
+
+        Reviewed by Tim Horton.
+
+        GraphicsLayerCA::setVisibleAndCoverageRects() only set the m_intersectsCoverageRect
+        flag if the coverage rect changed, but it doesn't if you simply change the size of
+        the layer.
+
+        Instead, always re-evaluate the intersection, and set the CoverageRectChanged bit
+        if it changes.
+
+        Test: compositing/visible-rect/backing-change-height-from-zero.html
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::shouldSkipLayerInDump): Don't skip any layers in a
+        debug layer dump, to assist debugging.
+
 2015-05-15  Sam Weinig  <[email protected]>
 
         Move HTMLElement's children property to ParentNode

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (184420 => 184421)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2015-05-15 22:55:53 UTC (rev 184420)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2015-05-15 23:29:29 UTC (rev 184421)
@@ -1260,10 +1260,17 @@
     if (!visibleRectChanged && !coverageRectChanged)
         return;
 
+    // FIXME: we need to take reflections into account when determining whether this layer intersects the coverage rect.
+    bool intersectsCoverageRect = !allowBackingStoreDetachment || m_coverageRect.intersects(FloatRect(m_boundsOrigin, size()));
+    if (intersectsCoverageRect != m_intersectsCoverageRect) {
+        m_uncommittedChanges |= CoverageRectChanged;
+        m_intersectsCoverageRect = intersectsCoverageRect;
+    }
+
     if (visibleRectChanged) {
         m_uncommittedChanges |= CoverageRectChanged;
         m_visibleRect = rects.visibleRect;
-        
+
         if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer)) {
             // FIXME: this assumes that the mask layer has the same geometry as this layer (which is currently always true).
             maskLayer->m_uncommittedChanges |= CoverageRectChanged;
@@ -1275,9 +1282,6 @@
         m_uncommittedChanges |= CoverageRectChanged;
         m_coverageRect = rects.coverageRect;
 
-        // FIXME: we need to take reflections into account when determining whether this layer intersects the coverage rect.
-        m_intersectsCoverageRect = !allowBackingStoreDetachment || m_coverageRect.intersects(FloatRect(m_boundsOrigin, size()));
-
         if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer)) {
             maskLayer->m_uncommittedChanges |= CoverageRectChanged;
             maskLayer->m_coverageRect = rects.coverageRect;

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (184420 => 184421)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2015-05-15 22:55:53 UTC (rev 184420)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2015-05-15 23:29:29 UTC (rev 184421)
@@ -2393,8 +2393,11 @@
     return static_cast<GraphicsLayerClient&>(compositor()).isTrackingRepaints();
 }
 
-bool RenderLayerBacking::shouldSkipLayerInDump(const GraphicsLayer* layer, LayerTreeAsTextBehavior) const
+bool RenderLayerBacking::shouldSkipLayerInDump(const GraphicsLayer* layer, LayerTreeAsTextBehavior behavior) const
 {
+    if (behavior & LayerTreeAsTextDebug)
+        return false;
+
     // Skip the root tile cache's flattening layer.
     return m_isMainFrameRenderViewLayer && layer && layer == m_childContainmentLayer.get();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to