зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1315383 part 3 - [css-grid] Don't try to preserve intrinsic ratio when applying min/max-size, if either axis has 'stretch' alignment. r=dholbert
This commit is contained in:
Родитель
945854bec6
Коммит
24c2d68059
|
@ -5224,7 +5224,13 @@ nsFrame::ComputeSizeWithIntrinsicDimensions(nsRenderingContext* aRenderingConte
|
|||
tentISize = NSCoordMulDiv(bSize, logicalRatio.ISize(aWM), logicalRatio.BSize(aWM));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ComputeAutoSizeWithIntrinsicDimensions preserves the ratio when applying
|
||||
// the min/max-size. We don't want that when we have 'stretch' in either
|
||||
// axis because tentISize/tentBSize is likely not according to ratio now.
|
||||
if (aIntrinsicRatio != nsSize(0, 0) &&
|
||||
stretchI != eStretch && stretchB != eStretch) {
|
||||
nsSize autoSize = nsLayoutUtils::
|
||||
ComputeAutoSizeWithIntrinsicDimensions(minISize, minBSize,
|
||||
maxISize, maxBSize,
|
||||
|
@ -5236,11 +5242,7 @@ nsFrame::ComputeSizeWithIntrinsicDimensions(nsRenderingContext* aRenderingConte
|
|||
iSize = autoSize.width;
|
||||
bSize = autoSize.height;
|
||||
} else {
|
||||
// No intrinsic ratio, so just clamp the dimensions
|
||||
// independently without calling
|
||||
// ComputeAutoSizeWithIntrinsicDimensions, which deals with
|
||||
// propagating these changes to the other dimension (and would
|
||||
// be incorrect when there is no intrinsic ratio).
|
||||
// Not honoring an intrinsic ratio: clamp the dimensions independently.
|
||||
iSize = NS_CSS_MINMAX(tentISize, minISize, maxISize);
|
||||
bSize = NS_CSS_MINMAX(tentBSize, minBSize, maxBSize);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче