REGRESSION (r84096): <br> moved to the right in fast/block/float/032.html
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Apr 2011 02:10:04 +0000 (02:10 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Apr 2011 02:10:04 +0000 (02:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=58736

Reviewed by Maciej Stachowiak.

Source/WebCore:

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::appendFloatingObjectToLastLine): It is enough to extend the float so
that it touches the bottom of the previous line, since RenderBlock::markLinesDirtyInBlockRange()
always dirties the line after the last one in the range.

LayoutTests:

Revert to the correct results.

* platform/chromium-win/fast/block/float/032-expected.txt:
* platform/gtk/fast/block/float/032-expected.txt:
* platform/mac/fast/block/float/032-expected.txt:
* platform/qt/fast/block/float/032-expected.txt:

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

LayoutTests/ChangeLog
LayoutTests/platform/chromium-win/fast/block/float/032-expected.txt
LayoutTests/platform/gtk/fast/block/float/032-expected.txt
LayoutTests/platform/mac/fast/block/float/032-expected.txt
LayoutTests/platform/qt/fast/block/float/032-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlockLineLayout.cpp

index fb9ccae8b5dc0629b6f4136e8725d5b55f1158d8..ecc9362c28a812db390c99d641cfbcc8881fd536 100644 (file)
@@ -1,3 +1,17 @@
+2011-04-17  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        REGRESSION (r84096): <br> moved to the right in fast/block/float/032.html
+        https://bugs.webkit.org/show_bug.cgi?id=58736
+
+        Revert to the correct results.
+
+        * platform/chromium-win/fast/block/float/032-expected.txt:
+        * platform/gtk/fast/block/float/032-expected.txt:
+        * platform/mac/fast/block/float/032-expected.txt:
+        * platform/qt/fast/block/float/032-expected.txt:
+
 2011-04-17  Gavin Peters  <gavinp@chromium.org>
 
         Reviewed by Adam Barth.
index a8e499e3242845c6fff8aabd363260746429bf71..96a6b1ece88547949dbda591c7f9d571276d9c3c 100644 (file)
@@ -35,7 +35,7 @@ layer at (0,0) size 785x1036
         RenderTextControl {INPUT} at (305,5) size 104x106 [bgcolor=#800080] [border: (2px inset #000000)]
         RenderText {#text} at (0,0) size 0x0
       RenderBlock (anonymous) at (0,760) size 769x20
-        RenderBR {BR} at (105,0) size 0x19
+        RenderBR {BR} at (0,0) size 0x19
       RenderBlock {DIV} at (0,780) size 769x110 [border: (5px solid #000000)]
         RenderBlock (floating) {DIV} at (5,5) size 100x100 [bgcolor=#008000]
         RenderTextControl {INPUT} at (55,5) size 104x106 [bgcolor=#800080] [border: (2px inset #000000)]
index 2aa87307197d4824149a759ac41d4304601f0718..08983d3cfa2836ea093cd8d3a633dda7e9eca74c 100644 (file)
@@ -35,7 +35,7 @@ layer at (0,0) size 784x1029
         RenderTextControl {INPUT} at (305,5) size 106x106 [bgcolor=#800080] [border: (2px inset #000000)]
         RenderText {#text} at (0,0) size 0x0
       RenderBlock (anonymous) at (0,755) size 768x19
-        RenderBR {BR} at (105,0) size 0x19
+        RenderBR {BR} at (0,0) size 0x19
       RenderBlock {DIV} at (0,774) size 768x110 [border: (5px solid #000000)]
         RenderBlock (floating) {DIV} at (5,5) size 100x100 [bgcolor=#008000]
         RenderTextControl {INPUT} at (55,5) size 106x106 [bgcolor=#800080] [border: (2px inset #000000)]
index aa2618746a733e5460ee62959e40769de4926f0e..bb82b7cab11f49a12110779fdc8a476864f1cb01 100644 (file)
@@ -35,7 +35,7 @@ layer at (0,0) size 785x1022
         RenderTextControl {INPUT} at (305,5) size 106x106 [bgcolor=#800080] [border: (2px inset #000000)]
         RenderText {#text} at (0,0) size 0x0
       RenderBlock (anonymous) at (0,750) size 769x18
-        RenderBR {BR} at (105,0) size 0x18
+        RenderBR {BR} at (0,0) size 0x18
       RenderBlock {DIV} at (0,768) size 769x110 [border: (5px solid #000000)]
         RenderBlock (floating) {DIV} at (5,5) size 100x100 [bgcolor=#008000]
         RenderTextControl {INPUT} at (55,5) size 106x106 [bgcolor=#800080] [border: (2px inset #000000)]
index 88127ee1444a1ccfeb2d7b79d473ef6e00d1758a..b5a3a33ec7f6f39bb298a199c5ec9ea8773dbd02 100644 (file)
@@ -35,7 +35,7 @@ layer at (0,0) size 800x1029
         RenderTextControl {INPUT} at (305,5) size 106x106 [border: (2px inset #000000)]
         RenderText {#text} at (0,0) size 0x0
       RenderBlock (anonymous) at (0,755) size 784x19
-        RenderBR {BR} at (105,0) size 0x19
+        RenderBR {BR} at (0,0) size 0x19
       RenderBlock {DIV} at (0,774) size 784x110 [border: (5px solid #000000)]
         RenderBlock (floating) {DIV} at (5,5) size 100x100 [bgcolor=#008000]
         RenderTextControl {INPUT} at (55,5) size 106x106 [border: (2px inset #000000)]
index e62a724b9a66140ffdfbfa8508c8da6c99ef8c1d..c9236c77e021a3bead55d1d2705df00b9814da70 100644 (file)
@@ -1,3 +1,15 @@
+2011-04-17  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        REGRESSION (r84096): <br> moved to the right in fast/block/float/032.html
+        https://bugs.webkit.org/show_bug.cgi?id=58736
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlock::appendFloatingObjectToLastLine): It is enough to extend the float so
+        that it touches the bottom of the previous line, since RenderBlock::markLinesDirtyInBlockRange()
+        always dirties the line after the last one in the range.
+
 2011-04-17  Patrick Gansterer  <paroga@webkit.org>
 
         Unreviewed. Add missing include to fix build without precompiled header.
index d00ddbabe1dda94966a24317fcdc044558812855..f305c869c2521304c3c57f418b5d3fc5bf0b1002 100644 (file)
@@ -717,8 +717,10 @@ inline BidiRun* RenderBlock::handleTrailingSpaces(BidiRunList<BidiRun>& bidiRuns
 void RenderBlock::appendFloatingObjectToLastLine(FloatingObject* floatingObject)
 {
     // Ensure that the float touches the line.
-    if (logicalBottomForFloat(floatingObject) < lastRootBox()->blockLogicalHeight())
-        setLogicalHeightForFloat(floatingObject, lastRootBox()->blockLogicalHeight() - logicalTopForFloat(floatingObject));
+    if (RootInlineBox* previousLine = lastRootBox()->prevRootBox()) {
+        if (logicalBottomForFloat(floatingObject) < previousLine->blockLogicalHeight())
+            setLogicalHeightForFloat(floatingObject, previousLine->blockLogicalHeight() - logicalTopForFloat(floatingObject));
+    }
 
     lastRootBox()->appendFloat(floatingObject->renderer());
 }