Permalink
Browse files

Fix sizing of absolutely positioned nodes inside overflow:hidden parent

Summary:
When an absolutely positioned node appeared inside an overflow:hidden
parent, we were limiting its height. This is inconsistent with how
layout behaves on the web.
Closes facebook/yoga#218

Reviewed By: lucasr

Differential Revision: D3797285

Pulled By: emilsjolander

fbshipit-source-id: 98f98e77aa26edce86b9882c1cac284799b69a27
  • Loading branch information...
1 parent e5aa29c commit 6897f40af77e6667491dbfe1f7d63f115acf4ae2 @rigdern rigdern committed with Facebook Github Bot 1 Aug 31, 2016
Showing with 0 additions and 19 deletions.
  1. +0 −10 React/CSSLayout/CSSLayout.c
  2. +0 −9 ReactAndroid/src/main/java/com/facebook/csslayout/LayoutEngine.java
@@ -1764,16 +1764,6 @@ static void layoutNodeImpl(const CSSNodeRef node,
childWidthMeasureMode = CSSMeasureModeAtMost;
}
- // The W3C spec doesn't say anything about the 'overflow' property,
- // but all major browsers appear to implement the following logic.
- if (node->style.overflow == CSSOverflowHidden) {
- if (isMainAxisRow && CSSValueIsUndefined(childHeight) &&
- !CSSValueIsUndefined(availableInnerHeight)) {
- childHeight = availableInnerHeight;
- childHeightMeasureMode = CSSMeasureModeAtMost;
- }
- }
-
layoutNodeInternal(currentAbsoluteChild,
childWidth,
childHeight,
@@ -1336,15 +1336,6 @@ private static void layoutNodeImpl(
childWidthMeasureMode = CSSMeasureMode.AT_MOST;
}
- // The W3C spec doesn't say anything about the 'overflow' property,
- // but all major browsers appear to implement the following logic.
- if (node.style.overflow == CSSOverflow.HIDDEN) {
- if (isMainAxisRow && Float.isNaN(childHeight) && !Float.isNaN(availableInnerHeight)) {
- childHeight = availableInnerHeight;
- childHeightMeasureMode = CSSMeasureMode.AT_MOST;
- }
- }
-
layoutNodeInternal(layoutContext, currentAbsoluteChild, childWidth, childHeight, direction, childWidthMeasureMode, childHeightMeasureMode, false, "abs-measure");
childWidth = currentAbsoluteChild.layout.measuredDimensions[DIMENSION_WIDTH] + (currentAbsoluteChild.style.margin.getWithFallback(leadingSpacing[CSS_FLEX_DIRECTION_ROW], leading[CSS_FLEX_DIRECTION_ROW]) + currentAbsoluteChild.style.margin.getWithFallback(trailingSpacing[CSS_FLEX_DIRECTION_ROW], trailing[CSS_FLEX_DIRECTION_ROW]));
childHeight = currentAbsoluteChild.layout.measuredDimensions[DIMENSION_HEIGHT] + (currentAbsoluteChild.style.margin.getWithFallback(leadingSpacing[CSS_FLEX_DIRECTION_COLUMN], leading[CSS_FLEX_DIRECTION_COLUMN]) + currentAbsoluteChild.style.margin.getWithFallback(trailingSpacing[CSS_FLEX_DIRECTION_COLUMN], trailing[CSS_FLEX_DIRECTION_COLUMN]));

0 comments on commit 6897f40

Please sign in to comment.