There is no height greater than unconstrained height, bug 402872, r/sr=roc a=beltzner

This commit is contained in:
bmlk@gmx.de 2008-03-08 01:12:30 -08:00
parent a3e45a4145
commit a9dad73560
2 changed files with 24 additions and 1 deletions

View File

@ -220,6 +220,29 @@ NSCoordSaturatingSubtract(nscoord a, nscoord b,
}
#endif
}
/** compare against a nscoord "b", which might be unconstrained
* "a" must not be unconstrained.
* Every number is smaller than a unconstrained one
*/
inline PRBool
NSCoordLessThan(nscoord a,nscoord b)
{
NS_ASSERTION(a != nscoord_MAX,
"This coordinate should be constrained");
return ((a < b) || (b == nscoord_MAX));
}
/** compare against a nscoord "b", which might be unconstrained
* "a" must not be unconstrained
* No number is larger than a unconstrained one.
*/
inline PRBool
NSCoordGreaterThan(nscoord a,nscoord b)
{
NS_ASSERTION(a != nscoord_MAX,
"This coordinate should be constrained");
return ((a > b) && (b != nscoord_MAX));
}
/**
* Convert an nscoord to a PRInt32. This *does not* do rounding because

View File

@ -635,7 +635,7 @@ nsBlockReflowState::CanPlaceFloat(const nsSize& aFloatSize,
// At this point we know that there is enough horizontal space for
// the float (somewhere). Lets see if there is enough vertical
// space.
if (mAvailSpaceRect.height < aFloatSize.height) {
if (NSCoordGreaterThan(aFloatSize.height, mAvailSpaceRect.height)) {
// The available height is too short. However, its possible that
// there is enough open space below which is not impacted by a
// float.