Make iframes and objects obey CSS max-width/height and min-width/height if

their sizes are unconstrained.  Bug 181875, r+sr=roc+moz


git-svn-id: svn://10.0.0.236/trunk@141192 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2003-04-15 19:28:06 +00:00
parent 02650524ba
commit eefaa620cb
4 changed files with 36 additions and 12 deletions

View File

@@ -457,13 +457,17 @@ nsHTMLFrameOuterFrame::GetDesiredSize(nsIPresContext* aPresContext,
aDesiredSize.width = aReflowState.mComputedWidth;
}
else {
aDesiredSize.width = NSIntPixelsToTwips(300, p2t);
aDesiredSize.width = PR_MIN(PR_MAX(NSIntPixelsToTwips(300, p2t),
aReflowState.mComputedMinWidth),
aReflowState.mComputedMaxWidth);
}
if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) {
aDesiredSize.height = aReflowState.mComputedHeight;
}
else {
aDesiredSize.height = NSIntPixelsToTwips(150, p2t);
aDesiredSize.height = PR_MIN(PR_MAX(NSIntPixelsToTwips(150, p2t),
aReflowState.mComputedMinHeight),
aReflowState.mComputedMaxHeight);
}
aDesiredSize.ascent = aDesiredSize.height;
aDesiredSize.descent = 0;