Title: [200665] trunk
Revision
200665
Author
[email protected]
Date
2016-05-10 18:55:47 -0700 (Tue, 10 May 2016)

Log Message

Horizontally-scrollable items with a 3d transform are rendered incorrectly in RTL when container has -webkit-overflow-scroll: touch
https://bugs.webkit.org/show_bug.cgi?id=157482
rdar://problem/26204794

Reviewed by Zalan Bujtas.
Source/WebCore:

The compositing code was confused about scroll offsets vs. scroll positions, because
of the badly named scrolledContentOffset(); we used that in one place, and scrollOffset()
lower down. Change both to use scrollOffset().

Test: compositing/rtl/rtl-with-transformed-descendants.html

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

LayoutTests:

This can't be a ref test because on iOS ref test snapshots are doing by drawing, not by snapshotting layers.

* compositing/rtl/rtl-with-transformed-descendants-expected.txt: Added.
* compositing/rtl/rtl-with-transformed-descendants.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (200664 => 200665)


--- trunk/LayoutTests/ChangeLog	2016-05-11 01:55:42 UTC (rev 200664)
+++ trunk/LayoutTests/ChangeLog	2016-05-11 01:55:47 UTC (rev 200665)
@@ -1,3 +1,16 @@
+2016-05-10  Simon Fraser  <[email protected]>
+
+        Horizontally-scrollable items with a 3d transform are rendered incorrectly in RTL when container has -webkit-overflow-scroll: touch
+        https://bugs.webkit.org/show_bug.cgi?id=157482
+        rdar://problem/26204794
+
+        Reviewed by Zalan Bujtas.
+        
+        This can't be a ref test because on iOS ref test snapshots are doing by drawing, not by snapshotting layers.
+
+        * compositing/rtl/rtl-with-transformed-descendants-expected.txt: Added.
+        * compositing/rtl/rtl-with-transformed-descendants.html: Added.
+
 2016-05-10  Hunseop Jeong  <[email protected]>
 
         Unreviewed EFL Gardening on 10th May.

Added: trunk/LayoutTests/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt (0 => 200665)


--- trunk/LayoutTests/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt	2016-05-11 01:55:47 UTC (rev 200665)
@@ -0,0 +1,26 @@
+    
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 1
+        (GraphicsLayer
+          (position 10.00 10.00)
+          (bounds 400.00 204.00)
+          (children 1
+            (GraphicsLayer
+              (position 96.00 0.00)
+              (anchor 0.00 0.00)
+              (bounds 150.00 200.00)
+              (contentsOpaque 1)
+            )
+          )
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/compositing/rtl/rtl-scrolling-with-transformed-descendants.html (0 => 200665)


--- trunk/LayoutTests/compositing/rtl/rtl-scrolling-with-transformed-descendants.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/rtl/rtl-scrolling-with-transformed-descendants.html	2016-05-11 01:55:47 UTC (rev 200665)
@@ -0,0 +1,47 @@
+<html>
+  <head>
+    <style type="text/css">
+        #scroller {
+            overflow-x: auto;
+            width: 400px;
+            white-space: nowrap;
+            -webkit-overflow-scrolling: touch;
+            border: 2px solid black;
+        }
+
+        .tile {
+            position: relative;
+            width: 150px;
+            height: 200px;
+            background-color: silver;
+            display: inline-block;
+        }
+
+        .translated {
+            background-color: green;
+            transform: translateZ(0);
+            transform-origin: top left;
+        }
+    </style>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        function dumpLayers()
+        {
+            document.getElementById('layertree').textContent = window.internals.layerTreeAsText(document);
+        }
+        window.addEventListener('load', dumpLayers, false);
+    </script>
+  </head>
+  <body>
+    <div id="scroller" dir="rtl">
+      <div class="tile"></div>
+      <div class="translated tile"></div>
+      <div class="tile"></div>
+      <div class="tile"></div>
+      <div class="tile"></div>
+    </div>
+    <pre id="layertree"></pre>
+  </body>
+</html>
\ No newline at end of file

Added: trunk/LayoutTests/platform/ios-simulator/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt (0 => 200665)


--- trunk/LayoutTests/platform/ios-simulator/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt	2016-05-11 01:55:47 UTC (rev 200665)
@@ -0,0 +1,40 @@
+    
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 404.00 209.00)
+          (drawsContent 1)
+          (children 1
+            (GraphicsLayer
+              (position 2.00 2.00)
+              (bounds origin 366.00 0.00)
+              (bounds 400.00 205.00)
+              (children 1
+                (GraphicsLayer
+                  (bounds 766.00 205.00)
+                  (drawsContent 1)
+                  (children 1
+                    (GraphicsLayer
+                      (position 462.00 0.00)
+                      (anchor 0.00 0.00)
+                      (bounds 150.00 200.00)
+                      (contentsOpaque 1)
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/platform/ios-simulator-wk1/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt (0 => 200665)


--- trunk/LayoutTests/platform/ios-simulator-wk1/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator-wk1/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt	2016-05-11 01:55:47 UTC (rev 200665)
@@ -0,0 +1,39 @@
+    
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 404.00 209.00)
+          (drawsContent 1)
+          (children 1
+            (GraphicsLayer
+              (position 2.00 2.00)
+              (bounds origin 366.00 0.00)
+              (bounds 400.00 205.00)
+              (children 1
+                (GraphicsLayer
+                  (bounds 766.00 205.00)
+                  (drawsContent 1)
+                  (children 1
+                    (GraphicsLayer
+                      (position 462.00 0.00)
+                      (anchor 0.00 0.00)
+                      (bounds 150.00 200.00)
+                      (contentsOpaque 1)
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+

Modified: trunk/Source/WebCore/ChangeLog (200664 => 200665)


--- trunk/Source/WebCore/ChangeLog	2016-05-11 01:55:42 UTC (rev 200664)
+++ trunk/Source/WebCore/ChangeLog	2016-05-11 01:55:47 UTC (rev 200665)
@@ -1,3 +1,20 @@
+2016-05-10  Simon Fraser  <[email protected]>
+
+        Horizontally-scrollable items with a 3d transform are rendered incorrectly in RTL when container has -webkit-overflow-scroll: touch
+        https://bugs.webkit.org/show_bug.cgi?id=157482
+        rdar://problem/26204794
+
+        Reviewed by Zalan Bujtas.
+
+        The compositing code was confused about scroll offsets vs. scroll positions, because
+        of the badly named scrolledContentOffset(); we used that in one place, and scrollOffset()
+        lower down. Change both to use scrollOffset().
+
+        Test: compositing/rtl/rtl-with-transformed-descendants.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateGeometry):
+
 2016-05-10  Enrica Casucci  <[email protected]>
 
         Numerous block selection issues on iOS.

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (200664 => 200665)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2016-05-11 01:55:42 UTC (rev 200664)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2016-05-11 01:55:47 UTC (rev 200665)
@@ -815,9 +815,9 @@
             renderBox.width() - renderBox.borderLeft() - renderBox.borderRight(),
             renderBox.height() - renderBox.borderTop() - renderBox.borderBottom());
 
-        IntSize scrollOffset = compAncestor->scrolledContentOffset();
+        ScrollOffset scrollOffset = compAncestor->scrollOffset();
         // FIXME: pixel snap the padding box.
-        graphicsLayerParentLocation = paddingBox.location() - scrollOffset;
+        graphicsLayerParentLocation = paddingBox.location() - toLayoutSize(scrollOffset);
     }
 #else
     if (compAncestor && compAncestor->needsCompositedScrolling()) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to