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("margin_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -56,6 +59,9 @@ test("margin_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.setWidth(100);
|
||||
@@ -100,6 +106,9 @@ test("margin_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -146,6 +155,9 @@ test("margin_bottom", () => {
|
||||
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_FLEX_END);
|
||||
@@ -191,6 +203,9 @@ test("margin_and_flex_row", () => {
|
||||
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);
|
||||
@@ -237,6 +252,9 @@ test("margin_and_flex_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.setWidth(100);
|
||||
@@ -282,6 +300,9 @@ test("margin_and_stretch_row", () => {
|
||||
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);
|
||||
@@ -328,6 +349,9 @@ test("margin_and_stretch_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.setWidth(100);
|
||||
@@ -373,6 +397,9 @@ test("margin_with_sibling_row", () => {
|
||||
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);
|
||||
@@ -432,6 +459,9 @@ test("margin_with_sibling_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.setWidth(100);
|
||||
@@ -490,6 +520,9 @@ test("margin_auto_bottom", () => {
|
||||
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);
|
||||
@@ -551,6 +584,9 @@ test("margin_auto_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.setAlignItems(Yoga.ALIGN_CENTER);
|
||||
@@ -612,6 +648,9 @@ test("margin_auto_bottom_and_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.setAlignItems(Yoga.ALIGN_CENTER);
|
||||
@@ -674,6 +713,9 @@ test("margin_auto_bottom_and_top_justify_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.setJustifyContent(Yoga.JUSTIFY_CENTER);
|
||||
@@ -736,6 +778,9 @@ test("margin_auto_mutiple_children_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_CENTER);
|
||||
@@ -813,6 +858,9 @@ test("margin_auto_mutiple_children_row", () => {
|
||||
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);
|
||||
@@ -891,6 +939,9 @@ test("margin_auto_left_and_right_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);
|
||||
@@ -954,6 +1005,9 @@ test("margin_auto_left_and_right", () => {
|
||||
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(200);
|
||||
@@ -1015,6 +1069,9 @@ test("margin_auto_start_and_end_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);
|
||||
@@ -1078,6 +1135,9 @@ test("margin_auto_start_and_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.setWidth(200);
|
||||
@@ -1139,6 +1199,9 @@ test("margin_auto_left_and_right_column_and_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);
|
||||
@@ -1201,6 +1264,9 @@ test("margin_auto_left", () => {
|
||||
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);
|
||||
@@ -1262,6 +1328,9 @@ test("margin_auto_right", () => {
|
||||
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);
|
||||
@@ -1323,6 +1392,9 @@ test("margin_auto_left_and_right_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
@@ -1385,6 +1457,9 @@ test("margin_auto_top_and_bottom_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(200);
|
||||
@@ -1446,6 +1521,9 @@ test("margin_should_not_be_part_of_max_height", () => {
|
||||
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(250);
|
||||
@@ -1492,6 +1570,9 @@ test("margin_should_not_be_part_of_max_width", () => {
|
||||
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(250);
|
||||
@@ -1538,6 +1619,9 @@ test("margin_auto_left_right_child_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);
|
||||
@@ -1585,6 +1669,9 @@ test("margin_auto_left_child_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);
|
||||
@@ -1631,6 +1718,9 @@ test("margin_fix_left_auto_right_child_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);
|
||||
@@ -1678,6 +1768,9 @@ test("margin_auto_left_fix_right_child_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);
|
||||
@@ -1725,6 +1818,9 @@ test("margin_auto_top_stretching_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.setAlignItems(Yoga.ALIGN_CENTER);
|
||||
@@ -1787,6 +1883,9 @@ test("margin_auto_left_stretching_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.setAlignItems(Yoga.ALIGN_CENTER);
|
||||
|
Reference in New Issue
Block a user