Bug 957396 - Enlarge container constraints when MinSize is bigger than MaxSize. r=enndeakin

This commit is contained in:
Martin Stransky 2014-06-11 05:03:00 +02:00
parent 85a5bc6e6a
commit 1b61f13108

View File

@ -675,6 +675,13 @@ void nsContainerFrame::SetSizeConstraints(nsPresContext* aPresContext,
aPresContext->AppUnitsToDevPixels(aMaxSize.width),
aMaxSize.height == NS_INTRINSICSIZE ? NS_MAXSIZE :
aPresContext->AppUnitsToDevPixels(aMaxSize.height));
// MinSize has a priority over MaxSize
if (devMinSize.width > devMaxSize.width)
devMaxSize.width = devMinSize.width;
if (devMinSize.height > devMaxSize.height)
devMaxSize.height = devMinSize.height;
widget::SizeConstraints constraints(devMinSize, devMaxSize);
// The sizes are in inner window sizes, so convert them into outer window sizes.