Fix for bug 3969, hr width doesn't update when it clears a float. This
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Sep 2006 19:12:44 +0000 (19:12 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Sep 2006 19:12:44 +0000 (19:12 +0000)
        was also a problem with tables and overflow sections.

        Reviewed by Eric

        Added fast/block/float/width-update-after-clear.html

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::collapseMargins):
        (WebCore::RenderBlock::clearFloatsIfNeeded):

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

WebCore/ChangeLog
WebCore/rendering/RenderBlock.cpp

index a83a668ed5134501aa1eb7b6a84621dfcf7d3ef0..3236821caed5fc9c9c1f892d9bef37454524cab3 100644 (file)
@@ -1,3 +1,16 @@
+2006-09-18  David Hyatt  <hyatt@apple.com>
+
+        Fix for bug 3969, hr width doesn't update when it clears a float.  This
+        was also a problem with tables and overflow sections.
+
+        Reviewed by Eric
+
+        Added fast/block/float/width-update-after-clear.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::collapseMargins):
+        (WebCore::RenderBlock::clearFloatsIfNeeded):
+
 2006-09-18  Brady Eidson  <beidson@apple.com>
 
         Reviewed by John
index 23e7b7d410e97994e5e9b56a46e6c383034bb7ad..b09faa117b317f2e27b594edf4b5b385842ff593 100644 (file)
@@ -836,7 +836,7 @@ void RenderBlock::collapseMargins(RenderObject* child, MarginInfo& marginInfo, i
 
     child->setPos(child->xPos(), ypos);
     if (ypos != yPosEstimate) {
-        if (child->style()->width().isPercent() && child->usesLineWidth())
+        if ((child->style()->width().isPercent() || child->style()->width().isAuto()) && child->usesLineWidth())
             // The child's width is a percentage of the line width.
             // When the child shifts to clear an item, its width can
             // change (because it has more available line width).
@@ -884,7 +884,7 @@ void RenderBlock::clearFloatsIfNeeded(RenderObject* child, MarginInfo& marginInf
         // If our value of clear caused us to be repositioned vertically to be
         // underneath a float, we might have to do another layout to take into account
         // the extra space we now have available.
-        if (child->style()->width().isPercent() && child->usesLineWidth())
+        if ((child->style()->width().isPercent() || child->style()->width().isAuto()) && child->usesLineWidth())
             // The child's width is a percentage of the line width.
             // When the child shifts to clear an item, its width can
             // change (because it has more available line width).