Don't switch a constrained height to an unconstrained one due to infinite clearance. Fixes layout/reftests/bugs/563584-10b.html . (Bug 563584, patch 29) r=roc
authorL. David Baron <dbaron@dbaron.org>
Thu, 05 Aug 2010 21:59:20 -0700
changeset 49006 b400d1c5b8427efc499ff390453c1fb8f1faed67
parent 49005 06e99be6239a1b773a43da1c46c4988e29ac4396
child 49007 4944a7440b5574001613ffea9e905e43621f389f
push id14884
push userdbaron@mozilla.com
push dateFri, 06 Aug 2010 05:01:26 +0000
treeherderautoland@8ab7ef79b673 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs563584
milestone2.0b4pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Don't switch a constrained height to an unconstrained one due to infinite clearance. Fixes layout/reftests/bugs/563584-10b.html . (Bug 563584, patch 29) r=roc
layout/generic/nsBlockFrame.cpp
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -3082,16 +3082,24 @@ nsBlockFrame::ReflowBlockFrame(nsBlockRe
                                   replacedBlock != nsnull, availSpace);
     
     // Now put the Y coordinate back to the top of the top-margin +
     // clearance, and flow the block.
     aState.mY -= topMargin;
     availSpace.y -= topMargin;
     if (NS_UNCONSTRAINEDSIZE != availSpace.height) {
       availSpace.height += topMargin;
+
+      // When there is a pushed float, clearance could equal
+      // NS_UNCONSTRAINEDSIZE (FIXME: is that really a good idea?), but
+      // we don't want that to change a constrained height to an
+      // unconstrained one.
+      if (NS_UNCONSTRAINEDSIZE == availSpace.height) {
+        --availSpace.height;
+      }
     }
     
     // Reflow the block into the available space
     // construct the html reflow state for the block. ReflowBlock 
     // will initialize it
     nsHTMLReflowState blockHtmlRS(aState.mPresContext, aState.mReflowState, frame, 
                                   nsSize(availSpace.width, availSpace.height));
     blockHtmlRS.mFlags.mHasClearance = aLine->HasClearance();