Title: [122751] branches/chromium/1180
Revision
122751
Author
[email protected]
Date
2012-07-16 12:50:08 -0700 (Mon, 16 Jul 2012)

Log Message

Merge 122529 - [chromium] Root invalidations for RTL pages need to be in the right space
https://bugs.webkit.org/show_bug.cgi?id=91155

Reviewed by Kenneth Russell.

Source/WebKit/chromium:

The root layer has a translation on it when placed in the tree, so any
invalidations on this layer likewise need to be adjusted.

This adjustment is due to the fact that compositor layers all have the
origin in the upper left corner of the layer, but this is not always
the origin for graphics layers. Rather than making compositor layers
have to deal with a potential offset, we change the transform when
inserting the layer into the tree. Invalidations need to be similarly
transformed from document space into compositor layer space.

The need for this offset is due to the definition of the initial
containing block. RTL pages (pages with dir=RTL on the body) start
scrolled all the way to the right, and the origin is in the upper left
hand corner of this initial viewport. Thus on RTL pages with
horizontal overflow, the left of the document is in negative CSS
space.

* src/NonCompositedContentHost.cpp:
(WebKit::NonCompositedContentHost::invalidateRect):

LayoutTests:

Add a test that demonstrates this problem. Before the code fix, the
test shows just a red square because the invalidation for the style
change repaints the wrong rect.

* compositing/rtl/rtl-overflow-invalidation-expected.png: Added.
* compositing/rtl/rtl-overflow-invalidation-expected.txt: Added.
* compositing/rtl/rtl-overflow-invalidation.html: Added.


[email protected]
Review URL: https://chromiumcodereview.appspot.com/10782018

Modified Paths

Added Paths

Diff

Copied: branches/chromium/1180/LayoutTests/compositing/rtl/rtl-overflow-invalidation-expected.png (from rev 122529, trunk/LayoutTests/compositing/rtl/rtl-overflow-invalidation-expected.png) (0 => 122751)


--- branches/chromium/1180/LayoutTests/compositing/rtl/rtl-overflow-invalidation-expected.png	                        (rev 0)
+++ branches/chromium/1180/LayoutTests/compositing/rtl/rtl-overflow-invalidation-expected.png	2012-07-16 19:50:08 UTC (rev 122751)
@@ -0,0 +1,5 @@
+\x89PNG
+
+
+IHDR X')tEXtchecksum7c4f4ad7ad63bab2764e0d8cbcf74d31\x87\xEB
+\xE7IDATx\x9C\xED\xD8\xC1m\x84@EAc\x917"3&\xB2\xD9VH~\xF6xEչ\xFF\xF8\xD4ۜ\xF3\x80\xB7\xCE\xF3\xBC\xFC\xFD{;\x9EI`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@l_=a;\xB7\xD5>\xC6<\xE6\xEA	?\xE5\x83X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81\xDBW\x80G\x98\xC7\=\x81\xBF\xE3\x83X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81\xDB末7\xFCwc\x8C\xFB\xC7>X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81\xDB\xC7\xAB7\xB0\xC6u]\xAB'\xC0\xC78\x8E\xE3\xFE\xB1@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4^\xF3\xA6\xF2yE6QIEND\xAEB`\x82
\ No newline at end of file

Copied: branches/chromium/1180/LayoutTests/compositing/rtl/rtl-overflow-invalidation-expected.txt (from rev 122529, trunk/LayoutTests/compositing/rtl/rtl-overflow-invalidation-expected.txt) (0 => 122751)


--- branches/chromium/1180/LayoutTests/compositing/rtl/rtl-overflow-invalidation-expected.txt	                        (rev 0)
+++ branches/chromium/1180/LayoutTests/compositing/rtl/rtl-overflow-invalidation-expected.txt	2012-07-16 19:50:08 UTC (rev 122751)
@@ -0,0 +1 @@
+

Copied: branches/chromium/1180/LayoutTests/compositing/rtl/rtl-overflow-invalidation.html (from rev 122529, trunk/LayoutTests/compositing/rtl/rtl-overflow-invalidation.html) (0 => 122751)


--- branches/chromium/1180/LayoutTests/compositing/rtl/rtl-overflow-invalidation.html	                        (rev 0)
+++ branches/chromium/1180/LayoutTests/compositing/rtl/rtl-overflow-invalidation.html	2012-07-16 19:50:08 UTC (rev 122751)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+    body {
+        direction: rtl;
+        margin: 0px;
+    }
+
+    #layer {
+        position: absolute;
+        top: 50px;
+        right: 50px;
+        width: 100px;
+        height: 100px;
+        background-color: red;
+    }
+
+    #root {
+        width: 1000px;
+        height: 1000px;
+        -webkit-transform:translateZ(0);
+    }
+</style>
+<script>
+    function doTest() {
+        if (window.testRunner) {
+            testRunner.display();
+            testRunner.dumpAsText(true);
+        }
+        // This test passes if this element is repainted correctly, even
+        // on a page that is composited and has horizontal overflow.
+        var elem = document.getElementById("layer");
+        elem.style.backgroundColor = "green";
+    }
+    window.addEventListener('load', doTest, false);
+</script>
+<body>
+    <div id="layer" class=""></div>
+    <div id="root"></div>
+</body>
+</html>

Modified: branches/chromium/1180/Source/WebKit/chromium/src/NonCompositedContentHost.cpp (122750 => 122751)


--- branches/chromium/1180/Source/WebKit/chromium/src/NonCompositedContentHost.cpp	2012-07-16 19:37:18 UTC (rev 122750)
+++ branches/chromium/1180/Source/WebKit/chromium/src/NonCompositedContentHost.cpp	2012-07-16 19:50:08 UTC (rev 122751)
@@ -151,7 +151,9 @@
 
 void NonCompositedContentHost::invalidateRect(const WebCore::IntRect& rect)
 {
-    m_graphicsLayer->setNeedsDisplayInRect(WebCore::FloatRect(rect));
+    WebCore::IntRect layerRect = rect;
+    layerRect.move(-m_layerAdjust);
+    m_graphicsLayer->setNeedsDisplayInRect(WebCore::FloatRect(layerRect));
 }
 
 void NonCompositedContentHost::notifyAnimationStarted(const WebCore::GraphicsLayer*, double /* time */)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to