Title: [110401] trunk
Revision
110401
Author
[email protected]
Date
2012-03-11 15:17:36 -0700 (Sun, 11 Mar 2012)

Log Message

REGRESSION (r93614): scrolling div does not repaint
https://bugs.webkit.org/show_bug.cgi?id=80641

Reviewed by Simon Fraser.

Source/WebCore:

Test: compositing/repaint/newly-composited-repaint-rect.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBacking): When a layer
becomes newly composited and creates its backing, the repaintRect
may become invalid. This patch recomputes repaintRects in this
case.

LayoutTests:

* compositing/repaint/newly-composited-repaint-rect-expected.png: Added.
* compositing/repaint/newly-composited-repaint-rect-expected.txt: Added.
* compositing/repaint/newly-composited-repaint-rect.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (110400 => 110401)


--- trunk/LayoutTests/ChangeLog	2012-03-11 22:07:06 UTC (rev 110400)
+++ trunk/LayoutTests/ChangeLog	2012-03-11 22:17:36 UTC (rev 110401)
@@ -1,3 +1,14 @@
+2012-03-11  Shawn Singh  <[email protected]>
+
+        REGRESSION (r93614): scrolling div does not repaint
+        https://bugs.webkit.org/show_bug.cgi?id=80641
+
+        Reviewed by Simon Fraser.
+
+        * compositing/repaint/newly-composited-repaint-rect-expected.png: Added.
+        * compositing/repaint/newly-composited-repaint-rect-expected.txt: Added.
+        * compositing/repaint/newly-composited-repaint-rect.html: Added.
+
 2012-03-11  Gavin Barraclough  <[email protected]>
 
         Inconsistent SyntaxError from new Function(...)

Added: trunk/LayoutTests/compositing/repaint/newly-composited-repaint-rect-expected.png (0 => 110401)


--- trunk/LayoutTests/compositing/repaint/newly-composited-repaint-rect-expected.png	                        (rev 0)
+++ trunk/LayoutTests/compositing/repaint/newly-composited-repaint-rect-expected.png	2012-03-11 22:17:36 UTC (rev 110401)
@@ -0,0 +1,6 @@
+\x89PNG
+
+
+IHDR X\x9Av\x82p)tEXtchecksumcb02d7c4e6fe2eb222964125a3aac0b7\x87\xF17\xCCIDATx\x9C\xEDݱm\xC3@A\x9E\xC1\xBE\xE8\xD6\xDC;;G-
+\x82\xBC4ș\xF8\xFCD\xC1\xEAsι>\xCE>\xB8d\x90 @F\x80d\x90Y\x8F\x8C1\x8A;\xE0\xFC\xAD\xC0c s\xB8\x80\xFC\xF0\xCB.\xFC\xCER\xF0\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80\x99\xF5\xEC\xDEe|\x8D\xB3O\xB8\x9C\xFDs\xF9\xB3۶\xBD\xEF.\xC3d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90Y\xCF>\x80\xFFk\xDF\xF7\x97?\xBBm\xDB\xFB\xE02, @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90s\xCE\xF9\xF0\xC1˲,\xCB\xC13\xB85\xDF\x80\xE7X@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2Ȭ\xCF>c\xFC\xE5\xC0
+X@\x80\xCC\xE12\xE7,\xEEn\xC0d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @\xE6I7!\xB0\xAC\xB7\x96zIEND\xAEB`\x82
\ No newline at end of file

Added: trunk/LayoutTests/compositing/repaint/newly-composited-repaint-rect-expected.txt (0 => 110401)


--- trunk/LayoutTests/compositing/repaint/newly-composited-repaint-rect-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/compositing/repaint/newly-composited-repaint-rect-expected.txt	2012-03-11 22:17:36 UTC (rev 110401)
@@ -0,0 +1 @@
+

Added: trunk/LayoutTests/compositing/repaint/newly-composited-repaint-rect.html (0 => 110401)


--- trunk/LayoutTests/compositing/repaint/newly-composited-repaint-rect.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/repaint/newly-composited-repaint-rect.html	2012-03-11 22:17:36 UTC (rev 110401)
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <!-- This test case reproduces a bug that is hopefully solved by https://bugs.webkit.org/show_bug.cgi?id=80641
+
+       In the bug, a div element begins as non-composited, and the repaintRect had a
+       correct non-zero offset because it paints into an ancestor container. Later, the
+       layer becomes composited (in this case, because the layer is moved to overlap
+       another composited layer). Because the layer is now composited, the repaintRect
+       should have been recomputed - in particular, the offset of the repaintRect should
+       become zero because it is now its own repaint container.
+
+       Therefore, after the layer became composited, it was using the wrong repaint rect,
+       which caused things not to repaint properly.
+    -->
+
+  <style type="text/css">
+      .composited {
+          -webkit-transform: translatez(0);
+          border: 2px solid black;
+      }
+
+      .box {
+          width: 200px;
+          height: 200px;
+      }
+
+      #scrolldiv {
+          position: absolute;
+          width: 100px;
+          height: 100px;
+          left: 250px;
+          top: 50px;
+          overflow-x: hidden;
+          overflow-y: scroll;
+      }
+
+      .shouldNotBeSeen {
+          background-color: red;
+      }
+
+      .shouldBeSeen {
+          background-color: green;
+      }
+  </style>
+
+</head>
+
+<script src=""
+
+<script>
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText(true);
+        layoutTestController.waitUntilDone();
+    }
+
+    function changeDivPosition() {
+        document.getElementById("scrolldiv").style.left="50px";
+    }
+
+    function repaintTest() {
+        // Changing the position will cause the scrolldiv to become composited becuase it overlaps another compostied element.
+        changeDivPosition();
+
+        // Force DumpRenderTree to do a layout and repaint here, this is where the repaintRect
+        // goes wrong because it does not get updated for a newly composited element.
+        if (window.layoutTestController)
+            layoutTestController.display();
+
+        window.setTimeout(function() {
+            // Scrolling a little will demonstrate whether the repaint rect is correct or not.
+            document.getElementById('scrolldiv').scrollTop = 500;
+            layoutTestController.notifyDone();
+        }, 0);
+    }
+
+</script>
+
+<body _onload_="runRepaintTest()">
+  <div class="composited box"></div>
+  <div id="scrolldiv">
+    <div class="shouldNotBeSeen box"></div>
+    <div class="shouldBeSeen box"></div>
+  </div>
+</body>
+
+</html>

Modified: trunk/Source/WebCore/ChangeLog (110400 => 110401)


--- trunk/Source/WebCore/ChangeLog	2012-03-11 22:07:06 UTC (rev 110400)
+++ trunk/Source/WebCore/ChangeLog	2012-03-11 22:17:36 UTC (rev 110401)
@@ -1,3 +1,18 @@
+2012-03-11  Shawn Singh  <[email protected]>
+
+        REGRESSION (r93614): scrolling div does not repaint
+        https://bugs.webkit.org/show_bug.cgi?id=80641
+
+        Reviewed by Simon Fraser.
+
+        Test: compositing/repaint/newly-composited-repaint-rect.html
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::updateBacking): When a layer
+        becomes newly composited and creates its backing, the repaintRect
+        may become invalid. This patch recomputes repaintRects in this
+        case.
+
 2012-03-11  George Staikos  <[email protected]>
 
         Enable JPEG encoding for BlackBerry.

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (110400 => 110401)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-03-11 22:07:06 UTC (rev 110400)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-03-11 22:17:36 UTC (rev 110401)
@@ -417,6 +417,11 @@
 
             layer->ensureBacking();
 
+            // The RenderLayer's needs to update repaint rects here, because the target
+            // repaintContainer may have changed after becoming a composited layer.
+            // https://bugs.webkit.org/show_bug.cgi?id=80641
+            layer->computeRepaintRects();
+
 #if PLATFORM(MAC) && USE(CA)
             Settings* settings = m_renderView->document()->settings();
             if (settings && settings->acceleratedDrawingEnabled())
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to