Back out "Update public API for intrinsic sizing setters" (#1752)
Summary: X-link: https://github.com/facebook/react-native/pull/47896 Pull Request resolved: https://github.com/facebook/yoga/pull/1752 These APIs were only added so that we could do TDD as we work on intrinsic sizing functionality. As of right now they do nothing. We are aiming on publishing a new version of Yoga soon so for the time being we are going to back these out so as not to confuse anyone with this new functionality. Ideally we get to a point where we have some temporary experimental header to stage these in but this is a bit time sensitive so just backing out for now Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D66332309 fbshipit-source-id: 793f77dad021fa5e57b52c36ae954307636bcbf0
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c12e732fab
commit
0c995496c8
@@ -160,18 +160,6 @@ void Node::setFlexBasisAuto() {
|
||||
YGNodeStyleSetFlexBasisAuto(m_node);
|
||||
}
|
||||
|
||||
void Node::setFlexBasisMaxContent() {
|
||||
YGNodeStyleSetFlexBasisMaxContent(m_node);
|
||||
}
|
||||
|
||||
void Node::setFlexBasisFitContent() {
|
||||
YGNodeStyleSetFlexBasisFitContent(m_node);
|
||||
}
|
||||
|
||||
void Node::setFlexBasisStretch() {
|
||||
YGNodeStyleSetFlexBasisStretch(m_node);
|
||||
}
|
||||
|
||||
void Node::setFlexGrow(double flexGrow) {
|
||||
YGNodeStyleSetFlexGrow(m_node, flexGrow);
|
||||
}
|
||||
@@ -192,18 +180,6 @@ void Node::setWidthAuto() {
|
||||
YGNodeStyleSetWidthAuto(m_node);
|
||||
}
|
||||
|
||||
void Node::setWidthMaxContent() {
|
||||
YGNodeStyleSetWidthMaxContent(m_node);
|
||||
}
|
||||
|
||||
void Node::setWidthFitContent() {
|
||||
YGNodeStyleSetWidthFitContent(m_node);
|
||||
}
|
||||
|
||||
void Node::setWidthStretch() {
|
||||
YGNodeStyleSetWidthStretch(m_node);
|
||||
}
|
||||
|
||||
void Node::setHeight(double height) {
|
||||
YGNodeStyleSetHeight(m_node, height);
|
||||
}
|
||||
@@ -216,18 +192,6 @@ void Node::setHeightAuto() {
|
||||
YGNodeStyleSetHeightAuto(m_node);
|
||||
}
|
||||
|
||||
void Node::setHeightMaxContent() {
|
||||
YGNodeStyleSetHeightMaxContent(m_node);
|
||||
}
|
||||
|
||||
void Node::setHeightFitContent() {
|
||||
YGNodeStyleSetHeightFitContent(m_node);
|
||||
}
|
||||
|
||||
void Node::setHeightStretch() {
|
||||
YGNodeStyleSetHeightStretch(m_node);
|
||||
}
|
||||
|
||||
void Node::setMinWidth(double minWidth) {
|
||||
YGNodeStyleSetMinWidth(m_node, minWidth);
|
||||
}
|
||||
@@ -236,18 +200,6 @@ void Node::setMinWidthPercent(double minWidth) {
|
||||
YGNodeStyleSetMinWidthPercent(m_node, minWidth);
|
||||
}
|
||||
|
||||
void Node::setMinWidthMaxContent() {
|
||||
YGNodeStyleSetMinWidthMaxContent(m_node);
|
||||
}
|
||||
|
||||
void Node::setMinWidthFitContent() {
|
||||
YGNodeStyleSetMinWidthFitContent(m_node);
|
||||
}
|
||||
|
||||
void Node::setMinWidthStretch() {
|
||||
YGNodeStyleSetMinWidthStretch(m_node);
|
||||
}
|
||||
|
||||
void Node::setMinHeight(double minHeight) {
|
||||
YGNodeStyleSetMinHeight(m_node, minHeight);
|
||||
}
|
||||
@@ -256,18 +208,6 @@ void Node::setMinHeightPercent(double minHeight) {
|
||||
YGNodeStyleSetMinHeightPercent(m_node, minHeight);
|
||||
}
|
||||
|
||||
void Node::setMinHeightMaxContent() {
|
||||
YGNodeStyleSetMinHeightMaxContent(m_node);
|
||||
}
|
||||
|
||||
void Node::setMinHeightFitContent() {
|
||||
YGNodeStyleSetMinHeightFitContent(m_node);
|
||||
}
|
||||
|
||||
void Node::setMinHeightStretch() {
|
||||
YGNodeStyleSetMinHeightStretch(m_node);
|
||||
}
|
||||
|
||||
void Node::setMaxWidth(double maxWidth) {
|
||||
YGNodeStyleSetMaxWidth(m_node, maxWidth);
|
||||
}
|
||||
@@ -276,18 +216,6 @@ void Node::setMaxWidthPercent(double maxWidth) {
|
||||
YGNodeStyleSetMaxWidthPercent(m_node, maxWidth);
|
||||
}
|
||||
|
||||
void Node::setMaxWidthMaxContent() {
|
||||
YGNodeStyleSetMaxWidthMaxContent(m_node);
|
||||
}
|
||||
|
||||
void Node::setMaxWidthFitContent() {
|
||||
YGNodeStyleSetMaxWidthFitContent(m_node);
|
||||
}
|
||||
|
||||
void Node::setMaxWidthStretch() {
|
||||
YGNodeStyleSetMaxWidthStretch(m_node);
|
||||
}
|
||||
|
||||
void Node::setMaxHeight(double maxHeight) {
|
||||
YGNodeStyleSetMaxHeight(m_node, maxHeight);
|
||||
}
|
||||
@@ -296,18 +224,6 @@ void Node::setMaxHeightPercent(double maxHeight) {
|
||||
YGNodeStyleSetMaxHeightPercent(m_node, maxHeight);
|
||||
}
|
||||
|
||||
void Node::setMaxHeightMaxContent() {
|
||||
YGNodeStyleSetMaxHeightMaxContent(m_node);
|
||||
}
|
||||
|
||||
void Node::setMaxHeightFitContent() {
|
||||
YGNodeStyleSetMaxHeightFitContent(m_node);
|
||||
}
|
||||
|
||||
void Node::setMaxHeightStretch() {
|
||||
YGNodeStyleSetMaxHeightStretch(m_node);
|
||||
}
|
||||
|
||||
void Node::setAspectRatio(double aspectRatio) {
|
||||
YGNodeStyleSetAspectRatio(m_node, aspectRatio);
|
||||
}
|
||||
|
@@ -97,46 +97,25 @@ class Node {
|
||||
void setFlexBasis(double flexBasis);
|
||||
void setFlexBasisPercent(double flexBasis);
|
||||
void setFlexBasisAuto();
|
||||
void setFlexBasisMaxContent();
|
||||
void setFlexBasisFitContent();
|
||||
void setFlexBasisStretch();
|
||||
void setFlexGrow(double flexGrow);
|
||||
void setFlexShrink(double flexShrink);
|
||||
|
||||
void setWidth(double width);
|
||||
void setWidthPercent(double width);
|
||||
void setWidthAuto();
|
||||
void setWidthMaxContent();
|
||||
void setWidthFitContent();
|
||||
void setWidthStretch();
|
||||
void setHeight(double height);
|
||||
void setHeightPercent(double height);
|
||||
void setHeightAuto();
|
||||
void setHeightMaxContent();
|
||||
void setHeightFitContent();
|
||||
void setHeightStretch();
|
||||
|
||||
void setMinWidth(double minWidth);
|
||||
void setMinWidthPercent(double minWidth);
|
||||
void setMinWidthMaxContent();
|
||||
void setMinWidthFitContent();
|
||||
void setMinWidthStretch();
|
||||
void setMinHeight(double minHeight);
|
||||
void setMinHeightPercent(double minHeight);
|
||||
void setMinHeightMaxContent();
|
||||
void setMinHeightFitContent();
|
||||
void setMinHeightStretch();
|
||||
|
||||
void setMaxWidth(double maxWidth);
|
||||
void setMaxWidthPercent(double maxWidth);
|
||||
void setMaxWidthMaxContent();
|
||||
void setMaxWidthFitContent();
|
||||
void setMaxWidthStretch();
|
||||
void setMaxHeight(double maxHeight);
|
||||
void setMaxHeightPercent(double maxHeight);
|
||||
void setMaxHeightMaxContent();
|
||||
void setMaxHeightFitContent();
|
||||
void setMaxHeightStretch();
|
||||
|
||||
void setAspectRatio(double aspectRatio);
|
||||
|
||||
|
@@ -90,46 +90,25 @@ EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) {
|
||||
.function("setFlexBasis", &Node::setFlexBasis)
|
||||
.function("setFlexBasisPercent", &Node::setFlexBasisPercent)
|
||||
.function("setFlexBasisAuto", &Node::setFlexBasisAuto)
|
||||
.function("setFlexBasisMaxContent", &Node::setFlexBasisMaxContent)
|
||||
.function("setFlexBasisFitContent", &Node::setFlexBasisFitContent)
|
||||
.function("setFlexBasisStretch", &Node::setFlexBasisStretch)
|
||||
.function("setFlexGrow", &Node::setFlexGrow)
|
||||
.function("setFlexShrink", &Node::setFlexShrink)
|
||||
|
||||
.function("setWidth", &Node::setWidth)
|
||||
.function("setWidthPercent", &Node::setWidthPercent)
|
||||
.function("setWidthAuto", &Node::setWidthAuto)
|
||||
.function("setWidthMaxContent", &Node::setWidthMaxContent)
|
||||
.function("setWidthFitContent", &Node::setWidthFitContent)
|
||||
.function("setWidthStretch", &Node::setWidthStretch)
|
||||
.function("setHeight", &Node::setHeight)
|
||||
.function("setHeightPercent", &Node::setHeightPercent)
|
||||
.function("setHeightAuto", &Node::setHeightAuto)
|
||||
.function("setHeightMaxContent", &Node::setHeightMaxContent)
|
||||
.function("setHeightFitContent", &Node::setHeightFitContent)
|
||||
.function("setHeightStretch", &Node::setHeightStretch)
|
||||
|
||||
.function("setMinWidth", &Node::setMinWidth)
|
||||
.function("setMinWidthPercent", &Node::setMinWidthPercent)
|
||||
.function("setMinWidthMaxContent", &Node::setMinWidthMaxContent)
|
||||
.function("setMinWidthFitContent", &Node::setMinWidthFitContent)
|
||||
.function("setMinWidthStretch", &Node::setMinWidthStretch)
|
||||
.function("setMinHeight", &Node::setMinHeight)
|
||||
.function("setMinHeightPercent", &Node::setMinHeightPercent)
|
||||
.function("setMinHeightMaxContent", &Node::setMinHeightMaxContent)
|
||||
.function("setMinHeightFitContent", &Node::setMinHeightFitContent)
|
||||
.function("setMinHeightStretch", &Node::setMinHeightStretch)
|
||||
|
||||
.function("setMaxWidth", &Node::setMaxWidth)
|
||||
.function("setMaxWidthPercent", &Node::setMaxWidthPercent)
|
||||
.function("setMaxWidthMaxContent", &Node::setMaxWidthMaxContent)
|
||||
.function("setMaxWidthFitContent", &Node::setMaxWidthFitContent)
|
||||
.function("setMaxWidthStretch", &Node::setMaxWidthStretch)
|
||||
.function("setMaxHeight", &Node::setMaxHeight)
|
||||
.function("setMaxHeightPercent", &Node::setMaxHeightPercent)
|
||||
.function("setMaxHeightMaxContent", &Node::setMaxHeightMaxContent)
|
||||
.function("setMaxHeightFitContent", &Node::setMaxHeightFitContent)
|
||||
.function("setMaxHeightStretch", &Node::setMaxHeightStretch)
|
||||
|
||||
.function("setBoxSizing", &Node::setBoxSizing)
|
||||
|
||||
|
@@ -134,41 +134,17 @@ export type Node = {
|
||||
setDirection(direction: Direction): void;
|
||||
setDisplay(display: Display): void;
|
||||
setFlex(flex: number | undefined): void;
|
||||
setFlexBasis(
|
||||
flexBasis:
|
||||
| number
|
||||
| 'auto'
|
||||
| 'fit-content'
|
||||
| 'max-content'
|
||||
| 'stretch'
|
||||
| `${number}%`
|
||||
| undefined,
|
||||
): void;
|
||||
setFlexBasis(flexBasis: number | 'auto' | `${number}%` | undefined): void;
|
||||
setFlexBasisPercent(flexBasis: number | undefined): void;
|
||||
setFlexBasisAuto(): void;
|
||||
setFlexBasisFitContent(): void;
|
||||
setFlexBasisMaxContent(): void;
|
||||
setFlexBasisStretch(): void;
|
||||
setFlexDirection(flexDirection: FlexDirection): void;
|
||||
setFlexGrow(flexGrow: number | undefined): void;
|
||||
setFlexShrink(flexShrink: number | undefined): void;
|
||||
setFlexWrap(flexWrap: Wrap): void;
|
||||
setHeight(
|
||||
height:
|
||||
| number
|
||||
| 'auto'
|
||||
| 'fit-content'
|
||||
| 'max-content'
|
||||
| 'stretch'
|
||||
| `${number}%`
|
||||
| undefined,
|
||||
): void;
|
||||
setHeight(height: number | 'auto' | `${number}%` | undefined): void;
|
||||
setIsReferenceBaseline(isReferenceBaseline: boolean): void;
|
||||
setHeightAuto(): void;
|
||||
setHeightFitContent(): void;
|
||||
setHeightMaxContent(): void;
|
||||
setHeightPercent(height: number | undefined): void;
|
||||
setHeightStretch(): void;
|
||||
setJustifyContent(justifyContent: Justify): void;
|
||||
setGap(gutter: Gutter, gapLength: number | `${number}%` | undefined): Value;
|
||||
setGapPercent(gutter: Gutter, gapLength: number | undefined): Value;
|
||||
@@ -178,60 +154,16 @@ export type Node = {
|
||||
): void;
|
||||
setMarginAuto(edge: Edge): void;
|
||||
setMarginPercent(edge: Edge, margin: number | undefined): void;
|
||||
setMaxHeight(
|
||||
maxHeight:
|
||||
| number
|
||||
| 'fit-content'
|
||||
| 'max-content'
|
||||
| 'stretch'
|
||||
| `${number}%`
|
||||
| undefined,
|
||||
): void;
|
||||
setMaxHeightFitContent(): void;
|
||||
setMaxHeightMaxContent(): void;
|
||||
setMaxHeight(maxHeight: number | `${number}%` | undefined): void;
|
||||
setMaxHeightPercent(maxHeight: number | undefined): void;
|
||||
setMaxHeightStretch(): void;
|
||||
setMaxWidth(
|
||||
maxWidth:
|
||||
| number
|
||||
| 'fit-content'
|
||||
| 'max-content'
|
||||
| 'stretch'
|
||||
| `${number}%`
|
||||
| undefined,
|
||||
): void;
|
||||
setMaxWidthFitContent(): void;
|
||||
setMaxWidthMaxContent(): void;
|
||||
setMaxWidth(maxWidth: number | `${number}%` | undefined): void;
|
||||
setMaxWidthPercent(maxWidth: number | undefined): void;
|
||||
setMaxWidthStretch(): void;
|
||||
setDirtiedFunc(dirtiedFunc: DirtiedFunction | null): void;
|
||||
setMeasureFunc(measureFunc: MeasureFunction | null): void;
|
||||
setMinHeight(
|
||||
minHeight:
|
||||
| number
|
||||
| 'fit-content'
|
||||
| 'max-content'
|
||||
| 'stretch'
|
||||
| `${number}%`
|
||||
| undefined,
|
||||
): void;
|
||||
setMinHeightFitContent(): void;
|
||||
setMinHeightMaxContent(): void;
|
||||
setMinHeight(minHeight: number | `${number}%` | undefined): void;
|
||||
setMinHeightPercent(minHeight: number | undefined): void;
|
||||
setMinHeightStretch(): void;
|
||||
setMinWidth(
|
||||
minWidth:
|
||||
| number
|
||||
| 'fit-content'
|
||||
| 'max-content'
|
||||
| 'stretch'
|
||||
| `${number}%`
|
||||
| undefined,
|
||||
): void;
|
||||
setMinWidthFitContent(): void;
|
||||
setMinWidthMaxContent(): void;
|
||||
setMinWidth(minWidth: number | `${number}%` | undefined): void;
|
||||
setMinWidthPercent(minWidth: number | undefined): void;
|
||||
setMinWidthStretch(): void;
|
||||
setOverflow(overflow: Overflow): void;
|
||||
setPadding(edge: Edge, padding: number | `${number}%` | undefined): void;
|
||||
setPaddingPercent(edge: Edge, padding: number | undefined): void;
|
||||
@@ -240,21 +172,9 @@ export type Node = {
|
||||
setPositionType(positionType: PositionType): void;
|
||||
setPositionAuto(edge: Edge): void;
|
||||
setBoxSizing(boxSizing: BoxSizing): void;
|
||||
setWidth(
|
||||
width:
|
||||
| number
|
||||
| 'auto'
|
||||
| 'fit-content'
|
||||
| 'max-content'
|
||||
| 'stretch'
|
||||
| `${number}%`
|
||||
| undefined,
|
||||
): void;
|
||||
setWidth(width: number | 'auto' | `${number}%` | undefined): void;
|
||||
setWidthAuto(): void;
|
||||
setWidthFitContent(): void;
|
||||
setWidthMaxContent(): void;
|
||||
setWidthPercent(width: number | undefined): void;
|
||||
setWidthStretch(): void;
|
||||
unsetDirtiedFunc(): void;
|
||||
unsetMeasureFunc(): void;
|
||||
setAlwaysFormsContainingBlock(alwaysFormsContainingBlock: boolean): void;
|
||||
@@ -300,9 +220,6 @@ export default function wrapAssembly(lib: any): Yoga {
|
||||
[Unit.Point]: lib.Node.prototype[fnName],
|
||||
[Unit.Percent]: lib.Node.prototype[`${fnName}Percent`],
|
||||
[Unit.Auto]: lib.Node.prototype[`${fnName}Auto`],
|
||||
[Unit.MaxContent]: lib.Node.prototype[`${fnName}MaxContent`],
|
||||
[Unit.FitContent]: lib.Node.prototype[`${fnName}FitContent`],
|
||||
[Unit.Stretch]: lib.Node.prototype[`${fnName}Stretch`],
|
||||
};
|
||||
|
||||
patch(lib.Node.prototype, fnName, function (original, ...args) {
|
||||
@@ -315,15 +232,6 @@ export default function wrapAssembly(lib: any): Yoga {
|
||||
if (value === 'auto') {
|
||||
unit = Unit.Auto;
|
||||
asNumber = undefined;
|
||||
} else if (value == 'max-content') {
|
||||
unit = Unit.MaxContent;
|
||||
asNumber = undefined;
|
||||
} else if (value == 'fit-content') {
|
||||
unit = Unit.FitContent;
|
||||
asNumber = undefined;
|
||||
} else if (value == 'stretch') {
|
||||
unit = Unit.Stretch;
|
||||
asNumber = undefined;
|
||||
} else if (typeof value === 'object') {
|
||||
unit = value.unit;
|
||||
asNumber = value.valueOf();
|
||||
|
Reference in New Issue
Block a user