Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@
"ExperimentalFeature": [
# Mimic web flex-basis behavior (experiment may be broken)
"WebFlexBasis",
# Fix flex basis computation to not apply FitContent constraint in the
# main axis for non-measure container nodes
"FixFlexBasisFitContent",
],
"Gutter": ["Column", "Row", "All"],
"GridTrackType": ["Auto", "Points", "Percent", "Fr", "Minmax"],
Expand Down
13 changes: 0 additions & 13 deletions gentest/fixtures/YGFlexBasisFitContentTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,3 @@
<div style="height: 500px;"></div>
</div>
</div>

<!-- Items with flex-basis inside a scroll container's auto-height
content container. With FixFlexBasisFitContent, flex-basis is
respected even when the content container's main axis size is
indefinite (NaN). Without the feature, flex-basis would be ignored. -->
<div id="flex_basis_in_scroll_content_container"
data-experiments="FixFlexBasisFitContent"
style="width: 200px; height: 300px; overflow: scroll;">
<div>
<div style="flex-basis: 200px;"></div>
<div style="flex-basis: 300px;"></div>
</div>
</div>
4 changes: 1 addition & 3 deletions java/com/facebook/yoga/YogaExperimentalFeature.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
package com.facebook.yoga

public enum class YogaExperimentalFeature(public val intValue: Int) {
WEB_FLEX_BASIS(0),
FIX_FLEX_BASIS_FIT_CONTENT(1);
WEB_FLEX_BASIS(0);

public fun intValue(): Int = intValue

Expand All @@ -20,7 +19,6 @@ public enum class YogaExperimentalFeature(public val intValue: Int) {
public fun fromInt(value: Int): YogaExperimentalFeature =
when (value) {
0 -> WEB_FLEX_BASIS
1 -> FIX_FLEX_BASIS_FIT_CONTENT
else -> throw IllegalArgumentException("Unknown enum value: $value")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<43053b7b4f9b08ef644e0bb63c44e78f>>
* @generated SignedSource<<94d885664d3bbf8c72280e1b61102fce>>
* generated by gentest/src/GentestDriver.ts from gentest/fixtures/YGFlexBasisFitContentTest.html
*/

Expand Down Expand Up @@ -385,74 +385,6 @@ public void test_explicit_and_container_children_column() {
assertEquals(500f, root_child1_child0.getLayoutHeight(), 0.0f);
}

@Test
public void test_flex_basis_in_scroll_content_container() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_FLEX_BASIS_FIT_CONTENT, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
root.setWidth(200f);
root.setHeight(300f);
root.setOverflow(YogaOverflow.SCROLL);

final YogaNode root_child0 = createNode(config);
root.addChildAt(root_child0, 0);

final YogaNode root_child0_child0 = createNode(config);
root_child0_child0.setFlexBasis(200f);
root_child0.addChildAt(root_child0_child0, 0);

final YogaNode root_child0_child1 = createNode(config);
root_child0_child1.setFlexBasis(300f);
root_child0.addChildAt(root_child0_child1, 1);
root.setDirection(YogaDirection.LTR);
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);

assertEquals(0f, root.getLayoutX(), 0.0f);
assertEquals(0f, root.getLayoutY(), 0.0f);
assertEquals(200f, root.getLayoutWidth(), 0.0f);
assertEquals(300f, root.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0.getLayoutY(), 0.0f);
assertEquals(200f, root_child0.getLayoutWidth(), 0.0f);
assertEquals(500f, root_child0.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
assertEquals(200f, root_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(200f, root_child0_child0.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child1.getLayoutX(), 0.0f);
assertEquals(200f, root_child0_child1.getLayoutY(), 0.0f);
assertEquals(200f, root_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(300f, root_child0_child1.getLayoutHeight(), 0.0f);

root.setDirection(YogaDirection.RTL);
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);

assertEquals(0f, root.getLayoutX(), 0.0f);
assertEquals(0f, root.getLayoutY(), 0.0f);
assertEquals(200f, root.getLayoutWidth(), 0.0f);
assertEquals(300f, root.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0.getLayoutY(), 0.0f);
assertEquals(200f, root_child0.getLayoutWidth(), 0.0f);
assertEquals(500f, root_child0.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
assertEquals(200f, root_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(200f, root_child0_child0.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child1.getLayoutX(), 0.0f);
assertEquals(200f, root_child0_child1.getLayoutY(), 0.0f);
assertEquals(200f, root_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(300f, root_child0_child1.getLayoutHeight(), 0.0f);
}

private YogaNode createNode(YogaConfig config) {
return mNodeFactory.create(config);
}
Expand Down
2 changes: 0 additions & 2 deletions javascript/src/generated/YGEnums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export enum Errata {

export enum ExperimentalFeature {
WebFlexBasis = 0,
FixFlexBasisFitContent = 1,
}

export enum FlexDirection {
Expand Down Expand Up @@ -193,7 +192,6 @@ const constants = {
ERRATA_ALL: Errata.All,
ERRATA_CLASSIC: Errata.Classic,
EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: ExperimentalFeature.WebFlexBasis,
EXPERIMENTAL_FEATURE_FIX_FLEX_BASIS_FIT_CONTENT: ExperimentalFeature.FixFlexBasisFitContent,
FLEX_DIRECTION_COLUMN: FlexDirection.Column,
FLEX_DIRECTION_COLUMN_REVERSE: FlexDirection.ColumnReverse,
FLEX_DIRECTION_ROW: FlexDirection.Row,
Expand Down
67 changes: 1 addition & 66 deletions javascript/tests/generated/YGFlexBasisFitContentTest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<52cb2c57af8b80a23fa8217c15d0000a>>
* @generated SignedSource<<8265f8738bd09131df2e6ef29f0e34d7>>
* generated by gentest/src/GentestDriver.ts from gentest/fixtures/YGFlexBasisFitContentTest.html
*/

Expand Down Expand Up @@ -362,68 +362,3 @@ test('explicit_and_container_children_column', () => {
expect(root_child1_child0.getComputedWidth()).toBe(200);
expect(root_child1_child0.getComputedHeight()).toBe(500);
});
test('flex_basis_in_scroll_content_container', () => {
const config = Yoga.Config.create();

config.setExperimentalFeatureEnabled(ExperimentalFeature.FixFlexBasisFitContent, true);

const root = Yoga.Node.create(config);
root.setPositionType(PositionType.Absolute);
root.setWidth(200);
root.setHeight(300);
root.setOverflow(Overflow.Scroll);

const root_child0 = Yoga.Node.create(config);
root.insertChild(root_child0, 0);

const root_child0_child0 = Yoga.Node.create(config);
root_child0_child0.setFlexBasis(200);
root_child0.insertChild(root_child0_child0, 0);

const root_child0_child1 = Yoga.Node.create(config);
root_child0_child1.setFlexBasis(300);
root_child0.insertChild(root_child0_child1, 1);
root.calculateLayout(undefined, undefined, Direction.LTR);

expect(root.getComputedLeft()).toBe(0);
expect(root.getComputedTop()).toBe(0);
expect(root.getComputedWidth()).toBe(200);
expect(root.getComputedHeight()).toBe(300);

expect(root_child0.getComputedLeft()).toBe(0);
expect(root_child0.getComputedTop()).toBe(0);
expect(root_child0.getComputedWidth()).toBe(200);
expect(root_child0.getComputedHeight()).toBe(500);

expect(root_child0_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0.getComputedWidth()).toBe(200);
expect(root_child0_child0.getComputedHeight()).toBe(200);

expect(root_child0_child1.getComputedLeft()).toBe(0);
expect(root_child0_child1.getComputedTop()).toBe(200);
expect(root_child0_child1.getComputedWidth()).toBe(200);
expect(root_child0_child1.getComputedHeight()).toBe(300);

root.calculateLayout(undefined, undefined, Direction.RTL);

expect(root.getComputedLeft()).toBe(0);
expect(root.getComputedTop()).toBe(0);
expect(root.getComputedWidth()).toBe(200);
expect(root.getComputedHeight()).toBe(300);

expect(root_child0.getComputedLeft()).toBe(0);
expect(root_child0.getComputedTop()).toBe(0);
expect(root_child0.getComputedWidth()).toBe(200);
expect(root_child0.getComputedHeight()).toBe(500);

expect(root_child0_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0.getComputedWidth()).toBe(200);
expect(root_child0_child0.getComputedHeight()).toBe(200);

expect(root_child0_child1.getComputedLeft()).toBe(0);
expect(root_child0_child1.getComputedTop()).toBe(200);
expect(root_child0_child1.getComputedWidth()).toBe(200);
expect(root_child0_child1.getComputedHeight()).toBe(300);
});
Loading
Loading