Title: [117537] trunk
Revision
117537
Author
m...@apple.com
Date
2012-05-17 21:33:59 -0700 (Thu, 17 May 2012)

Log Message

<rdar://problem/11419933> Problems with flipped writing modes and compositing
https://bugs.webkit.org/show_bug.cgi?id=86032

Reviewed by Anders Carlsson.

Source/WebCore: 

Test: compositing/bounds-in-flipped-writing-mode.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateLayerBounds): Apply a writing-mode flip to the bounding box
if needed.

LayoutTests: 

* compositing/bounds-in-flipped-writing-mode-expected.txt: Added.
* compositing/bounds-in-flipped-writing-mode.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (117536 => 117537)


--- trunk/LayoutTests/ChangeLog	2012-05-18 03:39:09 UTC (rev 117536)
+++ trunk/LayoutTests/ChangeLog	2012-05-18 04:33:59 UTC (rev 117537)
@@ -1,3 +1,13 @@
+2012-05-17  Dan Bernstein  <m...@apple.com>
+
+        <rdar://problem/11419933> Problems with flipped writing modes and compositing
+        https://bugs.webkit.org/show_bug.cgi?id=86032
+
+        Reviewed by Anders Carlsson.
+
+        * compositing/bounds-in-flipped-writing-mode-expected.txt: Added.
+        * compositing/bounds-in-flipped-writing-mode.html: Added.
+
 2012-05-17  Peter Kasting  <pkast...@google.com>
 
         [chromium] Prune unnecessary failure expectations.

Added: trunk/LayoutTests/compositing/bounds-in-flipped-writing-mode-expected.txt (0 => 117537)


--- trunk/LayoutTests/compositing/bounds-in-flipped-writing-mode-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/compositing/bounds-in-flipped-writing-mode-expected.txt	2012-05-18 04:33:59 UTC (rev 117537)
@@ -0,0 +1,17 @@
+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (children 1
+        (GraphicsLayer
+          (position 100.00 100.00)
+          (anchor 0.50 0.75)
+          (bounds 100.00 200.00)
+          (drawsContent 1)
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/compositing/bounds-in-flipped-writing-mode.html (0 => 117537)


--- trunk/LayoutTests/compositing/bounds-in-flipped-writing-mode.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/bounds-in-flipped-writing-mode.html	2012-05-18 04:33:59 UTC (rev 117537)
@@ -0,0 +1,13 @@
+<body style="margin: 0; padding: 100px;">
+    <div style="width: 100px; height: 100px; background-color: red;"></div>
+    <div style="width: 100px; height: 100px; -webkit-writing-mode: horizontal-bt; -webkit-transform: translatez(0)">
+        <div style="-webkit-margin-before: 100px; height: 100px; background-color: green;"></div>
+    </div>
+    <pre id="console"></pre>
+    <script>
+        if (window.layoutTestController) {
+            layoutTestController.dumpAsText();
+            document.getElementById("console").appendChild(document.createTextNode(layoutTestController.layerTreeAsText()));
+        }
+    </script>
+</body>

Modified: trunk/Source/WebCore/ChangeLog (117536 => 117537)


--- trunk/Source/WebCore/ChangeLog	2012-05-18 03:39:09 UTC (rev 117536)
+++ trunk/Source/WebCore/ChangeLog	2012-05-18 04:33:59 UTC (rev 117537)
@@ -1,3 +1,16 @@
+2012-05-17  Dan Bernstein  <m...@apple.com>
+
+        <rdar://problem/11419933> Problems with flipped writing modes and compositing
+        https://bugs.webkit.org/show_bug.cgi?id=86032
+
+        Reviewed by Anders Carlsson.
+
+        Test: compositing/bounds-in-flipped-writing-mode.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateLayerBounds): Apply a writing-mode flip to the bounding box
+        if needed.
+
 2012-05-17  Kentaro Hara  <hara...@chromium.org>
 
         [V8][Refactoring] Remove V8Proxy::throwError(const char*, v8::Isolate* = 0)

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (117536 => 117537)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-05-18 03:39:09 UTC (rev 117536)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-05-18 04:33:59 UTC (rev 117537)
@@ -4149,8 +4149,13 @@
 {
     if (!layer->isSelfPaintingLayer())
         return IntRect();
-    
+
     LayoutRect boundingBoxRect = layer->localBoundingBox();
+    if (layer->renderer()->isBox())
+        layer->renderBox()->flipForWritingMode(boundingBoxRect);
+    else
+        layer->renderer()->containingBlock()->flipForWritingMode(boundingBoxRect);
+
     if (layer->renderer()->isRoot()) {
         // If the root layer becomes composited (e.g. because some descendant with negative z-index is composited),
         // then it has to be big enough to cover the viewport in order to display the background. This is akin
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to