Hardcode AbsolutePercentageAgainstPaddingEdge experimental feature to false (#1549)

Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1549

X-link: https://github.com/facebook/react-native/pull/42253

This experimental feature is always false, and with the next diff I will be deleting the branch that actually calls into this. Separating this diff out to simplify the review process.

Reviewed By: NickGerleman

Differential Revision: D52705765

fbshipit-source-id: 705f4aa297eae730af9b44753eb01c9dec385dcf
This commit is contained in:
Joe Vilches
2024-01-18 21:22:05 -08:00
committed by Facebook GitHub Bot
parent 0bbfe4503d
commit f69a1a43e5
73 changed files with 69 additions and 1825 deletions

View File

@@ -111,8 +111,6 @@ const char* YGExperimentalFeatureToString(const YGExperimentalFeature value) {
switch (value) {
case YGExperimentalFeatureWebFlexBasis:
return "web-flex-basis";
case YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge:
return "absolute-percentage-against-padding-edge";
}
return "unknown";
}

View File

@@ -64,8 +64,7 @@ YG_DEFINE_ENUM_FLAG_OPERATORS(YGErrata)
YG_ENUM_DECL(
YGExperimentalFeature,
YGExperimentalFeatureWebFlexBasis,
YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge)
YGExperimentalFeatureWebFlexBasis)
YG_ENUM_DECL(
YGFlexDirection,

View File

@@ -178,21 +178,6 @@ static void positionAbsoluteChildLegacy(
(parent->getLayout().measuredDimension(dimension(axis)) -
child->getLayout().measuredDimension(dimension(axis))),
flexStartEdge(axis));
} else if (
parent->getConfig()->isExperimentalFeatureEnabled(
ExperimentalFeature::AbsolutePercentageAgainstPaddingEdge) &&
child->isFlexStartPositionDefined(axis, direction)) {
child->setLayoutPosition(
child->getFlexStartPosition(
axis,
direction,
containingNode->getLayout().measuredDimension(dimension(axis))) +
containingNode->getFlexStartBorder(axis, direction) +
child->getFlexStartMargin(
axis,
direction,
isAxisRow ? containingBlockWidth : containingBlockHeight),
flexStartEdge(axis));
}
}

View File

@@ -2048,20 +2048,13 @@ static void calculateLayoutImpl(
child->getStyle().positionType() != PositionType::Absolute) {
continue;
}
const bool absolutePercentageAgainstPaddingEdge =
node->getConfig()->isExperimentalFeatureEnabled(
ExperimentalFeature::AbsolutePercentageAgainstPaddingEdge);
layoutAbsoluteChild(
node,
node,
child,
absolutePercentageAgainstPaddingEdge
? node->getLayout().measuredDimension(Dimension::Width)
: availableInnerWidth,
absolutePercentageAgainstPaddingEdge
? node->getLayout().measuredDimension(Dimension::Height)
: availableInnerHeight,
availableInnerWidth,
availableInnerHeight,
isMainAxisRow ? sizingModeMainDim : sizingModeCrossDim,
direction,
layoutMarkerData,

View File

@@ -17,12 +17,11 @@ namespace facebook::yoga {
enum class ExperimentalFeature : uint8_t {
WebFlexBasis = YGExperimentalFeatureWebFlexBasis,
AbsolutePercentageAgainstPaddingEdge = YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge,
};
template <>
constexpr int32_t ordinalCount<ExperimentalFeature>() {
return 2;
return 1;
}
constexpr ExperimentalFeature scopedEnum(YGExperimentalFeature unscoped) {