Revert D4157971: [csslayout] BREAKING - Fix sizing of container with child overflowing parent
Differential Revision: D4157971 fbshipit-source-id: be055cf018fd39b3cee9af0bc777831fcf757190
This commit is contained in:
parent
07c5882a38
commit
1f125e3d41
|
@ -2092,27 +2092,23 @@ static void layoutNodeImpl(const CSSNodeRef node,
|
|||
|
||||
// If the user didn't specify a width or height for the node, set the
|
||||
// dimensions based on the children.
|
||||
if (measureModeMainDim == CSSMeasureModeUndefined ||
|
||||
(node->style.overflow != CSSOverflowScroll && measureModeMainDim == CSSMeasureModeAtMost)) {
|
||||
if (measureModeMainDim == CSSMeasureModeUndefined) {
|
||||
// Clamp the size to the min/max size, if specified, and make sure it
|
||||
// doesn't go below the padding and border amount.
|
||||
node->layout.measuredDimensions[dim[mainAxis]] = boundAxis(node, mainAxis, maxLineMainDim);
|
||||
} else if (node->style.overflow == CSSOverflowScroll &&
|
||||
measureModeMainDim == CSSMeasureModeAtMost) {
|
||||
} else if (measureModeMainDim == CSSMeasureModeAtMost) {
|
||||
node->layout.measuredDimensions[dim[mainAxis]] =
|
||||
fmaxf(fminf(availableInnerMainDim + paddingAndBorderAxisMain,
|
||||
boundAxisWithinMinAndMax(node, mainAxis, maxLineMainDim)),
|
||||
paddingAndBorderAxisMain);
|
||||
}
|
||||
|
||||
if (measureModeCrossDim == CSSMeasureModeUndefined ||
|
||||
(node->style.overflow != CSSOverflowScroll && measureModeCrossDim == CSSMeasureModeAtMost)) {
|
||||
if (measureModeCrossDim == CSSMeasureModeUndefined) {
|
||||
// Clamp the size to the min/max size, if specified, and make sure it
|
||||
// doesn't go below the padding and border amount.
|
||||
node->layout.measuredDimensions[dim[crossAxis]] =
|
||||
boundAxis(node, crossAxis, totalLineCrossDim + paddingAndBorderAxisCross);
|
||||
} else if (node->style.overflow == CSSOverflowScroll &&
|
||||
measureModeCrossDim == CSSMeasureModeAtMost) {
|
||||
} else if (measureModeCrossDim == CSSMeasureModeAtMost) {
|
||||
node->layout.measuredDimensions[dim[crossAxis]] =
|
||||
fmaxf(fminf(availableInnerCrossDim + paddingAndBorderAxisCross,
|
||||
boundAxisWithinMinAndMax(node,
|
||||
|
|
|
@ -2092,27 +2092,23 @@ static void layoutNodeImpl(const CSSNodeRef node,
|
|||
|
||||
// If the user didn't specify a width or height for the node, set the
|
||||
// dimensions based on the children.
|
||||
if (measureModeMainDim == CSSMeasureModeUndefined ||
|
||||
(node->style.overflow != CSSOverflowScroll && measureModeMainDim == CSSMeasureModeAtMost)) {
|
||||
if (measureModeMainDim == CSSMeasureModeUndefined) {
|
||||
// Clamp the size to the min/max size, if specified, and make sure it
|
||||
// doesn't go below the padding and border amount.
|
||||
node->layout.measuredDimensions[dim[mainAxis]] = boundAxis(node, mainAxis, maxLineMainDim);
|
||||
} else if (node->style.overflow == CSSOverflowScroll &&
|
||||
measureModeMainDim == CSSMeasureModeAtMost) {
|
||||
} else if (measureModeMainDim == CSSMeasureModeAtMost) {
|
||||
node->layout.measuredDimensions[dim[mainAxis]] =
|
||||
fmaxf(fminf(availableInnerMainDim + paddingAndBorderAxisMain,
|
||||
boundAxisWithinMinAndMax(node, mainAxis, maxLineMainDim)),
|
||||
paddingAndBorderAxisMain);
|
||||
}
|
||||
|
||||
if (measureModeCrossDim == CSSMeasureModeUndefined ||
|
||||
(node->style.overflow != CSSOverflowScroll && measureModeCrossDim == CSSMeasureModeAtMost)) {
|
||||
if (measureModeCrossDim == CSSMeasureModeUndefined) {
|
||||
// Clamp the size to the min/max size, if specified, and make sure it
|
||||
// doesn't go below the padding and border amount.
|
||||
node->layout.measuredDimensions[dim[crossAxis]] =
|
||||
boundAxis(node, crossAxis, totalLineCrossDim + paddingAndBorderAxisCross);
|
||||
} else if (node->style.overflow == CSSOverflowScroll &&
|
||||
measureModeCrossDim == CSSMeasureModeAtMost) {
|
||||
} else if (measureModeCrossDim == CSSMeasureModeAtMost) {
|
||||
node->layout.measuredDimensions[dim[crossAxis]] =
|
||||
fmaxf(fminf(availableInnerCrossDim + paddingAndBorderAxisCross,
|
||||
boundAxisWithinMinAndMax(node,
|
||||
|
|
Loading…
Reference in New Issue