mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-05 16:22:53 +00:00
b=23707. Made sure HR frame correctly computes max-element-size
when it has an 'auto' width
This commit is contained in:
parent
244a57d9b2
commit
0cba827c69
@ -230,9 +230,10 @@ HRuleFrame::Reflow(nsIPresContext* aPresContext,
|
||||
if (nsnull != aDesiredSize.maxElementSize) {
|
||||
nscoord onePixel = NSIntPixelsToTwips(1, p2t);
|
||||
if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) {
|
||||
if (eStyleUnit_Percent ==
|
||||
aReflowState.mStylePosition->mWidth.GetUnit()) {
|
||||
// When the HR is using a percentage width, make sure it
|
||||
nsStyleUnit widthUnit = aReflowState.mStylePosition->mWidth.GetUnit();
|
||||
if ((eStyleUnit_Percent == widthUnit) ||
|
||||
(eStyleUnit_Auto == widthUnit)) {
|
||||
// When the HR is using an 'auto' or percentage width, make sure it
|
||||
// remains springy.
|
||||
aDesiredSize.maxElementSize->width = onePixel;
|
||||
}
|
||||
|
@ -1278,7 +1278,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
|
||||
// layout strategy will compute a different maximum content width than we
|
||||
// computed for the initial reflow. That's because the table layout
|
||||
// strategy doesn't check whether the cell is auto-width...
|
||||
desiredSize.mMaximumWidth = desiredSize.width;
|
||||
desiredSize.mMaximumWidth = PR_MIN(desiredSize.mMaximumWidth, desiredSize.width);
|
||||
}
|
||||
((nsTableCellFrame *)aNextFrame)->SetMaximumWidth(desiredSize.mMaximumWidth);
|
||||
if (oldMaximumWidth != desiredSize.mMaximumWidth) {
|
||||
|
@ -1278,7 +1278,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
|
||||
// layout strategy will compute a different maximum content width than we
|
||||
// computed for the initial reflow. That's because the table layout
|
||||
// strategy doesn't check whether the cell is auto-width...
|
||||
desiredSize.mMaximumWidth = desiredSize.width;
|
||||
desiredSize.mMaximumWidth = PR_MIN(desiredSize.mMaximumWidth, desiredSize.width);
|
||||
}
|
||||
((nsTableCellFrame *)aNextFrame)->SetMaximumWidth(desiredSize.mMaximumWidth);
|
||||
if (oldMaximumWidth != desiredSize.mMaximumWidth) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user