Import "Fix percent absolute position and size calcuate different with web" behind experimental feature (#1028) (#1201)
Summary: Fixes https://github.com/facebook/yoga/issues/850 https://github.com/facebook/yoga/issues/850 describes a conformance issue where positioning of an absolute child using percentages is not calculated against the correct box size. This takes the fix for that in https://github.com/facebook/yoga/pull/1028, regenerates tests, and fixes tests so that the experimental feature can be enabled. Goal is to run this as an experiment internally to see if we can enable by default. Changelog: [Internal] Pull Request resolved: https://github.com/facebook/yoga/pull/1201 Reviewed By: yungsters Differential Revision: D42282358 Pulled By: NickGerleman fbshipit-source-id: 57c0dd9b0f1c47cb9335ff6e13d44b4646e5fa58
This commit is contained in:
committed by
Facebook GitHub Bot
parent
627255c0e4
commit
7e96b65790
@@ -11,6 +11,9 @@ test("align_items_stretch", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setWidth(100);
|
||||
@@ -54,6 +57,9 @@ test("align_items_center", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Yoga.ALIGN_CENTER);
|
||||
@@ -99,6 +105,9 @@ test("align_items_flex_start", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Yoga.ALIGN_FLEX_START);
|
||||
@@ -144,6 +153,9 @@ test("align_items_flex_end", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Yoga.ALIGN_FLEX_END);
|
||||
@@ -189,6 +201,9 @@ test("align_baseline", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -250,6 +265,9 @@ test("align_baseline_child", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -326,6 +344,9 @@ test("align_baseline_child_multiline", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -449,6 +470,9 @@ test("align_baseline_child_multiline_override", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -574,6 +598,9 @@ test("align_baseline_child_multiline_no_override_on_secondline", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -698,6 +725,9 @@ test("align_baseline_child_top", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -775,6 +805,9 @@ test("align_baseline_child_top2", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -852,6 +885,9 @@ test("align_baseline_double_nested_child", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -943,6 +979,9 @@ test("align_baseline_column", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
@@ -1003,6 +1042,9 @@ test("align_baseline_child_margin", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -1087,6 +1129,9 @@ test("align_baseline_child_padding", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -1171,6 +1216,9 @@ test("align_baseline_multiline", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -1293,6 +1341,9 @@ test("align_baseline_multiline_column", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
@@ -1414,6 +1465,9 @@ test("align_baseline_multiline_column2", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
@@ -1535,6 +1589,9 @@ test("align_baseline_multiline_row_and_column", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -1657,6 +1714,9 @@ test("align_items_center_child_with_margin_bigger_than_parent", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
|
||||
@@ -1719,6 +1779,9 @@ test("align_items_flex_end_child_with_margin_bigger_than_parent", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
|
||||
@@ -1781,6 +1844,9 @@ test("align_items_center_child_without_margin_bigger_than_parent", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
|
||||
@@ -1841,6 +1907,9 @@ test("align_items_flex_end_child_without_margin_bigger_than_parent", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Yoga.JUSTIFY_CENTER);
|
||||
@@ -1901,6 +1970,9 @@ test("align_center_should_size_based_on_content", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Yoga.ALIGN_CENTER);
|
||||
@@ -1977,6 +2049,9 @@ test("align_stretch_should_size_based_on_parent", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setMargin(Yoga.EDGE_TOP, 20);
|
||||
@@ -2052,6 +2127,9 @@ test("align_flex_start_with_shrinking_children", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setWidth(500);
|
||||
@@ -2125,6 +2203,9 @@ test("align_flex_start_with_stretching_children", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setWidth(500);
|
||||
@@ -2197,6 +2278,9 @@ test("align_flex_start_with_shrinking_children_with_stretch", () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
|
||||
config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setWidth(500);
|
||||
|
Reference in New Issue
Block a user