REGRESSION (r96620): Float-avoiding block positioned incorrectly in right-to-left...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Oct 2011 15:55:33 +0000 (15:55 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Oct 2011 15:55:33 +0000 (15:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=70197

Reviewed by Dave Kilzer.

Source/WebCore:

Test: fast/block/float/avoidance-rtl.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats): Changed
logicalLeftOffsetForContent() to startOffsetForContent() to get the right value in the
right-to-left case.

LayoutTests:

* fast/block/float/avoidance-rtl-expected.png: Added.
* fast/block/float/avoidance-rtl-expected.txt: Added.
* fast/block/float/avoidance-rtl.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/block/float/avoidance-rtl-expected.png [new file with mode: 0644]
LayoutTests/fast/block/float/avoidance-rtl-expected.txt [new file with mode: 0644]
LayoutTests/fast/block/float/avoidance-rtl.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp

index 3f1f5c39e21dd9580f3bdeb525f125fbade29fea..38f323c843be16aa0cfbb63729c15b68db456394 100644 (file)
@@ -1,3 +1,14 @@
+2011-10-16  Dan Bernstein  <mitz@apple.com>
+
+        REGRESSION (r96620): Float-avoiding block positioned incorrectly in right-to-left block
+        https://bugs.webkit.org/show_bug.cgi?id=70197
+
+        Reviewed by Dave Kilzer.
+
+        * fast/block/float/avoidance-rtl-expected.png: Added.
+        * fast/block/float/avoidance-rtl-expected.txt: Added.
+        * fast/block/float/avoidance-rtl.html: Added.
+
 2011-10-16  Adam Barth  <abarth@webkit.org>
 
         Always enable ENABLE(DOM_STORAGE)
diff --git a/LayoutTests/fast/block/float/avoidance-rtl-expected.png b/LayoutTests/fast/block/float/avoidance-rtl-expected.png
new file mode 100644 (file)
index 0000000..3a9dc72
Binary files /dev/null and b/LayoutTests/fast/block/float/avoidance-rtl-expected.png differ
diff --git a/LayoutTests/fast/block/float/avoidance-rtl-expected.txt b/LayoutTests/fast/block/float/avoidance-rtl-expected.txt
new file mode 100644 (file)
index 0000000..c452049
--- /dev/null
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 250x100 [bgcolor=#FF0000] [border: (50px solid #008000)]
+        RenderBlock (floating) {DIV} at (150,0) size 100x100 [bgcolor=#008000]
+layer at (58,8) size 100x100
+  RenderBlock {DIV} at (50,0) size 100x100 [bgcolor=#008000]
diff --git a/LayoutTests/fast/block/float/avoidance-rtl.html b/LayoutTests/fast/block/float/avoidance-rtl.html
new file mode 100644 (file)
index 0000000..8cd231e
--- /dev/null
@@ -0,0 +1,4 @@
+<div style="border-left: 50px solid green; direction: rtl; width: 200; background-color: red;">\r
+    <div style="background-color: green; width: 100px; height: 100px; float: right;"></div>\r
+    <div style="overflow: hidden; background-color: green; height: 100px; width: 100px;"></div>\r
+</div>\r
index 7fb0afcf31f0f32de181841553238e31675a9898..efe17a71fd0e445b79330e617fb6c0d3b4c81236 100644 (file)
@@ -1,3 +1,17 @@
+2011-10-16  Dan Bernstein  <mitz@apple.com>
+
+        REGRESSION (r96620): Float-avoiding block positioned incorrectly in right-to-left block
+        https://bugs.webkit.org/show_bug.cgi?id=70197
+
+        Reviewed by Dave Kilzer.
+
+        Test: fast/block/float/avoidance-rtl.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats): Changed
+        logicalLeftOffsetForContent() to startOffsetForContent() to get the right value in the
+        right-to-left case.
+
 2011-10-16  Adam Barth  <abarth@webkit.org>
 
         Always enable ENABLE(DOM_STORAGE)
index 4671bd2d9fc06a3f3e2cb5954fa0b58ee86378f2..406a4046c6bc8761b59560604f15cc4f2d6ddbe2 100644 (file)
@@ -1812,7 +1812,7 @@ LayoutUnit RenderBlock::estimateLogicalTopPosition(RenderBox* child, const Margi
 LayoutUnit RenderBlock::computeStartPositionDeltaForChildAvoidingFloats(const RenderBox* child, LayoutUnit childMarginStart,
     LayoutUnit childLogicalWidth, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage)
 {
-    LayoutUnit startPosition = logicalLeftOffsetForContent(region, offsetFromLogicalTopOfFirstPage);
+    LayoutUnit startPosition = startOffsetForContent(region, offsetFromLogicalTopOfFirstPage);
 
     // Add in our start margin.
     LayoutUnit oldPosition = startPosition + childMarginStart;