[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

mitz at apple.com mitz at apple.com
Thu Apr 8 00:49:20 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 180f5c263f4391bdf9086ecf0a3e63b2210e4748
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Dec 27 01:27:29 2009 +0000

    REGRESSION (r47255): Extra Large Amount of Empty Space
    https://bugs.webkit.org/show_bug.cgi?id=32690
    
    Reviewed by Sam Weinig.
    
    WebCore:
    
    Test: fast/block/float/clear-to-fit.html
    
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::getClearDelta): Only clear floats as needed to
    fit the child on the line.
    
    LayoutTests:
    
    * fast/block/float/clear-to-fit-expected.checksum: Added.
    * fast/block/float/clear-to-fit-expected.png: Added.
    * fast/block/float/clear-to-fit-expected.txt: Added.
    * fast/block/float/clear-to-fit.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52566 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index f719c02..9fc72a4 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2009-12-26  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        REGRESSION (r47255): Extra Large Amount of Empty Space
+        https://bugs.webkit.org/show_bug.cgi?id=32690
+
+        * fast/block/float/clear-to-fit-expected.checksum: Added.
+        * fast/block/float/clear-to-fit-expected.png: Added.
+        * fast/block/float/clear-to-fit-expected.txt: Added.
+        * fast/block/float/clear-to-fit.html: Added.
+
 2009-12-26  Csaba Osztrogonác  <ossy at webkit.org>
 
         Rubber-stamped by Simon Hausmann.
diff --git a/LayoutTests/fast/block/float/clear-to-fit-expected.checksum b/LayoutTests/fast/block/float/clear-to-fit-expected.checksum
new file mode 100644
index 0000000..3076902
--- /dev/null
+++ b/LayoutTests/fast/block/float/clear-to-fit-expected.checksum
@@ -0,0 +1 @@
+68d6c025804146a572d271275673ee4c
\ No newline at end of file
diff --git a/LayoutTests/fast/block/float/clear-to-fit-expected.png b/LayoutTests/fast/block/float/clear-to-fit-expected.png
new file mode 100644
index 0000000..8aa9589
Binary files /dev/null and b/LayoutTests/fast/block/float/clear-to-fit-expected.png differ
diff --git a/LayoutTests/fast/block/float/clear-to-fit-expected.txt b/LayoutTests/fast/block/float/clear-to-fit-expected.txt
new file mode 100644
index 0000000..34d2a31
--- /dev/null
+++ b/LayoutTests/fast/block/float/clear-to-fit-expected.txt
@@ -0,0 +1,14 @@
+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 100x50
+      RenderBlock (floating) {DIV} at (0,50) size 50x50
+        RenderBlock {DIV} at (50,0) size 50x50 [bgcolor=#008000]
+      RenderBlock {DIV} at (0,0) size 150x150
+        RenderTable {TABLE} at (50,50) size 100x100
+          RenderTableSection {TBODY} at (0,0) size 100x100
+            RenderTableRow {TR} at (0,0) size 100x100
+              RenderTableCell {TD} at (0,0) size 100x50 [r=0 c=0 rs=1 cs=1]
+                RenderBlock {DIV} at (0,0) size 50x50 [bgcolor=#FF0000]
diff --git a/LayoutTests/fast/block/float/clear-to-fit.html b/LayoutTests/fast/block/float/clear-to-fit.html
new file mode 100644
index 0000000..b2d0646
--- /dev/null
+++ b/LayoutTests/fast/block/float/clear-to-fit.html
@@ -0,0 +1,9 @@
+<div style="float: left; width: 100px; height: 50px;"></div>
+<div style="float: left; clear: both; width: 50px; height: 50px;">
+    <div style="width: 50px; height: 50px; background-color: green; margin-left: 50px"></div>
+</div>
+<div style="width: 150px;">
+    <table cellpadding="0" style="width: 100px; height: 100px; border-collapse: collapse;"><tr><td style="vertical-align: top;">
+        <div style="background-color: red; width: 50px; height: 50px;"></div>
+    </td></tr></table>
+</div>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index cb5d619..5339bb2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-12-26  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        REGRESSION (r47255): Extra Large Amount of Empty Space
+        https://bugs.webkit.org/show_bug.cgi?id=32690
+
+        Test: fast/block/float/clear-to-fit.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::getClearDelta): Only clear floats as needed to
+        fit the child on the line.
+
 2009-12-25  Kent Tamura  <tkent at chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index 0b2345a..d7061d1 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -3191,22 +3191,35 @@ int RenderBlock::getClearDelta(RenderBox* child, int yPos)
     }
 
     // We also clear floats if we are too big to sit on the same line as a float (and wish to avoid floats by default).
-    // FIXME: Note that the remaining space checks aren't quite accurate, since you should be able to clear only some floats (the minimum # needed
-    // to fit) and not all (we should be using nextFloatBottomBelow and looping).
     int result = clearSet ? max(0, bottom - yPos) : 0;
     if (!result && child->avoidsFloats()) {
-        int widthAtCurrentHeight = lineWidth(yPos, false);
         int availableWidth = this->availableWidth();
-        if (widthAtCurrentHeight < availableWidth) {
-            int oldYPos = child->y();
-            int oldWidth = child->width();
-            child->setY(yPos);
+        if (child->minPrefWidth() > availableWidth)
+            return 0;
+
+        int y = yPos;
+        while (true) {
+            int widthAtY = lineWidth(y, false);
+            if (widthAtY == availableWidth)
+                return y - yPos;
+
+            int oldChildY = child->y();
+            int oldChildWidth = child->width();
+            child->setY(y);
             child->calcWidth();
-            if (child->width() > widthAtCurrentHeight && child->minPrefWidth() <= availableWidth)
-                result = max(0, floatBottom() - yPos);
-            child->setY(oldYPos);
-            child->setWidth(oldWidth);
+            int childWidthAtY = child->width();
+            child->setY(oldChildY);
+            child->setWidth(oldChildWidth);
+
+            if (childWidthAtY <= widthAtY)
+                return y - yPos;
+
+            y = nextFloatBottomBelow(y);
+            ASSERT(y >= yPos);
+            if (y < yPos)
+                break;
         }
+        ASSERT_NOT_REACHED();
     }
     return result;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list