Introduce nsStyleCoord::HasPercent to check for either a percent value or a calc() value containing a percent. (Bug 585715) r=bzbarsky a2.0=blocking+

This commit is contained in:
L. David Baron
2010-08-25 12:17:55 +02:00
parent 3a6e38156a
commit bd750d1204
4 changed files with 9 additions and 8 deletions

View File

@@ -143,11 +143,9 @@ inline PRBool HaveFixedSize(const nsHTMLReflowState& aReflowState)
// see bug 156731
const nsStyleCoord &height = aReflowState.mStylePosition->mHeight;
const nsStyleCoord &width = aReflowState.mStylePosition->mWidth;
return (((eStyleUnit_Percent == height.GetUnit() ||
(height.IsCalcUnit() && height.CalcHasPercent())) &&
return ((height.HasPercent() &&
NS_UNCONSTRAINEDSIZE == aReflowState.ComputedHeight()) ||
((eStyleUnit_Percent == width.GetUnit() ||
(width.IsCalcUnit() && width.CalcHasPercent())) &&
(width.HasPercent() &&
(NS_UNCONSTRAINEDSIZE == aReflowState.ComputedWidth() ||
0 == aReflowState.ComputedWidth())))
? PR_FALSE