From 1f125e3d4115fe17fc0bc6f2f49ee3f02dec3a86 Mon Sep 17 00:00:00 2001 From: Fred Liu Date: Mon, 14 Nov 2016 12:19:26 -0800 Subject: [PATCH] Revert D4157971: [csslayout] BREAKING - Fix sizing of container with child overflowing parent Differential Revision: D4157971 fbshipit-source-id: be055cf018fd39b3cee9af0bc777831fcf757190 --- React/CSSLayout/CSSLayout.c | 12 ++++-------- ReactCommon/CSSLayout/CSSLayout.c | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/React/CSSLayout/CSSLayout.c b/React/CSSLayout/CSSLayout.c index 94e344214..8ba14c0af 100644 --- a/React/CSSLayout/CSSLayout.c +++ b/React/CSSLayout/CSSLayout.c @@ -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, diff --git a/ReactCommon/CSSLayout/CSSLayout.c b/ReactCommon/CSSLayout/CSSLayout.c index 94e344214..8ba14c0af 100644 --- a/ReactCommon/CSSLayout/CSSLayout.c +++ b/ReactCommon/CSSLayout/CSSLayout.c @@ -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,