REGRESSION (r128787): Fixed position div causes other elements to not update correctly
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Oct 2012 18:29:38 +0000 (18:29 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Oct 2012 18:29:38 +0000 (18:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=98579

Reviewed by Beth Dakin.

Source/WebCore:

RenderLayers cache repaint rects which are computed relative to the repaint container.
Repaint containers depend on whether a RenderLayerBacking has its own backing store,
so if that changes, we need to recompute repaint rects for all descendants.

Test: compositing/repaint/requires-backing-repaint.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::setRequiresOwnBackingStore):

LayoutTests:

Repaint test that scrolls an overflow element until its content layers overlap some
other composited element. Only the pixel result is interesting.

* compositing/repaint/requires-backing-repaint-expected.png: Added.
* compositing/repaint/requires-backing-repaint-expected.txt: Added.
* compositing/repaint/requires-backing-repaint.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/compositing/repaint/requires-backing-repaint-expected.png [new file with mode: 0644]
LayoutTests/compositing/repaint/requires-backing-repaint-expected.txt [new file with mode: 0644]
LayoutTests/compositing/repaint/requires-backing-repaint.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerBacking.cpp

index aede5f5..7c13730 100644 (file)
@@ -1,3 +1,17 @@
+2012-10-16  Simon Fraser  <simon.fraser@apple.com>
+
+        REGRESSION (r128787): Fixed position div causes other elements to not update correctly
+        https://bugs.webkit.org/show_bug.cgi?id=98579
+
+        Reviewed by Beth Dakin.
+
+        Repaint test that scrolls an overflow element until its content layers overlap some
+        other composited element. Only the pixel result is interesting.
+
+        * compositing/repaint/requires-backing-repaint-expected.png: Added.
+        * compositing/repaint/requires-backing-repaint-expected.txt: Added.
+        * compositing/repaint/requires-backing-repaint.html: Added.
+
 2012-10-16  Mike Reed  <reed@google.com>
 
         update expectations preparing for skia optimization
diff --git a/LayoutTests/compositing/repaint/requires-backing-repaint-expected.png b/LayoutTests/compositing/repaint/requires-backing-repaint-expected.png
new file mode 100644 (file)
index 0000000..52dcca5
Binary files /dev/null and b/LayoutTests/compositing/repaint/requires-backing-repaint-expected.png differ
diff --git a/LayoutTests/compositing/repaint/requires-backing-repaint-expected.txt b/LayoutTests/compositing/repaint/requires-backing-repaint-expected.txt
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/LayoutTests/compositing/repaint/requires-backing-repaint.html b/LayoutTests/compositing/repaint/requires-backing-repaint.html
new file mode 100644 (file)
index 0000000..7b2b95f
--- /dev/null
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        .bar {
+            width: 200px;
+            height: 50px;
+            margin-left: 50px;
+            background-color: gray;
+            -webkit-transform: translateZ(0);
+        }
+
+        #overflow {
+            position: absolute;
+            top: 70px;
+            left: 100px;
+            z-index: 100;
+            height: 200px;
+            width: 200px;
+            border: 1px solid black;
+            overflow: scroll;
+        }
+        
+        #overflow > div {
+            position: relative;
+            height: 50px;
+            width: 100%;
+            border: 2px solid black;
+            margin: 2px;
+        }
+        
+    </style>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText(true);
+            testRunner.waitUntilDone();
+        }
+
+        function doTest()
+        {
+            var overflow = document.getElementById('overflow');
+            overflow.scrollTop = 50;
+
+            if (window.testRunner)
+                testRunner.display();
+            
+            window.setTimeout(function() {
+                overflow.scrollTop = 75;
+                if (window.testRunner)
+                    testRunner.notifyDone();
+            }, 0)
+        }
+        window.addEventListener('load', doTest, false);
+    </script>
+</head>
+<body>
+
+    <div class="bar"></div>
+    
+    <div id="overflow">
+        <div></div>
+        <div></div>
+        <div></div>
+        <div></div>
+        <div></div>
+    </div>
+</body>
+</html>
index 5fab6ab..da51712 100644 (file)
@@ -675,6 +675,10 @@ printing/page-rule-in-media-query.html [ WontFix ]
 compositing/visible-rect [ WontFix ]
 platform/chromium/virtual/softwarecompositing/visible-rect [ WontFix ]
 
+# Repaint test doesn't seem to work on Chromium.
+webkit.org/b/98579 compositing/repaint/requires-backing-repaint.html [ ImageOnlyFailure ]
+webkit.org/b/98579 platform/chromium/virtual/softwarecompositing/repaint/requires-backing-repaint.html [ ImageOnlyFailure ]
+
 # Chrome doesn't call the willCacheResponse callback (a method
 # of ResourceHandleClient).  That function is Mac-specific.
 http/tests/misc/willCacheResponse-delegate-callback.html [ WontFix ]
index 7cc9e5c..4829f5c 100644 (file)
@@ -1,3 +1,19 @@
+2012-10-16  Simon Fraser  <simon.fraser@apple.com>
+
+        REGRESSION (r128787): Fixed position div causes other elements to not update correctly
+        https://bugs.webkit.org/show_bug.cgi?id=98579
+
+        Reviewed by Beth Dakin.
+
+        RenderLayers cache repaint rects which are computed relative to the repaint container.
+        Repaint containers depend on whether a RenderLayerBacking has its own backing store,
+        so if that changes, we need to recompute repaint rects for all descendants.
+        
+        Test: compositing/repaint/requires-backing-repaint.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::setRequiresOwnBackingStore):
+
 2012-10-16  Zan Dobersek  <zandobersek@gmail.com>
 
         [GStreamer] GstBuffer ref race in WebKitWebAudioSrcLoop
index 173d4c6..1ef75e7 100644 (file)
@@ -1373,10 +1373,12 @@ void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking)
     if (requiresOwnBacking == m_requiresOwnBackingStore)
         return;
     
+    m_requiresOwnBackingStore = requiresOwnBacking;
+
     // This affects the answer to paintsIntoCompositedAncestor(), which in turn affects
     // cached clip rects, so when it changes we have to clear clip rects on descendants.
     m_owningLayer->clearClipRectsIncludingDescendants(PaintingClipRects);
-    m_requiresOwnBackingStore = requiresOwnBacking;
+    m_owningLayer->computeRepaintRectsIncludingDescendants();
     
     compositor()->repaintInCompositedAncestor(m_owningLayer, compositedBounds());
 }