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 09:12:30 +00:00
Родитель 1a8e4edc41
Коммит f2715a3d97
2 изменённых файлов: 24 добавлений и 1 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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.