Skip to content

Commit bfdf6fc

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Remove gated Yoga flex-basis behavior (#1980)
Summary: Remove the runtime-gated Yoga flex-basis fit-content behavior and its app-side overrides now that this behavior is no longer being shipped. This restores the ungated Yoga path and removes the related generated feature-flag surface. Changelog: [Internal] Reviewed By: javache Differential Revision: D108598973
1 parent ef2efc5 commit bfdf6fc

12 files changed

Lines changed: 10 additions & 551 deletions

File tree

enums.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@
6666
"ExperimentalFeature": [
6767
# Mimic web flex-basis behavior (experiment may be broken)
6868
"WebFlexBasis",
69-
# Fix flex basis computation to not apply FitContent constraint in the
70-
# main axis for non-measure container nodes
71-
"FixFlexBasisFitContent",
7269
],
7370
"Gutter": ["Column", "Row", "All"],
7471
"GridTrackType": ["Auto", "Points", "Percent", "Fr", "Minmax"],

gentest/fixtures/YGFlexBasisFitContentTest.html

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,3 @@
5353
<div style="height: 500px;"></div>
5454
</div>
5555
</div>
56-
57-
<!-- Items with flex-basis inside a scroll container's auto-height
58-
content container. With FixFlexBasisFitContent, flex-basis is
59-
respected even when the content container's main axis size is
60-
indefinite (NaN). Without the feature, flex-basis would be ignored. -->
61-
<div id="flex_basis_in_scroll_content_container"
62-
data-experiments="FixFlexBasisFitContent"
63-
style="width: 200px; height: 300px; overflow: scroll;">
64-
<div>
65-
<div style="flex-basis: 200px;"></div>
66-
<div style="flex-basis: 300px;"></div>
67-
</div>
68-
</div>

java/com/facebook/yoga/YogaExperimentalFeature.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
package com.facebook.yoga
1111

1212
public enum class YogaExperimentalFeature(public val intValue: Int) {
13-
WEB_FLEX_BASIS(0),
14-
FIX_FLEX_BASIS_FIT_CONTENT(1);
13+
WEB_FLEX_BASIS(0);
1514

1615
public fun intValue(): Int = intValue
1716

@@ -20,7 +19,6 @@ public enum class YogaExperimentalFeature(public val intValue: Int) {
2019
public fun fromInt(value: Int): YogaExperimentalFeature =
2120
when (value) {
2221
0 -> WEB_FLEX_BASIS
23-
1 -> FIX_FLEX_BASIS_FIT_CONTENT
2422
else -> throw IllegalArgumentException("Unknown enum value: $value")
2523
}
2624
}

java/tests/generated/com/facebook/yoga/YGFlexBasisFitContentTest.java

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<43053b7b4f9b08ef644e0bb63c44e78f>>
7+
* @generated SignedSource<<94d885664d3bbf8c72280e1b61102fce>>
88
* generated by gentest/src/GentestDriver.ts from gentest/fixtures/YGFlexBasisFitContentTest.html
99
*/
1010

@@ -385,74 +385,6 @@ public void test_explicit_and_container_children_column() {
385385
assertEquals(500f, root_child1_child0.getLayoutHeight(), 0.0f);
386386
}
387387

388-
@Test
389-
public void test_flex_basis_in_scroll_content_container() {
390-
YogaConfig config = YogaConfigFactory.create();
391-
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_FLEX_BASIS_FIT_CONTENT, true);
392-
393-
final YogaNode root = createNode(config);
394-
root.setPositionType(YogaPositionType.ABSOLUTE);
395-
root.setWidth(200f);
396-
root.setHeight(300f);
397-
root.setOverflow(YogaOverflow.SCROLL);
398-
399-
final YogaNode root_child0 = createNode(config);
400-
root.addChildAt(root_child0, 0);
401-
402-
final YogaNode root_child0_child0 = createNode(config);
403-
root_child0_child0.setFlexBasis(200f);
404-
root_child0.addChildAt(root_child0_child0, 0);
405-
406-
final YogaNode root_child0_child1 = createNode(config);
407-
root_child0_child1.setFlexBasis(300f);
408-
root_child0.addChildAt(root_child0_child1, 1);
409-
root.setDirection(YogaDirection.LTR);
410-
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
411-
412-
assertEquals(0f, root.getLayoutX(), 0.0f);
413-
assertEquals(0f, root.getLayoutY(), 0.0f);
414-
assertEquals(200f, root.getLayoutWidth(), 0.0f);
415-
assertEquals(300f, root.getLayoutHeight(), 0.0f);
416-
417-
assertEquals(0f, root_child0.getLayoutX(), 0.0f);
418-
assertEquals(0f, root_child0.getLayoutY(), 0.0f);
419-
assertEquals(200f, root_child0.getLayoutWidth(), 0.0f);
420-
assertEquals(500f, root_child0.getLayoutHeight(), 0.0f);
421-
422-
assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
423-
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
424-
assertEquals(200f, root_child0_child0.getLayoutWidth(), 0.0f);
425-
assertEquals(200f, root_child0_child0.getLayoutHeight(), 0.0f);
426-
427-
assertEquals(0f, root_child0_child1.getLayoutX(), 0.0f);
428-
assertEquals(200f, root_child0_child1.getLayoutY(), 0.0f);
429-
assertEquals(200f, root_child0_child1.getLayoutWidth(), 0.0f);
430-
assertEquals(300f, root_child0_child1.getLayoutHeight(), 0.0f);
431-
432-
root.setDirection(YogaDirection.RTL);
433-
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
434-
435-
assertEquals(0f, root.getLayoutX(), 0.0f);
436-
assertEquals(0f, root.getLayoutY(), 0.0f);
437-
assertEquals(200f, root.getLayoutWidth(), 0.0f);
438-
assertEquals(300f, root.getLayoutHeight(), 0.0f);
439-
440-
assertEquals(0f, root_child0.getLayoutX(), 0.0f);
441-
assertEquals(0f, root_child0.getLayoutY(), 0.0f);
442-
assertEquals(200f, root_child0.getLayoutWidth(), 0.0f);
443-
assertEquals(500f, root_child0.getLayoutHeight(), 0.0f);
444-
445-
assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
446-
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
447-
assertEquals(200f, root_child0_child0.getLayoutWidth(), 0.0f);
448-
assertEquals(200f, root_child0_child0.getLayoutHeight(), 0.0f);
449-
450-
assertEquals(0f, root_child0_child1.getLayoutX(), 0.0f);
451-
assertEquals(200f, root_child0_child1.getLayoutY(), 0.0f);
452-
assertEquals(200f, root_child0_child1.getLayoutWidth(), 0.0f);
453-
assertEquals(300f, root_child0_child1.getLayoutHeight(), 0.0f);
454-
}
455-
456388
private YogaNode createNode(YogaConfig config) {
457389
return mNodeFactory.create(config);
458390
}

javascript/src/generated/YGEnums.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ export enum Errata {
6868

6969
export enum ExperimentalFeature {
7070
WebFlexBasis = 0,
71-
FixFlexBasisFitContent = 1,
7271
}
7372

7473
export enum FlexDirection {
@@ -193,7 +192,6 @@ const constants = {
193192
ERRATA_ALL: Errata.All,
194193
ERRATA_CLASSIC: Errata.Classic,
195194
EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: ExperimentalFeature.WebFlexBasis,
196-
EXPERIMENTAL_FEATURE_FIX_FLEX_BASIS_FIT_CONTENT: ExperimentalFeature.FixFlexBasisFitContent,
197195
FLEX_DIRECTION_COLUMN: FlexDirection.Column,
198196
FLEX_DIRECTION_COLUMN_REVERSE: FlexDirection.ColumnReverse,
199197
FLEX_DIRECTION_ROW: FlexDirection.Row,

javascript/tests/generated/YGFlexBasisFitContentTest.test.ts

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<52cb2c57af8b80a23fa8217c15d0000a>>
7+
* @generated SignedSource<<8265f8738bd09131df2e6ef29f0e34d7>>
88
* generated by gentest/src/GentestDriver.ts from gentest/fixtures/YGFlexBasisFitContentTest.html
99
*/
1010

@@ -362,68 +362,3 @@ test('explicit_and_container_children_column', () => {
362362
expect(root_child1_child0.getComputedWidth()).toBe(200);
363363
expect(root_child1_child0.getComputedHeight()).toBe(500);
364364
});
365-
test('flex_basis_in_scroll_content_container', () => {
366-
const config = Yoga.Config.create();
367-
368-
config.setExperimentalFeatureEnabled(ExperimentalFeature.FixFlexBasisFitContent, true);
369-
370-
const root = Yoga.Node.create(config);
371-
root.setPositionType(PositionType.Absolute);
372-
root.setWidth(200);
373-
root.setHeight(300);
374-
root.setOverflow(Overflow.Scroll);
375-
376-
const root_child0 = Yoga.Node.create(config);
377-
root.insertChild(root_child0, 0);
378-
379-
const root_child0_child0 = Yoga.Node.create(config);
380-
root_child0_child0.setFlexBasis(200);
381-
root_child0.insertChild(root_child0_child0, 0);
382-
383-
const root_child0_child1 = Yoga.Node.create(config);
384-
root_child0_child1.setFlexBasis(300);
385-
root_child0.insertChild(root_child0_child1, 1);
386-
root.calculateLayout(undefined, undefined, Direction.LTR);
387-
388-
expect(root.getComputedLeft()).toBe(0);
389-
expect(root.getComputedTop()).toBe(0);
390-
expect(root.getComputedWidth()).toBe(200);
391-
expect(root.getComputedHeight()).toBe(300);
392-
393-
expect(root_child0.getComputedLeft()).toBe(0);
394-
expect(root_child0.getComputedTop()).toBe(0);
395-
expect(root_child0.getComputedWidth()).toBe(200);
396-
expect(root_child0.getComputedHeight()).toBe(500);
397-
398-
expect(root_child0_child0.getComputedLeft()).toBe(0);
399-
expect(root_child0_child0.getComputedTop()).toBe(0);
400-
expect(root_child0_child0.getComputedWidth()).toBe(200);
401-
expect(root_child0_child0.getComputedHeight()).toBe(200);
402-
403-
expect(root_child0_child1.getComputedLeft()).toBe(0);
404-
expect(root_child0_child1.getComputedTop()).toBe(200);
405-
expect(root_child0_child1.getComputedWidth()).toBe(200);
406-
expect(root_child0_child1.getComputedHeight()).toBe(300);
407-
408-
root.calculateLayout(undefined, undefined, Direction.RTL);
409-
410-
expect(root.getComputedLeft()).toBe(0);
411-
expect(root.getComputedTop()).toBe(0);
412-
expect(root.getComputedWidth()).toBe(200);
413-
expect(root.getComputedHeight()).toBe(300);
414-
415-
expect(root_child0.getComputedLeft()).toBe(0);
416-
expect(root_child0.getComputedTop()).toBe(0);
417-
expect(root_child0.getComputedWidth()).toBe(200);
418-
expect(root_child0.getComputedHeight()).toBe(500);
419-
420-
expect(root_child0_child0.getComputedLeft()).toBe(0);
421-
expect(root_child0_child0.getComputedTop()).toBe(0);
422-
expect(root_child0_child0.getComputedWidth()).toBe(200);
423-
expect(root_child0_child0.getComputedHeight()).toBe(200);
424-
425-
expect(root_child0_child1.getComputedLeft()).toBe(0);
426-
expect(root_child0_child1.getComputedTop()).toBe(200);
427-
expect(root_child0_child1.getComputedWidth()).toBe(200);
428-
expect(root_child0_child1.getComputedHeight()).toBe(300);
429-
});

0 commit comments

Comments
 (0)