mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 06:05:44 +00:00
When dealing with a percentage-width HR, don't let it impact the max-element-size.width inappropriately
This commit is contained in:
parent
50844df3ca
commit
47761f83d7
@ -228,7 +228,16 @@ HRuleFrame::Reflow(nsIPresContext& aPresContext,
|
|||||||
aPresContext.GetScaledPixelsToTwips(p2t);
|
aPresContext.GetScaledPixelsToTwips(p2t);
|
||||||
nscoord onePixel = NSIntPixelsToTwips(1, p2t);
|
nscoord onePixel = NSIntPixelsToTwips(1, p2t);
|
||||||
if (aReflowState.HaveFixedContentWidth()) {
|
if (aReflowState.HaveFixedContentWidth()) {
|
||||||
aDesiredSize.maxElementSize->width = aReflowState.minWidth;
|
const nsStylePosition* pos;
|
||||||
|
GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)pos);
|
||||||
|
if (eStyleUnit_Percent == pos->mWidth.GetUnit()) {
|
||||||
|
// When the HR is using a percentage width, make sure it
|
||||||
|
// remains springy.
|
||||||
|
aDesiredSize.maxElementSize->width = onePixel;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aDesiredSize.maxElementSize->width = aReflowState.minWidth;
|
||||||
|
}
|
||||||
aDesiredSize.maxElementSize->height = onePixel;
|
aDesiredSize.maxElementSize->height = onePixel;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user