diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt index aec70ac24698..bf122ae07f55 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt @@ -11,7 +11,8 @@ package com.facebook.yoga public enum class YogaExperimentalFeature(public val intValue: Int) { WEB_FLEX_BASIS(0), - FIX_FLEX_BASIS_FIT_CONTENT(1); + FIX_FLEX_BASIS_FIT_CONTENT(1), + MIN_CONTENT_HEIGHT_AT_GIVEN_WIDTH(2); public fun intValue(): Int = intValue @@ -21,6 +22,7 @@ public enum class YogaExperimentalFeature(public val intValue: Int) { when (value) { 0 -> WEB_FLEX_BASIS 1 -> FIX_FLEX_BASIS_FIT_CONTENT + 2 -> MIN_CONTENT_HEIGHT_AT_GIVEN_WIDTH else -> throw IllegalArgumentException("Unknown enum value: $value") } } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.kt index 90ca7c8a2551..98a4b1eb1025 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.kt @@ -12,7 +12,8 @@ package com.facebook.yoga public enum class YogaOverflow(public val intValue: Int) { VISIBLE(0), HIDDEN(1), - SCROLL(2); + SCROLL(2), + CLIP(3); public fun intValue(): Int = intValue @@ -23,6 +24,7 @@ public enum class YogaOverflow(public val intValue: Int) { 0 -> VISIBLE 1 -> HIDDEN 2 -> SCROLL + 3 -> CLIP else -> throw IllegalArgumentException("Unknown enum value: $value") } } diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp index 71019a44767f..2739eefb9ba1 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp @@ -453,6 +453,7 @@ void YogaLayoutableShadowNode::updateYogaProps() { break; case YGOverflowHidden: case YGOverflowScroll: + case YGOverflowClip: ShadowNode::traits_.set(ShadowNodeTraits::Trait::FormsContentClip); break; } diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp index 7bcbc7588e01..2612f5312605 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp @@ -184,6 +184,20 @@ class LayoutTest : public ::testing::Test { } }; +TEST_F(LayoutTest, overflowClipFormsContentClip) { + std::shared_ptr viewShadowNode; + auto element = Element().reference(viewShadowNode).props([] { + auto props = std::make_shared(); + props->yogaStyle.setOverflow(yoga::Overflow::Clip); + return props; + }); + + builder_.build(element); + + EXPECT_TRUE(viewShadowNode->getTraits().check( + ShadowNodeTraits::Trait::FormsContentClip)); +} + // Test the layout as described above with no extra changes TEST_F(LayoutTest, overflowInsetTest) { initialize(AS_IS); diff --git a/packages/react-native/ReactCommon/yoga/yoga/YGEnums.cpp b/packages/react-native/ReactCommon/yoga/yoga/YGEnums.cpp index 017d6ee45ad0..6d9c77fe69b6 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/YGEnums.cpp +++ b/packages/react-native/ReactCommon/yoga/yoga/YGEnums.cpp @@ -135,6 +135,8 @@ const char* YGExperimentalFeatureToString(const YGExperimentalFeature value) { return "web-flex-basis"; case YGExperimentalFeatureFixFlexBasisFitContent: return "fix-flex-basis-fit-content"; + case YGExperimentalFeatureMinContentHeightAtGivenWidth: + return "min-content-height-at-given-width"; } return "unknown"; } @@ -255,6 +257,8 @@ const char* YGOverflowToString(const YGOverflow value) { return "hidden"; case YGOverflowScroll: return "scroll"; + case YGOverflowClip: + return "clip"; } return "unknown"; } diff --git a/packages/react-native/ReactCommon/yoga/yoga/YGEnums.h b/packages/react-native/ReactCommon/yoga/yoga/YGEnums.h index c672870023aa..a65af836fb85 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/YGEnums.h +++ b/packages/react-native/ReactCommon/yoga/yoga/YGEnums.h @@ -76,7 +76,8 @@ YG_DEFINE_ENUM_FLAG_OPERATORS(YGErrata) YG_ENUM_DECL( YGExperimentalFeature, YGExperimentalFeatureWebFlexBasis, - YGExperimentalFeatureFixFlexBasisFitContent) + YGExperimentalFeatureFixFlexBasisFitContent, + YGExperimentalFeatureMinContentHeightAtGivenWidth) YG_ENUM_DECL( YGFlexDirection, @@ -136,7 +137,8 @@ YG_ENUM_DECL( YGOverflow, YGOverflowVisible, YGOverflowHidden, - YGOverflowScroll) + YGOverflowScroll, + YGOverflowClip) YG_ENUM_DECL( YGPositionType, diff --git a/packages/react-native/ReactCommon/yoga/yoga/YGNode.h b/packages/react-native/ReactCommon/yoga/yoga/YGNode.h index 4f8cdf81a521..89aa72b99d46 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/YGNode.h +++ b/packages/react-native/ReactCommon/yoga/yoga/YGNode.h @@ -226,17 +226,20 @@ YG_EXPORT bool YGNodeHasMeasureFunc(YGNodeConstRef node); * size along the main axis. * * The signature mirrors `YGMeasureFunc`. The algorithm calls this with - * `AtMost 0` along the probed axis and `Undefined` on the other. A + * `AtMost 0` along the probed axis and `Undefined` on the other. With + * `YGExperimentalFeatureMinContentHeightAtGivenWidth`, it probes a height + * with the node's width as an `AtMost` width and an `Undefined` height. A * min-content-aware Primitive can return its true minimum (e.g., `Image` * and `Collection` along the scroll axis can return 0; text returns its * longest-word width; etc.) without doing a full measure pass. * - * When unset, the algorithm falls back to the regular `YGMeasureFunc` - * invoked with the same `AtMost 0` constraint — preserving today's - * behavior. Setting this is a perf opt-in for Primitives whose min-content - * size is cheap to compute or differs from what the regular measure would - * return. Its results are kept, as a measure function's are, until the node is - * marked dirty. + * When unset, the algorithm falls back to the regular `YGMeasureFunc` with + * the same arguments. Setting this is a perf opt-in for Primitives whose + * min-content size is cheap to compute or differs from what the regular + * measure would return. Its results are kept, as a measure function's are, + * until the node is marked dirty. With + * `YGExperimentalFeatureMinContentHeightAtGivenWidth`, a height result is also + * measured again when the width it was measured at changes. */ typedef YGSize (*YGMinContentMeasureFunc)( YGNodeConstRef node, diff --git a/packages/react-native/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp b/packages/react-native/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp index db21f29fbff4..610dae1e370f 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +++ b/packages/react-native/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp @@ -916,7 +916,8 @@ struct MinContentSize { }; // The min-content of a leaf with a measure function: its memoized measurement, -// which leaves out its padding and border, with them added. +// which leaves out its padding and border, with them added. A height measured +// at the leaf's width depends on the owner's width as well. static MinContentSize leafMinContentSize( const yoga::Node* const node, const FlexDirection requestedAxis, @@ -927,11 +928,12 @@ static MinContentSize leafMinContentSize( requestedAxis, leafDirection, ownerWidth) + node->style().computeFlexEndPaddingAndBorder( requestedAxis, leafDirection, ownerWidth); + const LayoutResults& layout = node->getLayout(); + const Dimension axisDimension = dimension(requestedAxis); return { - node->getLayout() - .minContent[yoga::to_underlying(dimension(requestedAxis))] + - paddingAndBorder, - node->style().hasPercentPadding()}; + layout.minContent[yoga::to_underlying(axisDimension)] + paddingAndBorder, + node->style().hasPercentPadding() || + layout.minContentResolvesAgainstOwnerWidth(axisDimension)}; } // The min-content of `node` that reading it gives, without writing to it: a @@ -955,42 +957,83 @@ static std::optional readMinContentMainSize( return MinContentSize{staticMin.unwrap(), false}; } - const Dimension axisDimension = dimension(requestedAxis); - if (node->hasMeasureFunc()) { - if (!hasMemoizedMinContent( - node, axisDimension, ownerDirection, generationCount)) { - return std::nullopt; - } - return leafMinContentSize(node, requestedAxis, ownerDirection, ownerWidth); - } - - if (node->getChildCount() == 0) { + if (!node->hasMeasureFunc() && node->getChildCount() == 0) { return MinContentSize{0.0f, false}; } + const Dimension axisDimension = dimension(requestedAxis); const LayoutResults& layout = node->getLayout(); const auto axisIndex = yoga::to_underlying(axisDimension); - if (hasMemoizedMinContent( - node, axisDimension, ownerDirection, generationCount) && - (!layout.minContentResolvesAgainstOwnerWidth(axisDimension) || - yoga::inexactEquals( + if (!hasMemoizedMinContent( + node, axisDimension, ownerDirection, generationCount) || + (layout.minContentResolvesAgainstOwnerWidth(axisDimension) && + !yoga::inexactEquals( layout.minContentOwnerWidth[axisIndex], ownerWidth))) { - return MinContentSize{ - layout.minContent[axisIndex], - layout.minContentResolvesAgainstOwnerWidth(axisDimension)}; + return std::nullopt; } - return std::nullopt; + if (node->hasMeasureFunc()) { + return leafMinContentSize(node, requestedAxis, ownerDirection, ownerWidth); + } + return MinContentSize{ + layout.minContent[axisIndex], + layout.minContentResolvesAgainstOwnerWidth(axisDimension)}; } -static MinContentSize computeChildMinContentMainSize( +static MinContentSize computeChildMinContentContribution( yoga::Node* node, size_t index, - FlexDirection requestedAxis, - Direction ownerDirection, + FlexDirection axis, + Direction direction, float ownerWidth, float ownerHeight, uint32_t generationCount); +// The content-box width of `node` under an owner whose content box is +// `ownerWidth` wide: the width it states, else the owner's less its margins, +// within the minimum and maximum it states. This is its width as a stretched +// item of a column; one that is not stretched may be narrower, which the walk +// does not model. +static float contentWidthUnderOwner( + const yoga::Node* const node, + const Direction ownerDirection, + const float ownerWidth) { + const Style& style = node->style(); + const Direction direction = node->resolveDirection(ownerDirection); + const float paddingAndBorder = style.computePaddingAndBorderForDimension( + direction, Dimension::Width, ownerWidth); + const FloatOptional stated = + style.dimension(Dimension::Width).resolve(ownerWidth); + FloatOptional borderBoxWidth{ + ownerWidth - style.computeMarginForAxis(FlexDirection::Row, ownerWidth)}; + if (stated.isDefined()) { + borderBoxWidth = style.boxSizing() == BoxSizing::ContentBox + ? stated + FloatOptional{paddingAndBorder} + : stated; + } + borderBoxWidth = boundAxisWithinMinAndMax( + node, + direction, + FlexDirection::Row, + borderBoxWidth, + ownerWidth, + ownerWidth); + if (borderBoxWidth.isUndefined()) { + // With no width to fill, the box is still no wider than its maximum. + borderBoxWidth = boundAxisWithinMinAndMax( + node, + direction, + FlexDirection::Row, + style.resolvedMaxDimension( + direction, Dimension::Width, ownerWidth, ownerWidth), + ownerWidth, + ownerWidth); + } + if (borderBoxWidth.isUndefined()) { + return YGUndefined; + } + return yoga::maxOrDefined(borderBoxWidth.unwrap() - paddingAndBorder, 0.0f); +} + // Measures or walks `node`, which the tree being laid out owns, and memoizes // the result. static MinContentSize measureOrWalkMinContentMainSize( @@ -1007,32 +1050,60 @@ static MinContentSize measureOrWalkMinContentMainSize( if (node->hasMeasureFunc()) { // 2. Dynamic min-content callback if set (for Primitives whose // min-content depends on state). Otherwise fall back to the regular - // measure function with `AtMost 0`, which text measurers naturally - // answer with longest-word width. + // measure function. A width is probed with `AtMost 0`, which text + // measurers naturally answer with longest-word width. A height is probed + // the same way unless `MinContentHeightAtGivenWidth` is on: a text + // measurer answers `AtMost 0` with no height at all, where a min-content + // height is the height the content takes at the box's width (css-sizing-3 + // §2.1), so the leaf is measured at its width with no limit on its height. + const bool heightAtGivenWidth = !wantRow && + node->getConfig()->isExperimentalFeatureEnabled( + ExperimentalFeature::MinContentHeightAtGivenWidth); + float width = wantRow ? 0.0f : YGUndefined; + if (heightAtGivenWidth) { + width = contentWidthUnderOwner(node, ownerDirection, ownerWidth); + } + const MeasureMode widthMode = + yoga::isDefined(width) ? MeasureMode::AtMost : MeasureMode::Undefined; + const float height = wantRow || heightAtGivenWidth ? YGUndefined : 0.0f; + const MeasureMode heightMode = + yoga::isDefined(height) ? MeasureMode::AtMost : MeasureMode::Undefined; const YGSize size = node->hasMinContentMeasureFunc() - ? node->measureMinContent( - wantRow ? 0.0f : YGUndefined, - wantRow ? MeasureMode::AtMost : MeasureMode::Undefined, - wantRow ? YGUndefined : 0.0f, - wantRow ? MeasureMode::Undefined : MeasureMode::AtMost) - : node->measure( - wantRow ? 0.0f : YGUndefined, - wantRow ? MeasureMode::AtMost : MeasureMode::Undefined, - wantRow ? YGUndefined : 0.0f, - wantRow ? MeasureMode::Undefined : MeasureMode::AtMost); + ? node->measureMinContent(width, widthMode, height, heightMode) + : node->measure(width, widthMode, height, heightMode); layout.minContent[axisIndex] = wantRow ? size.width : size.height; + layout.minContentOwnerWidth[axisIndex] = ownerWidth; + layout.setMinContentResolvesAgainstOwnerWidth( + dimension(requestedAxis), heightAtGivenWidth); layout.minContentGeneration[axisIndex] = generationCount; return leafMinContentSize(node, requestedAxis, ownerDirection, ownerWidth); } const Direction direction = node->resolveDirection(ownerDirection); - const FlexDirection nodeMainAxis = - resolveDirection(node->style().flexDirection(), direction); - const FlexDirection nodeCrossAxis = - resolveCrossDirection(nodeMainAxis, direction); + // Children add up along the container's main axis; across it the largest + // counts. A wrapping row can put each child on a line of its own, so its + // largest child counts along it too (css-flexbox-1 §9.9.1). A wrapping + // column still adds up: Chrome finds a min-content height by layout at an + // indefinite height, where nothing wraps. + const bool childrenAddUp = isRow(node->style().flexDirection()) == wantRow && + (node->style().flexWrap() == Wrap::NoWrap || !wantRow); + + // A height measured at a leaf's width needs the width of each box above the + // leaf. A column's children are walked against its content width, which a + // stretched child fills. A row's children share its width by their content, + // which the walk does not know, so they are walked against no width and + // their text is as tall as it is unwrapped, the least it can be. + float childOwnerWidth = ownerWidth; + if (!wantRow && + node->getConfig()->isExperimentalFeatureEnabled( + ExperimentalFeature::MinContentHeightAtGivenWidth)) { + childOwnerWidth = childrenAddUp + ? contentWidthUnderOwner(node, ownerDirection, ownerWidth) + : YGUndefined; + } - float mainTotal = 0.0f; - float crossMax = 0.0f; + float minContent = 0.0f; + size_t itemCount = 0; bool resolvesAgainstOwnerWidth = node->style().hasPercentPadding(); for (size_t i = 0; i < node->getChildCount(); i++) { @@ -1041,48 +1112,36 @@ static MinContentSize measureOrWalkMinContentMainSize( childStyle.positionType() == PositionType::Absolute) { continue; } + itemCount++; - const MinContentSize childMain = computeChildMinContentMainSize( + const MinContentSize child = computeChildMinContentContribution( node, i, - nodeMainAxis, + requestedAxis, direction, - ownerWidth, + childOwnerWidth, ownerHeight, generationCount); - const MinContentSize childCross = computeChildMinContentMainSize( - node, - i, - nodeCrossAxis, - direction, - ownerWidth, - ownerHeight, - generationCount); - - mainTotal += childMain.size + - childStyle.computeMarginForAxis(nodeMainAxis, ownerWidth); - crossMax = std::max( - crossMax, - childCross.size + - childStyle.computeMarginForAxis(nodeCrossAxis, ownerWidth)); + const float childSize = child.size + + childStyle.computeMarginForAxis(requestedAxis, childOwnerWidth); + minContent = childrenAddUp ? minContent + childSize + : std::max(minContent, childSize); resolvesAgainstOwnerWidth = resolvesAgainstOwnerWidth || - childMain.resolvesAgainstOwnerWidth || - childCross.resolvesAgainstOwnerWidth || childStyle.hasPercentMargin(); + child.resolvesAgainstOwnerWidth || childStyle.hasPercentMargin(); } - mainTotal += node->style().computeFlexStartPaddingAndBorder( - nodeMainAxis, direction, ownerWidth) + - node->style().computeFlexEndPaddingAndBorder( - nodeMainAxis, direction, ownerWidth); - crossMax += node->style().computeFlexStartPaddingAndBorder( - nodeCrossAxis, direction, ownerWidth) + + // A percentage gap resolves against the size being found, so it counts as + // zero (css-sizing-3 §5.2.1). + if (childrenAddUp && itemCount > 1) { + minContent += node->style().computeGapForAxis(requestedAxis, 0.0f) * + static_cast(itemCount - 1); + } + + minContent += node->style().computeFlexStartPaddingAndBorder( + requestedAxis, direction, ownerWidth) + node->style().computeFlexEndPaddingAndBorder( - nodeCrossAxis, direction, ownerWidth); + requestedAxis, direction, ownerWidth); - const bool nodeMainIsRow = isRow(nodeMainAxis); - const float widthMin = nodeMainIsRow ? mainTotal : crossMax; - const float heightMin = nodeMainIsRow ? crossMax : mainTotal; - const float minContent = wantRow ? widthMin : heightMin; layout.minContent[axisIndex] = minContent; layout.minContentOwnerWidth[axisIndex] = ownerWidth; layout.setMinContentResolvesAgainstOwnerWidth( @@ -1118,6 +1177,72 @@ static MinContentSize computeChildMinContentMainSize( generationCount); } +// The size `style` states on `dimension`, as a border-box size. A percentage +// resolves against the size the min-content walk is finding, so it behaves as +// auto there (css-sizing-3 §5.2.1). +static FloatOptional statedSize( + const Style& style, + const Direction direction, + const Dimension dimension, + const float ownerWidth) { + const FloatOptional size = style.dimension(dimension).resolve(YGUndefined); + if (size.isUndefined() || style.boxSizing() == BoxSizing::BorderBox) { + return size; + } + return size + + FloatOptional{style.computePaddingAndBorderForDimension( + direction, dimension, ownerWidth)}; +} + +// The min-content contribution along `axis` of the child of `node` at `index`, +// without its margins (css-sizing-3 §5.2): the size the child states on that +// axis, else its content's min-content size or, where that is larger, the size +// its aspect ratio transfers from the size it states on the other axis +// (css-sizing-4), within the minimum and maximum it states. A child that states +// its size on `axis` is not measured, walked or cloned for it. +static MinContentSize computeChildMinContentContribution( + yoga::Node* const node, + const size_t index, + const FlexDirection axis, + const Direction direction, + const float ownerWidth, + const float ownerHeight, + const uint32_t generationCount) { + // A clone made below has the same style. + const Style& style = node->getChild(index)->style(); + MinContentSize contribution{0.0f, false}; + const FloatOptional stated = + statedSize(style, direction, dimension(axis), ownerWidth); + if (stated.isDefined()) { + contribution = {stated.unwrap(), style.hasPercentPadding()}; + } else { + contribution = computeChildMinContentMainSize( + node, index, axis, direction, ownerWidth, ownerHeight, generationCount); + const FloatOptional aspectRatio = style.aspectRatio(); + const FloatOptional statedAcross = statedSize( + style, + direction, + isRow(axis) ? Dimension::Height : Dimension::Width, + ownerWidth); + if (aspectRatio.isDefined() && statedAcross.isDefined()) { + contribution.size = std::max( + contribution.size, + isRow(axis) ? statedAcross.unwrap() * aspectRatio.unwrap() + : statedAcross.unwrap() / aspectRatio.unwrap()); + } + } + + return { + boundAxis( + node->getChild(index), + axis, + direction, + contribution.size, + YGUndefined, + ownerWidth), + contribution.resolvesAgainstOwnerWidth || style.hasPercentPadding()}; +} + // Returns the min-content size of `node` along `requestedAxis`, used by CSS // Flexbox §4.5 automatic minimum sizing. // @@ -1135,10 +1260,11 @@ static MinContentSize computeChildMinContentMainSize( // respond with 0 along their scroll axis. // * Empty leaf: return 0. // * Container: iterate in-flow children. For each, take its -// min-content along the container's own main axis (sum into -// `mainTotal`) and along its cross axis (max into `crossMax`), -// plus the child's margins. Add the container's own padding and -// border on both ends of each axis. Project onto `requestedAxis`. +// min-content contribution along `requestedAxis` plus its margins: +// the sum of them where that is the container's main axis, the +// largest where it is its cross axis or the container is a +// wrapping row. Add the gaps between the children that add up, and +// the container's own padding and border on both ends of the axis. // // Container-level recursion does no layout writes (no positions, no // alignment, no flex distribution); only the descendant leaf measure @@ -1204,10 +1330,12 @@ static FloatOptional computeAutoMinMainSize( if (child->style().minDimension(dimension(mainAxis)).isDefined()) { return FloatOptional{}; } - // Per CSS §4.5: a flex item whose own `overflow` is not `visible` gets - // auto-min = 0 (let scroll/clip handle overflow rather than enforce a - // content-based minimum). - if (child->style().overflow() != Overflow::Visible) { + // Per CSS §4.5: a flex item that is a scroll container gets auto-min = 0 + // (let scrolling handle overflow rather than enforce a content-based + // minimum). `overflow: clip` clips without making a scroll container + // (css-overflow-3 §3.1), so it keeps its content-based minimum. + const Overflow overflow = child->style().overflow(); + if (overflow == Overflow::Hidden || overflow == Overflow::Scroll) { return FloatOptional{0.0f}; } diff --git a/packages/react-native/ReactCommon/yoga/yoga/enums/ExperimentalFeature.h b/packages/react-native/ReactCommon/yoga/yoga/enums/ExperimentalFeature.h index 7e6c5eb8b6c1..26328d6abb51 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/enums/ExperimentalFeature.h +++ b/packages/react-native/ReactCommon/yoga/yoga/enums/ExperimentalFeature.h @@ -18,11 +18,12 @@ namespace facebook::yoga { enum class ExperimentalFeature : uint8_t { WebFlexBasis = YGExperimentalFeatureWebFlexBasis, FixFlexBasisFitContent = YGExperimentalFeatureFixFlexBasisFitContent, + MinContentHeightAtGivenWidth = YGExperimentalFeatureMinContentHeightAtGivenWidth, }; template <> constexpr int32_t ordinalCount() { - return 2; + return 3; } constexpr ExperimentalFeature scopedEnum(YGExperimentalFeature unscoped) { diff --git a/packages/react-native/ReactCommon/yoga/yoga/enums/Overflow.h b/packages/react-native/ReactCommon/yoga/yoga/enums/Overflow.h index 20901b02c05a..0df9518b818b 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/enums/Overflow.h +++ b/packages/react-native/ReactCommon/yoga/yoga/enums/Overflow.h @@ -19,11 +19,12 @@ enum class Overflow : uint8_t { Visible = YGOverflowVisible, Hidden = YGOverflowHidden, Scroll = YGOverflowScroll, + Clip = YGOverflowClip, }; template <> constexpr int32_t ordinalCount() { - return 3; + return 4; } constexpr Overflow scopedEnum(YGOverflow unscoped) {