WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2007 08:11:58 +0000 (08:11 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2007 08:11:58 +0000 (08:11 +0000)
        Reviewed by Brady Eidson.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15877
          REGRESSION: r27486 caused a layout regression at my bank's website

        Test: fast/block/float/overhanging-after-height-decrease-offsets.html

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::layoutBlock):

LayoutTests:

        Reviewed by Brady Eidson.

        - test for http://bugs.webkit.org/show_bug.cgi?id=15877
          REGRESSION: r27486 caused a layout regression at my bank's website

        * fast/block/float/overhanging-after-height-decrease-offsets.html: Added.
        * platform/mac-leopard/fast/block/float/overhanging-after-height-decrease-offsets-expected.checksum: Added.
        * platform/mac-leopard/fast/block/float/overhanging-after-height-decrease-offsets-expected.png: Added.
        * platform/mac/fast/block/float/overhanging-after-height-decrease-offsets-expected.txt: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/block/float/overhanging-after-height-decrease-offsets.html [new file with mode: 0644]
LayoutTests/platform/mac-leopard/fast/block/float/overhanging-after-height-decrease-offsets-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac-leopard/fast/block/float/overhanging-after-height-decrease-offsets-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/block/float/overhanging-after-height-decrease-offsets-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderBlock.cpp

index 0d94bdfdd343560286cd25378198bbe26e4200a5..6c5880abb2b6b2f2cf0316387a2dd379ec4caf12 100644 (file)
@@ -1,3 +1,15 @@
+2007-11-07  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Brady Eidson.
+
+        - test for http://bugs.webkit.org/show_bug.cgi?id=15877
+          REGRESSION: r27486 caused a layout regression at my bank's website
+
+        * fast/block/float/overhanging-after-height-decrease-offsets.html: Added.
+        * platform/mac-leopard/fast/block/float/overhanging-after-height-decrease-offsets-expected.checksum: Added.
+        * platform/mac-leopard/fast/block/float/overhanging-after-height-decrease-offsets-expected.png: Added.
+        * platform/mac/fast/block/float/overhanging-after-height-decrease-offsets-expected.txt: Added.
+
 2007-11-06  Adam Roben  <aroben@apple.com>
 
         Move a Mac-specific test to platform/mac
diff --git a/LayoutTests/fast/block/float/overhanging-after-height-decrease-offsets.html b/LayoutTests/fast/block/float/overhanging-after-height-decrease-offsets.html
new file mode 100644 (file)
index 0000000..3278f2f
--- /dev/null
@@ -0,0 +1,6 @@
+<div style="height: 50px;">
+    <div style="margin-left: 150px;">
+        <div style="height: 100px; float: left; width: 100px; background-color: green;"></div>
+        <div style="height: 100px; width: 100px; background-color: red;"></div>
+    </div>
+</div>
diff --git a/LayoutTests/platform/mac-leopard/fast/block/float/overhanging-after-height-decrease-offsets-expected.checksum b/LayoutTests/platform/mac-leopard/fast/block/float/overhanging-after-height-decrease-offsets-expected.checksum
new file mode 100644 (file)
index 0000000..9897764
--- /dev/null
@@ -0,0 +1 @@
+11ce08b9cf1e9539138f5d8e4efd8f64
\ No newline at end of file
diff --git a/LayoutTests/platform/mac-leopard/fast/block/float/overhanging-after-height-decrease-offsets-expected.png b/LayoutTests/platform/mac-leopard/fast/block/float/overhanging-after-height-decrease-offsets-expected.png
new file mode 100644 (file)
index 0000000..8068a01
Binary files /dev/null and b/LayoutTests/platform/mac-leopard/fast/block/float/overhanging-after-height-decrease-offsets-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/block/float/overhanging-after-height-decrease-offsets-expected.txt b/LayoutTests/platform/mac/fast/block/float/overhanging-after-height-decrease-offsets-expected.txt
new file mode 100644 (file)
index 0000000..45775fc
--- /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 784x50
+        RenderBlock {DIV} at (150,0) size 634x100
+          RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+          RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
index e11e76e2580b0bd04f6ac629d05633fb6c5d4d67..b094e4ffd3ca1e3b7bf1961619b292655ede3988 100644 (file)
@@ -1,3 +1,15 @@
+2007-11-07  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Brady Eidson.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=15877
+          REGRESSION: r27486 caused a layout regression at my bank's website
+
+        Test: fast/block/float/overhanging-after-height-decrease-offsets.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::layoutBlock):
+
 2007-11-06  Beth Dakin  <bdakin@apple.com>
 
         Reviewed by Sam.
index 1b5a3b92caa5b898ff060dce7a278ba4740a0ace..2f256de2731bf9659992a09fa7e5f5a667818d66 100644 (file)
@@ -603,7 +603,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
                 if (child->isBlockFlow() && !child->isFloatingOrPositioned()) {
                     RenderBlock* block = static_cast<RenderBlock*>(child);
                     if (block->floatBottom() + block->yPos() > m_height)
-                        addOverhangingFloats(block, block->xPos(), block->yPos());
+                        addOverhangingFloats(block, -block->xPos(), -block->yPos());
                 }
             }
         }