Skip to content

Commit 04e44f3

Browse files
joevilchesfacebook-github-bot
authored andcommitted
Back out "Update public API for intrinsic sizing setters" (facebook#47896)
Summary: Pull Request resolved: facebook#47896 X-link: facebook/yoga#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
1 parent 24b0ded commit 04e44f3

File tree

8 files changed

+18
-443
lines changed

8 files changed

+18
-443
lines changed

packages/react-native/React/Views/RCTShadowView.m

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -97,31 +97,6 @@ + (YGConfigRef)yogaConfig
9797
break; \
9898
}
9999

100-
#define RCT_SET_YGVALUE_AUTO_INTRINSIC(ygvalue, setter, ...) \
101-
switch (ygvalue.unit) { \
102-
case YGUnitAuto: \
103-
setter##Auto(__VA_ARGS__); \
104-
break; \
105-
case YGUnitMaxContent: \
106-
setter##MaxContent(__VA_ARGS__); \
107-
break; \
108-
case YGUnitFitContent: \
109-
setter##FitContent(__VA_ARGS__); \
110-
break; \
111-
case YGUnitStretch: \
112-
setter##Stretch(__VA_ARGS__); \
113-
break; \
114-
case YGUnitUndefined: \
115-
setter(__VA_ARGS__, YGUndefined); \
116-
break; \
117-
case YGUnitPoint: \
118-
setter(__VA_ARGS__, ygvalue.value); \
119-
break; \
120-
case YGUnitPercent: \
121-
setter##Percent(__VA_ARGS__, ygvalue.value); \
122-
break; \
123-
}
124-
125100
static void RCTProcessMetaPropsPadding(const YGValue metaProps[META_PROP_COUNT], YGNodeRef node)
126101
{
127102
if (![[RCTI18nUtil sharedInstance] doLeftAndRightSwapInRTL]) {
@@ -515,14 +490,14 @@ -(float)border##prop##Width \
515490
RCT_BORDER_PROPERTY(End, END)
516491

517492
// Dimensions
518-
#define RCT_DIMENSION_PROPERTY(setProp, getProp, cssProp) \
519-
-(void)set##setProp : (YGValue)value \
520-
{ \
521-
RCT_SET_YGVALUE_AUTO_INTRINSIC(value, YGNodeStyleSet##cssProp, _yogaNode); \
522-
} \
523-
-(YGValue)getProp \
524-
{ \
525-
return YGNodeStyleGet##cssProp(_yogaNode); \
493+
#define RCT_DIMENSION_PROPERTY(setProp, getProp, cssProp) \
494+
-(void)set##setProp : (YGValue)value \
495+
{ \
496+
RCT_SET_YGVALUE_AUTO(value, YGNodeStyleSet##cssProp, _yogaNode); \
497+
} \
498+
-(YGValue)getProp \
499+
{ \
500+
return YGNodeStyleGet##cssProp(_yogaNode); \
526501
}
527502

528503
#define RCT_MIN_MAX_DIMENSION_PROPERTY(setProp, getProp, cssProp) \
@@ -666,7 +641,7 @@ - (void)setLocalData:(__unused NSObject *)localData
666641

667642
- (void)setFlexBasis:(YGValue)value
668643
{
669-
RCT_SET_YGVALUE_AUTO_INTRINSIC(value, YGNodeStyleSetFlexBasis, _yogaNode);
644+
RCT_SET_YGVALUE_AUTO(value, YGNodeStyleSetFlexBasis, _yogaNode);
670645
}
671646

672647
- (YGValue)flexBasis

packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaNative.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ public class YogaNative {
7474
static native void jni_YGNodeStyleSetFlexBasisJNI(long nativePointer, float flexBasis);
7575
static native void jni_YGNodeStyleSetFlexBasisPercentJNI(long nativePointer, float percent);
7676
static native void jni_YGNodeStyleSetFlexBasisAutoJNI(long nativePointer);
77-
static native void jni_YGNodeStyleSetFlexBasisMaxContentJNI(long nativePointer);
78-
static native void jni_YGNodeStyleSetFlexBasisFitContentJNI(long nativePointer);
79-
static native void jni_YGNodeStyleSetFlexBasisStretchJNI(long nativePointer);
8077
static native long jni_YGNodeStyleGetMarginJNI(long nativePointer, int edge);
8178
static native void jni_YGNodeStyleSetMarginJNI(long nativePointer, int edge, float margin);
8279
static native void jni_YGNodeStyleSetMarginPercentJNI(long nativePointer, int edge, float percent);
@@ -94,40 +91,22 @@ public class YogaNative {
9491
static native void jni_YGNodeStyleSetWidthJNI(long nativePointer, float width);
9592
static native void jni_YGNodeStyleSetWidthPercentJNI(long nativePointer, float percent);
9693
static native void jni_YGNodeStyleSetWidthAutoJNI(long nativePointer);
97-
static native void jni_YGNodeStyleSetWidthMaxContentJNI(long nativePointer);
98-
static native void jni_YGNodeStyleSetWidthFitContentJNI(long nativePointer);
99-
static native void jni_YGNodeStyleSetWidthStretchJNI(long nativePointer);
10094
static native long jni_YGNodeStyleGetHeightJNI(long nativePointer);
10195
static native void jni_YGNodeStyleSetHeightJNI(long nativePointer, float height);
10296
static native void jni_YGNodeStyleSetHeightPercentJNI(long nativePointer, float percent);
10397
static native void jni_YGNodeStyleSetHeightAutoJNI(long nativePointer);
104-
static native void jni_YGNodeStyleSetHeightMaxContentJNI(long nativePointer);
105-
static native void jni_YGNodeStyleSetHeightFitContentJNI(long nativePointer);
106-
static native void jni_YGNodeStyleSetHeightStretchJNI(long nativePointer);
10798
static native long jni_YGNodeStyleGetMinWidthJNI(long nativePointer);
10899
static native void jni_YGNodeStyleSetMinWidthJNI(long nativePointer, float minWidth);
109100
static native void jni_YGNodeStyleSetMinWidthPercentJNI(long nativePointer, float percent);
110-
static native void jni_YGNodeStyleSetMinWidthMaxContentJNI(long nativePointer);
111-
static native void jni_YGNodeStyleSetMinWidthFitContentJNI(long nativePointer);
112-
static native void jni_YGNodeStyleSetMinWidthStretchJNI(long nativePointer);
113101
static native long jni_YGNodeStyleGetMinHeightJNI(long nativePointer);
114102
static native void jni_YGNodeStyleSetMinHeightJNI(long nativePointer, float minHeight);
115103
static native void jni_YGNodeStyleSetMinHeightPercentJNI(long nativePointer, float percent);
116-
static native void jni_YGNodeStyleSetMinHeightMaxContentJNI(long nativePointer);
117-
static native void jni_YGNodeStyleSetMinHeightFitContentJNI(long nativePointer);
118-
static native void jni_YGNodeStyleSetMinHeightStretchJNI(long nativePointer);
119104
static native long jni_YGNodeStyleGetMaxWidthJNI(long nativePointer);
120105
static native void jni_YGNodeStyleSetMaxWidthJNI(long nativePointer, float maxWidth);
121106
static native void jni_YGNodeStyleSetMaxWidthPercentJNI(long nativePointer, float percent);
122-
static native void jni_YGNodeStyleSetMaxWidthMaxContentJNI(long nativePointer);
123-
static native void jni_YGNodeStyleSetMaxWidthFitContentJNI(long nativePointer);
124-
static native void jni_YGNodeStyleSetMaxWidthStretchJNI(long nativePointer);
125107
static native long jni_YGNodeStyleGetMaxHeightJNI(long nativePointer);
126108
static native void jni_YGNodeStyleSetMaxHeightJNI(long nativePointer, float maxheight);
127109
static native void jni_YGNodeStyleSetMaxHeightPercentJNI(long nativePointer, float percent);
128-
static native void jni_YGNodeStyleSetMaxHeightMaxContentJNI(long nativePointer);
129-
static native void jni_YGNodeStyleSetMaxHeightFitContentJNI(long nativePointer);
130-
static native void jni_YGNodeStyleSetMaxHeightStretchJNI(long nativePointer);
131110
static native float jni_YGNodeStyleGetAspectRatioJNI(long nativePointer);
132111
static native void jni_YGNodeStyleSetAspectRatioJNI(long nativePointer, float aspectRatio);
133112
static native float jni_YGNodeStyleGetGapJNI(long nativePointer, int gutter);

packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,6 @@ public interface Inputs {
124124

125125
public abstract void setFlexBasisAuto();
126126

127-
public abstract void setFlexBasisMaxContent();
128-
129-
public abstract void setFlexBasisFitContent();
130-
131-
public abstract void setFlexBasisStretch();
132-
133127
public abstract YogaValue getMargin(YogaEdge edge);
134128

135129
public abstract void setMargin(YogaEdge edge, float margin);
@@ -164,12 +158,6 @@ public interface Inputs {
164158

165159
public abstract void setWidthAuto();
166160

167-
public abstract void setWidthMaxContent();
168-
169-
public abstract void setWidthFitContent();
170-
171-
public abstract void setWidthStretch();
172-
173161
public abstract YogaValue getHeight();
174162

175163
public abstract void setHeight(float height);
@@ -178,60 +166,30 @@ public interface Inputs {
178166

179167
public abstract void setHeightAuto();
180168

181-
public abstract void setHeightMaxContent();
182-
183-
public abstract void setHeightFitContent();
184-
185-
public abstract void setHeightStretch();
186-
187169
public abstract YogaValue getMinWidth();
188170

189171
public abstract void setMinWidth(float minWidth);
190172

191173
public abstract void setMinWidthPercent(float percent);
192174

193-
public abstract void setMinWidthMaxContent();
194-
195-
public abstract void setMinWidthFitContent();
196-
197-
public abstract void setMinWidthStretch();
198-
199175
public abstract YogaValue getMinHeight();
200176

201177
public abstract void setMinHeight(float minHeight);
202178

203179
public abstract void setMinHeightPercent(float percent);
204180

205-
public abstract void setMinHeightMaxContent();
206-
207-
public abstract void setMinHeightFitContent();
208-
209-
public abstract void setMinHeightStretch();
210-
211181
public abstract YogaValue getMaxWidth();
212182

213183
public abstract void setMaxWidth(float maxWidth);
214184

215185
public abstract void setMaxWidthPercent(float percent);
216186

217-
public abstract void setMaxWidthMaxContent();
218-
219-
public abstract void setMaxWidthFitContent();
220-
221-
public abstract void setMaxWidthStretch();
222-
223187
public abstract YogaValue getMaxHeight();
224188

225189
public abstract void setMaxHeight(float maxheight);
226190

227191
public abstract void setMaxHeightPercent(float percent);
228192

229-
public abstract void setMaxHeightMaxContent();
230-
231-
public abstract void setMaxHeightFitContent();
232-
233-
public abstract void setMaxHeightStretch();
234-
235193
public abstract float getAspectRatio();
236194

237195
public abstract void setAspectRatio(float aspectRatio);

packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -373,18 +373,6 @@ public void setFlexBasisAuto() {
373373
YogaNative.jni_YGNodeStyleSetFlexBasisAutoJNI(mNativePointer);
374374
}
375375

376-
public void setFlexBasisMaxContent() {
377-
YogaNative.jni_YGNodeStyleSetFlexBasisMaxContentJNI(mNativePointer);
378-
}
379-
380-
public void setFlexBasisFitContent() {
381-
YogaNative.jni_YGNodeStyleSetFlexBasisFitContentJNI(mNativePointer);
382-
}
383-
384-
public void setFlexBasisStretch() {
385-
YogaNative.jni_YGNodeStyleSetFlexBasisStretchJNI(mNativePointer);
386-
}
387-
388376
public YogaValue getMargin(YogaEdge edge) {
389377
return valueFromLong(YogaNative.jni_YGNodeStyleGetMarginJNI(mNativePointer, edge.intValue()));
390378
}
@@ -453,18 +441,6 @@ public void setWidthAuto() {
453441
YogaNative.jni_YGNodeStyleSetWidthAutoJNI(mNativePointer);
454442
}
455443

456-
public void setWidthMaxContent() {
457-
YogaNative.jni_YGNodeStyleSetWidthMaxContentJNI(mNativePointer);
458-
}
459-
460-
public void setWidthFitContent() {
461-
YogaNative.jni_YGNodeStyleSetWidthFitContentJNI(mNativePointer);
462-
}
463-
464-
public void setWidthStretch() {
465-
YogaNative.jni_YGNodeStyleSetWidthStretchJNI(mNativePointer);
466-
}
467-
468444
public YogaValue getHeight() {
469445
return valueFromLong(YogaNative.jni_YGNodeStyleGetHeightJNI(mNativePointer));
470446
}
@@ -481,18 +457,6 @@ public void setHeightAuto() {
481457
YogaNative.jni_YGNodeStyleSetHeightAutoJNI(mNativePointer);
482458
}
483459

484-
public void setHeightMaxContent() {
485-
YogaNative.jni_YGNodeStyleSetHeightMaxContentJNI(mNativePointer);
486-
}
487-
488-
public void setHeightFitContent() {
489-
YogaNative.jni_YGNodeStyleSetHeightFitContentJNI(mNativePointer);
490-
}
491-
492-
public void setHeightStretch() {
493-
YogaNative.jni_YGNodeStyleSetHeightStretchJNI(mNativePointer);
494-
}
495-
496460
public YogaValue getMinWidth() {
497461
return valueFromLong(YogaNative.jni_YGNodeStyleGetMinWidthJNI(mNativePointer));
498462
}
@@ -505,18 +469,6 @@ public void setMinWidthPercent(float percent) {
505469
YogaNative.jni_YGNodeStyleSetMinWidthPercentJNI(mNativePointer, percent);
506470
}
507471

508-
public void setMinWidthMaxContent() {
509-
YogaNative.jni_YGNodeStyleSetMinWidthMaxContentJNI(mNativePointer);
510-
}
511-
512-
public void setMinWidthFitContent() {
513-
YogaNative.jni_YGNodeStyleSetMinWidthFitContentJNI(mNativePointer);
514-
}
515-
516-
public void setMinWidthStretch() {
517-
YogaNative.jni_YGNodeStyleSetMinWidthStretchJNI(mNativePointer);
518-
}
519-
520472
public YogaValue getMinHeight() {
521473
return valueFromLong(YogaNative.jni_YGNodeStyleGetMinHeightJNI(mNativePointer));
522474
}
@@ -529,18 +481,6 @@ public void setMinHeightPercent(float percent) {
529481
YogaNative.jni_YGNodeStyleSetMinHeightPercentJNI(mNativePointer, percent);
530482
}
531483

532-
public void setMinHeightMaxContent() {
533-
YogaNative.jni_YGNodeStyleSetMinHeightMaxContentJNI(mNativePointer);
534-
}
535-
536-
public void setMinHeightFitContent() {
537-
YogaNative.jni_YGNodeStyleSetMinHeightFitContentJNI(mNativePointer);
538-
}
539-
540-
public void setMinHeightStretch() {
541-
YogaNative.jni_YGNodeStyleSetMinHeightStretchJNI(mNativePointer);
542-
}
543-
544484
public YogaValue getMaxWidth() {
545485
return valueFromLong(YogaNative.jni_YGNodeStyleGetMaxWidthJNI(mNativePointer));
546486
}
@@ -553,18 +493,6 @@ public void setMaxWidthPercent(float percent) {
553493
YogaNative.jni_YGNodeStyleSetMaxWidthPercentJNI(mNativePointer, percent);
554494
}
555495

556-
public void setMaxWidthMaxContent() {
557-
YogaNative.jni_YGNodeStyleSetMaxWidthMaxContentJNI(mNativePointer);
558-
}
559-
560-
public void setMaxWidthFitContent() {
561-
YogaNative.jni_YGNodeStyleSetMaxWidthFitContentJNI(mNativePointer);
562-
}
563-
564-
public void setMaxWidthStretch() {
565-
YogaNative.jni_YGNodeStyleSetMaxWidthStretchJNI(mNativePointer);
566-
}
567-
568496
public YogaValue getMaxHeight() {
569497
return valueFromLong(YogaNative.jni_YGNodeStyleGetMaxHeightJNI(mNativePointer));
570498
}
@@ -577,18 +505,6 @@ public void setMaxHeightPercent(float percent) {
577505
YogaNative.jni_YGNodeStyleSetMaxHeightPercentJNI(mNativePointer, percent);
578506
}
579507

580-
public void setMaxHeightMaxContent() {
581-
YogaNative.jni_YGNodeStyleSetMaxHeightMaxContentJNI(mNativePointer);
582-
}
583-
584-
public void setMaxHeightFitContent() {
585-
YogaNative.jni_YGNodeStyleSetMaxHeightFitContentJNI(mNativePointer);
586-
}
587-
588-
public void setMaxHeightStretch() {
589-
YogaNative.jni_YGNodeStyleSetMaxHeightStretchJNI(mNativePointer);
590-
}
591-
592508
public float getAspectRatio() {
593509
return YogaNative.jni_YGNodeStyleGetAspectRatioJNI(mNativePointer);
594510
}

0 commit comments

Comments
 (0)