Skip to content

Commit

Permalink
Hardcode AbsolutePercentageAgainstPaddingEdge to true
Browse files Browse the repository at this point in the history
Differential Revision: https://www.internalfb.com/diff/D52705765?entry_point=27

fbshipit-source-id: 85c101dc24f4ec5812443958a17ec8d512dc19bf
  • Loading branch information
Joe Vilches authored and facebook-github-bot committed Jan 18, 2024
1 parent 0bbfe45 commit ce8858e
Show file tree
Hide file tree
Showing 73 changed files with 69 additions and 1,825 deletions.
2 changes: 0 additions & 2 deletions enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@
"ExperimentalFeature": [
# Mimic web flex-basis behavior (experiment may be broken)
"WebFlexBasis",
# Conformance fix: https://github.com/facebook/yoga/pull/1028
"AbsolutePercentageAgainstPaddingEdge",
],
"PrintOptions": [
("Layout", 1 << 0),
Expand Down
4 changes: 1 addition & 3 deletions gentest/gentest.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
/* eslint-env browser */
/* global CPPEmitter:readable, JavaEmitter:readable, JavascriptEmitter:readable */

const DEFAULT_EXPERIMENTS = ['AbsolutePercentageAgainstPaddingEdge'];

const INVISIBLE_BORDER_STYLES = ['none', 'initial'];

window.onload = function () {
Expand Down Expand Up @@ -723,7 +721,7 @@ function calculateTree(root, parentOffsetLeft, parentOffsetTop) {
rawStyle: child.getAttribute('style'),
experiments: child.dataset.experiments
? child.dataset.experiments.split(' ')
: DEFAULT_EXPERIMENTS,
: [],
disabled: child.dataset.disabled === 'true',
};

Expand Down
4 changes: 1 addition & 3 deletions java/com/facebook/yoga/YogaExperimentalFeature.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
package com.facebook.yoga;

public enum YogaExperimentalFeature {
WEB_FLEX_BASIS(0),
ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE(1);
WEB_FLEX_BASIS(0);

private final int mIntValue;

Expand All @@ -26,7 +25,6 @@ public int intValue() {
public static YogaExperimentalFeature fromInt(int value) {
switch (value) {
case 0: return WEB_FLEX_BASIS;
case 1: return ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE;
default: throw new IllegalArgumentException("Unknown enum value: " + value);
}
}
Expand Down
30 changes: 1 addition & 29 deletions java/tests/com/facebook/yoga/YGAbsolutePositionTest.java
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<<c6af39d5ce8d918c185b38a244437228>>
* @generated SignedSource<<655bad05f0830b5ea39b80b01b0e5e9c>>
* generated by gentest/gentest-driver.ts from gentest/fixtures/YGAbsolutePositionTest.html
*/

Expand All @@ -29,7 +29,6 @@ public static Iterable<TestParametrization.NodeFactory> nodeFactories() {
@Test
public void test_absolute_layout_width_height_start_top() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down Expand Up @@ -73,7 +72,6 @@ public void test_absolute_layout_width_height_start_top() {
@Test
public void test_absolute_layout_width_height_end_bottom() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down Expand Up @@ -117,7 +115,6 @@ public void test_absolute_layout_width_height_end_bottom() {
@Test
public void test_absolute_layout_start_top_end_bottom() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down Expand Up @@ -161,7 +158,6 @@ public void test_absolute_layout_start_top_end_bottom() {
@Test
public void test_absolute_layout_width_height_start_top_end_bottom() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down Expand Up @@ -207,7 +203,6 @@ public void test_absolute_layout_width_height_start_top_end_bottom() {
@Test
public void test_do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setFlexDirection(YogaFlexDirection.ROW);
Expand Down Expand Up @@ -266,7 +261,6 @@ public void test_do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_
@Test
public void test_absolute_layout_within_border() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down Expand Up @@ -384,7 +378,6 @@ public void test_absolute_layout_within_border() {
@Test
public void test_absolute_layout_align_items_and_justify_content_center() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setJustifyContent(YogaJustify.CENTER);
Expand Down Expand Up @@ -429,7 +422,6 @@ public void test_absolute_layout_align_items_and_justify_content_center() {
@Test
public void test_absolute_layout_align_items_and_justify_content_flex_end() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setJustifyContent(YogaJustify.FLEX_END);
Expand Down Expand Up @@ -474,7 +466,6 @@ public void test_absolute_layout_align_items_and_justify_content_flex_end() {
@Test
public void test_absolute_layout_justify_content_center() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setJustifyContent(YogaJustify.CENTER);
Expand Down Expand Up @@ -518,7 +509,6 @@ public void test_absolute_layout_justify_content_center() {
@Test
public void test_absolute_layout_align_items_center() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setAlignItems(YogaAlign.CENTER);
Expand Down Expand Up @@ -562,7 +552,6 @@ public void test_absolute_layout_align_items_center() {
@Test
public void test_absolute_layout_align_items_center_on_child_only() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down Expand Up @@ -606,7 +595,6 @@ public void test_absolute_layout_align_items_center_on_child_only() {
@Test
public void test_absolute_layout_align_items_and_justify_content_center_and_top_position() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setJustifyContent(YogaJustify.CENTER);
Expand Down Expand Up @@ -652,7 +640,6 @@ public void test_absolute_layout_align_items_and_justify_content_center_and_top_
@Test
public void test_absolute_layout_align_items_and_justify_content_center_and_bottom_position() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setJustifyContent(YogaJustify.CENTER);
Expand Down Expand Up @@ -698,7 +685,6 @@ public void test_absolute_layout_align_items_and_justify_content_center_and_bott
@Test
public void test_absolute_layout_align_items_and_justify_content_center_and_left_position() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setJustifyContent(YogaJustify.CENTER);
Expand Down Expand Up @@ -744,7 +730,6 @@ public void test_absolute_layout_align_items_and_justify_content_center_and_left
@Test
public void test_absolute_layout_align_items_and_justify_content_center_and_right_position() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setJustifyContent(YogaJustify.CENTER);
Expand Down Expand Up @@ -790,7 +775,6 @@ public void test_absolute_layout_align_items_and_justify_content_center_and_righ
@Test
public void test_position_root_with_rtl_should_position_withoutdirection() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand All @@ -817,7 +801,6 @@ public void test_position_root_with_rtl_should_position_withoutdirection() {
@Test
public void test_absolute_layout_percentage_bottom_based_on_parent_height() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down Expand Up @@ -894,7 +877,6 @@ public void test_absolute_layout_percentage_bottom_based_on_parent_height() {
@Test
public void test_absolute_layout_in_wrap_reverse_column_container() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down Expand Up @@ -937,7 +919,6 @@ public void test_absolute_layout_in_wrap_reverse_column_container() {
@Test
public void test_absolute_layout_in_wrap_reverse_row_container() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setFlexDirection(YogaFlexDirection.ROW);
Expand Down Expand Up @@ -981,7 +962,6 @@ public void test_absolute_layout_in_wrap_reverse_row_container() {
@Test
public void test_absolute_layout_in_wrap_reverse_column_container_flex_end() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down Expand Up @@ -1025,7 +1005,6 @@ public void test_absolute_layout_in_wrap_reverse_column_container_flex_end() {
@Test
public void test_absolute_layout_in_wrap_reverse_row_container_flex_end() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setFlexDirection(YogaFlexDirection.ROW);
Expand Down Expand Up @@ -1070,7 +1049,6 @@ public void test_absolute_layout_in_wrap_reverse_row_container_flex_end() {
@Test
public void test_percent_absolute_position_infinite_height() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down Expand Up @@ -1127,7 +1105,6 @@ public void test_percent_absolute_position_infinite_height() {
@Test
public void test_absolute_layout_percentage_height_based_on_padded_parent() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down Expand Up @@ -1171,7 +1148,6 @@ public void test_absolute_layout_percentage_height_based_on_padded_parent() {
@Test
public void test_absolute_layout_percentage_height_based_on_padded_parent_and_align_items_center() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setJustifyContent(YogaJustify.CENTER);
Expand Down Expand Up @@ -1216,7 +1192,6 @@ public void test_absolute_layout_percentage_height_based_on_padded_parent_and_al
@Test
public void test_absolute_layout_padding_left() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down Expand Up @@ -1259,7 +1234,6 @@ public void test_absolute_layout_padding_left() {
@Test
public void test_absolute_layout_padding_right() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down Expand Up @@ -1302,7 +1276,6 @@ public void test_absolute_layout_padding_right() {
@Test
public void test_absolute_layout_padding_top() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down Expand Up @@ -1345,7 +1318,6 @@ public void test_absolute_layout_padding_top() {
@Test
public void test_absolute_layout_padding_bottom() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);

final YogaNode root = createNode(config);
root.setPositionType(YogaPositionType.ABSOLUTE);
Expand Down
Loading

0 comments on commit ce8858e

Please sign in to comment.