<rdar://problem/11787030> In vertical writing modes, child following float-clearing...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Jul 2012 19:11:31 +0000 (19:11 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Jul 2012 19:11:31 +0000 (19:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=90359

Reviewed by Anders Carlsson.

Source/WebCore:

Test: fast/writing-mode/logical-height-after-clear.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::clearFloatsIfNeeded): Changed to use logicalTop() and logicalHeight()
instead of y() and height().

LayoutTests:

* fast/writing-mode/logical-height-after-clear-expected.html: Added.
* fast/writing-mode/logical-height-after-clear.html: Added.
* platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.png:
* platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.txt:
* platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.png:
* platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.txt:

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

LayoutTests/ChangeLog
LayoutTests/fast/writing-mode/logical-height-after-clear-expected.html [new file with mode: 0644]
LayoutTests/fast/writing-mode/logical-height-after-clear.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.png
LayoutTests/platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.txt
LayoutTests/platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.png
LayoutTests/platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp

index 150b667..7949469 100644 (file)
@@ -1,3 +1,17 @@
+2012-07-02  Dan Bernstein  <mitz@apple.com>
+
+        <rdar://problem/11787030> In vertical writing modes, child following float-clearing block has incorrect logical top
+        https://bugs.webkit.org/show_bug.cgi?id=90359
+
+        Reviewed by Anders Carlsson.
+
+        * fast/writing-mode/logical-height-after-clear-expected.html: Added.
+        * fast/writing-mode/logical-height-after-clear.html: Added.
+        * platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.png:
+        * platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.txt:
+        * platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.png:
+        * platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.txt:
+
 2012-07-02  Zan Dobersek  <zandobersek@gmail.com>
 
         [Gtk] Many tests revealed as passing after moving from Skipped to test_expectations.txt
diff --git a/LayoutTests/fast/writing-mode/logical-height-after-clear-expected.html b/LayoutTests/fast/writing-mode/logical-height-after-clear-expected.html
new file mode 100644 (file)
index 0000000..3651849
--- /dev/null
@@ -0,0 +1,35 @@
+<style>
+    div.test {
+        -webkit-logical-width: 50px;
+        -webkit-logical-height: 100px;
+        background-color: green;
+    }
+
+    div.green {
+        background-color: blue;
+        -webkit-logical-height: 50px;
+    }
+
+    div.lr {
+        -webkit-writing-mode: vertical-lr;
+    }
+
+    div.rl {
+        -webkit-writing-mode: vertical-rl;
+    }
+</style>
+<div class="test lr">
+    <div class="green"></div>
+</div>
+
+<div class="test lr">
+    <div class="green"></div>
+</div>
+
+<div class="test rl">
+    <div class="green"></div>
+</div>
+
+<div class="test rl">
+    <div class="green"></div>
+</div>
diff --git a/LayoutTests/fast/writing-mode/logical-height-after-clear.html b/LayoutTests/fast/writing-mode/logical-height-after-clear.html
new file mode 100644 (file)
index 0000000..30a187e
--- /dev/null
@@ -0,0 +1,56 @@
+<style>
+    div.test {
+        -webkit-logical-width: 50px;
+        -webkit-logical-height: 100px;
+        background-color: red;
+    }
+
+    div.float {
+        float: left;
+        -webkit-logical-height: 50px;
+        -webkit-logical-width: 50px;
+        background-color: blue;
+    }
+
+    div.clear {
+        clear: left;
+    }
+
+    div.green {
+        background-color: green;
+        -webkit-logical-height: 25px;
+    }
+
+    div.lr {
+        -webkit-writing-mode: vertical-lr;
+    }
+
+    div.rl {
+        -webkit-writing-mode: vertical-rl;
+    }
+</style>
+<div class="test lr">
+    <div class="float"></div>
+    <div class="clear"></div>
+    <div class="green"></div>
+    <div class="green"></div>
+</div>
+
+<div class="test lr">
+    <div class="float"></div>
+    <div class="clear green"></div>
+    <div class="green"></div>
+</div>
+
+<div class="test rl">
+    <div class="float"></div>
+    <div class="clear"></div>
+    <div class="green"></div>
+    <div class="green"></div>
+</div>
+
+<div class="test rl">
+    <div class="float"></div>
+    <div class="clear green"></div>
+    <div class="green"></div>
+</div>
index 59f69d4..afcc88e 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.png and b/LayoutTests/platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.png differ
index 524a526..cf67ad9 100644 (file)
@@ -1,8 +1,8 @@
-layer at (0,0) size 827x585
-  RenderView at (0,0) size 800x585
-layer at (0,0) size 827x585
-  RenderBlock {HTML} at (0,0) size 827x585
-    RenderBody {BODY} at (8,8) size 811x569
+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 (floating) {DIV} at (0,0) size 100x200 [bgcolor=#00FF00]
 layer at (108,8) size 142x435
   RenderBlock {DIV} at (100,0) size 142x435 [border: (10px solid #000000)]
index b21d0d2..774b6b0 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.png and b/LayoutTests/platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.png differ
index 8afaae8..090acd6 100644 (file)
@@ -1,8 +1,8 @@
-layer at (0,0) size 827x585
-  RenderView at (0,0) size 800x585
-layer at (-27,0) size 827x585 backgroundClip at (0,0) size 827x585 clip at (0,0) size 827x585 outlineClip at (0,0) size 827x585
-  RenderBlock {HTML} at (0,0) size 827x585
-    RenderBody {BODY} at (8,8) size 811x569
+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 (floating) {DIV} at (0,0) size 100x200 [bgcolor=#00FF00]
 layer at (550,8) size 142x435
   RenderBlock {DIV} at (100,0) size 142x435 [border: (10px solid #000000)]
index b7ef7c0..1f7c06b 100644 (file)
@@ -1,3 +1,16 @@
+2012-07-02  Dan Bernstein  <mitz@apple.com>
+
+        <rdar://problem/11787030> In vertical writing modes, child following float-clearing block has incorrect logical top
+        https://bugs.webkit.org/show_bug.cgi?id=90359
+
+        Reviewed by Anders Carlsson.
+
+        Test: fast/writing-mode/logical-height-after-clear.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::clearFloatsIfNeeded): Changed to use logicalTop() and logicalHeight()
+        instead of y() and height().
+
 2012-07-02  Arko Saha  <arko@motorola.com>
 
         Microdata: Fix build failure after r121580.
index f448301..f17836d 100755 (executable)
@@ -2071,10 +2071,10 @@ LayoutUnit RenderBlock::clearFloatsIfNeeded(RenderBox* child, MarginInfo& margin
         
         // Adjust our height such that we are ready to be collapsed with subsequent siblings (or the bottom
         // of the parent block).
-        setLogicalHeight(child->y() - max(ZERO_LAYOUT_UNIT, marginInfo.margin()));
+        setLogicalHeight(child->logicalTop() - max(ZERO_LAYOUT_UNIT, marginInfo.margin()));
     } else
         // Increase our height by the amount we had to clear.
-        setLogicalHeight(height() + heightIncrease);
+        setLogicalHeight(logicalHeight() + heightIncrease);
     
     if (marginInfo.canCollapseWithMarginBefore()) {
         // We can no longer collapse with the top of the block since a clear