From 7e96b65790c53359583e480776278159556b7def Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sun, 8 Jan 2023 13:41:27 -0800 Subject: [PATCH] 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 --- .../Facebook.Yoga/YogaExperimentalFeature.cs | 2 + .../Facebook.Yoga/YGAbsolutePositionTest.cs | 192 +++++++++++++++ .../tests/Facebook.Yoga/YGAlignContentTest.cs | 38 +++ .../tests/Facebook.Yoga/YGAlignItemsTest.cs | 56 +++++ csharp/tests/Facebook.Yoga/YGAlignSelfTest.cs | 10 + .../tests/Facebook.Yoga/YGAndroidNewsFeed.cs | 2 + csharp/tests/Facebook.Yoga/YGBorderTest.cs | 10 + csharp/tests/Facebook.Yoga/YGDimensionTest.cs | 4 + csharp/tests/Facebook.Yoga/YGDisplayTest.cs | 12 + .../Facebook.Yoga/YGFlexDirectionTest.cs | 12 + csharp/tests/Facebook.Yoga/YGFlexTest.cs | 20 ++ csharp/tests/Facebook.Yoga/YGFlexWrapTest.cs | 40 +++ csharp/tests/Facebook.Yoga/YGGapTest.cs | 46 ++++ .../Facebook.Yoga/YGJustifyContentTest.cs | 36 +++ csharp/tests/Facebook.Yoga/YGMarginTest.cs | 66 +++++ .../Facebook.Yoga/YGMinMaxDimensionTest.cs | 48 ++++ csharp/tests/Facebook.Yoga/YGPaddingTest.cs | 12 + .../tests/Facebook.Yoga/YGPercentageTest.cs | 38 +++ csharp/tests/Facebook.Yoga/YGRoundingTest.cs | 26 ++ .../tests/Facebook.Yoga/YGSizeOverflowTest.cs | 6 + enums.py | 8 +- gentest/fixtures/YGAbsolutePositionTest.html | 12 + gentest/gentest-javascript.js | 7 +- gentest/gentest.js | 7 +- .../yoga/YogaExperimentalFeature.java | 6 +- .../facebook/yoga/YGAbsolutePositionTest.java | 189 +++++++++++++++ .../com/facebook/yoga/YGAlignContentTest.java | 38 +++ .../com/facebook/yoga/YGAlignItemsTest.java | 56 +++++ .../com/facebook/yoga/YGAlignSelfTest.java | 10 + .../com/facebook/yoga/YGAndroidNewsFeed.java | 2 + .../tests/com/facebook/yoga/YGBorderTest.java | 10 + .../com/facebook/yoga/YGDimensionTest.java | 4 + .../com/facebook/yoga/YGDisplayTest.java | 12 + .../facebook/yoga/YGFlexDirectionTest.java | 12 + java/tests/com/facebook/yoga/YGFlexTest.java | 20 ++ .../com/facebook/yoga/YGFlexWrapTest.java | 40 +++ java/tests/com/facebook/yoga/YGGapTest.java | 46 ++++ .../facebook/yoga/YGJustifyContentTest.java | 36 +++ .../tests/com/facebook/yoga/YGMarginTest.java | 66 +++++ .../facebook/yoga/YGMinMaxDimensionTest.java | 48 ++++ .../com/facebook/yoga/YGPaddingTest.java | 12 + .../com/facebook/yoga/YGPercentageTest.java | 38 +++ .../com/facebook/yoga/YGRoundingTest.java | 26 ++ .../com/facebook/yoga/YGSizeOverflowTest.java | 6 + javascript/src_js/generated/YGEnums.d.ts | 10 +- javascript/src_js/generated/YGEnums.js | 2 + .../generated/YGAbsolutePositionTest.test.js | 228 ++++++++++++++++++ .../generated/YGAlignContentTest.test.js | 57 +++++ .../tests/generated/YGAlignItemsTest.test.js | 84 +++++++ .../tests/generated/YGAlignSelfTest.test.js | 15 ++ .../tests/generated/YGAndroidNewsFeed.test.js | 3 + .../tests/generated/YGBorderTest.test.js | 15 ++ .../tests/generated/YGDimensionTest.test.js | 6 + .../tests/generated/YGDisplayTest.test.js | 18 ++ .../generated/YGFlexDirectionTest.test.js | 18 ++ javascript/tests/generated/YGFlexTest.test.js | 30 +++ .../tests/generated/YGFlexWrapTest.test.js | 60 +++++ javascript/tests/generated/YGGapTest.test.js | 69 ++++++ .../generated/YGJustifyContentTest.test.js | 54 +++++ .../tests/generated/YGMarginTest.test.js | 99 ++++++++ .../generated/YGMinMaxDimensionTest.test.js | 72 ++++++ .../tests/generated/YGPaddingTest.test.js | 18 ++ .../tests/generated/YGPercentageTest.test.js | 57 +++++ .../tests/generated/YGRoundingTest.test.js | 39 +++ .../generated/YGSizeOverflowTest.test.js | 9 + tests/YGInfiniteHeightTest.cpp | 54 ----- tests/generated/YGAbsolutePositionTest.cpp | 192 +++++++++++++++ tests/generated/YGAlignContentTest.cpp | 38 +++ tests/generated/YGAlignItemsTest.cpp | 56 +++++ tests/generated/YGAlignSelfTest.cpp | 10 + tests/generated/YGAndroidNewsFeed.cpp | 2 + tests/generated/YGBorderTest.cpp | 10 + tests/generated/YGDimensionTest.cpp | 4 + tests/generated/YGDisplayTest.cpp | 12 + tests/generated/YGFlexDirectionTest.cpp | 12 + tests/generated/YGFlexTest.cpp | 20 ++ tests/generated/YGFlexWrapTest.cpp | 40 +++ tests/generated/YGGapTest.cpp | 46 ++++ tests/generated/YGJustifyContentTest.cpp | 36 +++ tests/generated/YGMarginTest.cpp | 66 +++++ tests/generated/YGMinMaxDimensionTest.cpp | 48 ++++ tests/generated/YGPaddingTest.cpp | 12 + tests/generated/YGPercentageTest.cpp | 38 +++ tests/generated/YGRoundingTest.cpp | 26 ++ tests/generated/YGSizeOverflowTest.cpp | 6 + yoga/YGEnums.cpp | 4 + yoga/YGEnums.h | 4 +- yoga/Yoga.cpp | 58 ++++- 88 files changed, 3077 insertions(+), 67 deletions(-) delete mode 100644 tests/YGInfiniteHeightTest.cpp diff --git a/csharp/Facebook.Yoga/YogaExperimentalFeature.cs b/csharp/Facebook.Yoga/YogaExperimentalFeature.cs index c78a77ba..748101c4 100644 --- a/csharp/Facebook.Yoga/YogaExperimentalFeature.cs +++ b/csharp/Facebook.Yoga/YogaExperimentalFeature.cs @@ -12,5 +12,7 @@ namespace Facebook.Yoga public enum YogaExperimentalFeature { WebFlexBasis, + AbsolutePercentageAgainstPaddingEdge, + FixAbsoluteTrailingColumnMargin, } } diff --git a/csharp/tests/Facebook.Yoga/YGAbsolutePositionTest.cs b/csharp/tests/Facebook.Yoga/YGAbsolutePositionTest.cs index 7ff003a2..3470ef53 100644 --- a/csharp/tests/Facebook.Yoga/YGAbsolutePositionTest.cs +++ b/csharp/tests/Facebook.Yoga/YGAbsolutePositionTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_width_height_start_top() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -62,6 +64,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_width_height_end_bottom() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -105,6 +109,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_start_top_end_bottom() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -148,6 +154,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_width_height_start_top_end_bottom() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -193,6 +201,8 @@ namespace Facebook.Yoga public void Test_do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -251,6 +261,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_within_border() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.MarginLeft = 10; @@ -368,6 +380,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_and_justify_content_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -412,6 +426,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_and_justify_content_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.FlexEnd; @@ -456,6 +472,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_justify_content_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -499,6 +517,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -542,6 +562,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_center_on_child_only() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexGrow = 1; @@ -585,6 +607,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_and_justify_content_center_and_top_position() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -630,6 +654,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_and_justify_content_center_and_bottom_position() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -675,6 +701,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_and_justify_content_center_and_left_position() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -720,6 +748,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_align_items_and_justify_content_center_and_right_position() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -765,6 +795,8 @@ namespace Facebook.Yoga public void Test_position_root_with_rtl_should_position_withoutdirection() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Left = 72; @@ -791,6 +823,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_percentage_bottom_based_on_parent_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -867,6 +901,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_in_wrap_reverse_column_container() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Wrap = YogaWrap.WrapReverse; @@ -909,6 +945,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_in_wrap_reverse_row_container() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -952,6 +990,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_in_wrap_reverse_column_container_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Wrap = YogaWrap.WrapReverse; @@ -995,6 +1035,8 @@ namespace Facebook.Yoga public void Test_absolute_layout_in_wrap_reverse_row_container_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1035,5 +1077,155 @@ namespace Facebook.Yoga Assert.AreEqual(20f, root_child0.LayoutHeight); } + [Test] + public void Test_percent_absolute_position_infinite_height() + { + YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); + + YogaNode root = new YogaNode(config); + root.Width = 300; + + YogaNode root_child0 = new YogaNode(config); + root_child0.Width = 300; + root.Insert(0, root_child0); + + YogaNode root_child1 = new YogaNode(config); + root_child1.PositionType = YogaPositionType.Absolute; + root_child1.Left = 20.Percent(); + root_child1.Top = 20.Percent(); + root_child1.Width = 20.Percent(); + root_child1.Height = 20.Percent(); + root.Insert(1, root_child1); + root.StyleDirection = YogaDirection.LTR; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(300f, root.LayoutWidth); + Assert.AreEqual(0f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(0f, root_child0.LayoutY); + Assert.AreEqual(300f, root_child0.LayoutWidth); + Assert.AreEqual(0f, root_child0.LayoutHeight); + + Assert.AreEqual(60f, root_child1.LayoutX); + Assert.AreEqual(0f, root_child1.LayoutY); + Assert.AreEqual(60f, root_child1.LayoutWidth); + Assert.AreEqual(0f, root_child1.LayoutHeight); + + root.StyleDirection = YogaDirection.RTL; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(300f, root.LayoutWidth); + Assert.AreEqual(0f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(0f, root_child0.LayoutY); + Assert.AreEqual(300f, root_child0.LayoutWidth); + Assert.AreEqual(0f, root_child0.LayoutHeight); + + Assert.AreEqual(60f, root_child1.LayoutX); + Assert.AreEqual(0f, root_child1.LayoutY); + Assert.AreEqual(60f, root_child1.LayoutWidth); + Assert.AreEqual(0f, root_child1.LayoutHeight); + } + + [Test] + public void Test_absolute_layout_percentage_height_based_on_padded_parent() + { + YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); + + YogaNode root = new YogaNode(config); + root.PaddingTop = 10; + root.BorderTopWidth = 10; + root.Width = 100; + root.Height = 100; + + YogaNode root_child0 = new YogaNode(config); + root_child0.PositionType = YogaPositionType.Absolute; + root_child0.Width = 100; + root_child0.Height = 50.Percent(); + root.Insert(0, root_child0); + root.StyleDirection = YogaDirection.LTR; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(100f, root.LayoutWidth); + Assert.AreEqual(100f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(10f, root_child0.LayoutY); + Assert.AreEqual(100f, root_child0.LayoutWidth); + Assert.AreEqual(50f, root_child0.LayoutHeight); + + root.StyleDirection = YogaDirection.RTL; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(100f, root.LayoutWidth); + Assert.AreEqual(100f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(10f, root_child0.LayoutY); + Assert.AreEqual(100f, root_child0.LayoutWidth); + Assert.AreEqual(50f, root_child0.LayoutHeight); + } + + [Test] + public void Test_absolute_layout_percentage_height_based_on_padded_parent_and_align_items_center() + { + YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); + + YogaNode root = new YogaNode(config); + root.JustifyContent = YogaJustify.Center; + root.AlignItems = YogaAlign.Center; + root.PaddingTop = 20; + root.PaddingBottom = 20; + root.Width = 100; + root.Height = 100; + + YogaNode root_child0 = new YogaNode(config); + root_child0.PositionType = YogaPositionType.Absolute; + root_child0.Width = 100; + root_child0.Height = 50.Percent(); + root.Insert(0, root_child0); + root.StyleDirection = YogaDirection.LTR; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(100f, root.LayoutWidth); + Assert.AreEqual(100f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(25f, root_child0.LayoutY); + Assert.AreEqual(100f, root_child0.LayoutWidth); + Assert.AreEqual(50f, root_child0.LayoutHeight); + + root.StyleDirection = YogaDirection.RTL; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(100f, root.LayoutWidth); + Assert.AreEqual(100f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(25f, root_child0.LayoutY); + Assert.AreEqual(100f, root_child0.LayoutWidth); + Assert.AreEqual(50f, root_child0.LayoutHeight); + } + } } diff --git a/csharp/tests/Facebook.Yoga/YGAlignContentTest.cs b/csharp/tests/Facebook.Yoga/YGAlignContentTest.cs index 81969c99..56c88a43 100644 --- a/csharp/tests/Facebook.Yoga/YGAlignContentTest.cs +++ b/csharp/tests/Facebook.Yoga/YGAlignContentTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_align_content_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -121,6 +123,8 @@ namespace Facebook.Yoga public void Test_align_content_flex_start_without_height_on_children() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Wrap = YogaWrap.Wrap; @@ -219,6 +223,8 @@ namespace Facebook.Yoga public void Test_align_content_flex_start_with_flex() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Wrap = YogaWrap.Wrap; @@ -323,6 +329,8 @@ namespace Facebook.Yoga public void Test_align_content_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignContent = YogaAlign.FlexEnd; @@ -425,6 +433,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignContent = YogaAlign.Stretch; @@ -522,6 +532,8 @@ namespace Facebook.Yoga public void Test_align_content_spacebetween() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -625,6 +637,8 @@ namespace Facebook.Yoga public void Test_align_content_spacearound() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -728,6 +742,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -826,6 +842,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_children() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -940,6 +958,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_flex() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1044,6 +1064,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_flex_no_shrink() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1147,6 +1169,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1253,6 +1277,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_padding() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1359,6 +1385,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_single_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1415,6 +1443,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_fixed_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1514,6 +1544,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_max_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1613,6 +1645,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_row_with_min_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1712,6 +1746,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignContent = YogaAlign.Stretch; @@ -1828,6 +1864,8 @@ namespace Facebook.Yoga public void Test_align_content_stretch_is_not_overriding_align_items() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignContent = YogaAlign.Stretch; diff --git a/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs b/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs index 9a660aad..8e879acd 100644 --- a/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs +++ b/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_align_items_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -58,6 +60,8 @@ namespace Facebook.Yoga public void Test_align_items_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -99,6 +103,8 @@ namespace Facebook.Yoga public void Test_align_items_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.FlexStart; @@ -140,6 +146,8 @@ namespace Facebook.Yoga public void Test_align_items_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.FlexEnd; @@ -181,6 +189,8 @@ namespace Facebook.Yoga public void Test_align_baseline() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -238,6 +248,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -310,6 +322,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child_multiline() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -429,6 +443,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child_multiline_override() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -550,6 +566,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child_multiline_no_override_on_secondline() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -670,6 +688,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child_top() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -743,6 +763,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child_top2() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -816,6 +838,8 @@ namespace Facebook.Yoga public void Test_align_baseline_double_nested_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -903,6 +927,8 @@ namespace Facebook.Yoga public void Test_align_baseline_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Baseline; @@ -959,6 +985,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1039,6 +1067,8 @@ namespace Facebook.Yoga public void Test_align_baseline_child_padding() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1119,6 +1149,8 @@ namespace Facebook.Yoga public void Test_align_baseline_multiline() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1237,6 +1269,8 @@ namespace Facebook.Yoga public void Test_align_baseline_multiline_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Baseline; @@ -1354,6 +1388,8 @@ namespace Facebook.Yoga public void Test_align_baseline_multiline_column2() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Baseline; @@ -1471,6 +1507,8 @@ namespace Facebook.Yoga public void Test_align_baseline_multiline_row_and_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1589,6 +1627,8 @@ namespace Facebook.Yoga public void Test_align_items_center_child_with_margin_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1647,6 +1687,8 @@ namespace Facebook.Yoga public void Test_align_items_flex_end_child_with_margin_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1705,6 +1747,8 @@ namespace Facebook.Yoga public void Test_align_items_center_child_without_margin_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1761,6 +1805,8 @@ namespace Facebook.Yoga public void Test_align_items_flex_end_child_without_margin_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1817,6 +1863,8 @@ namespace Facebook.Yoga public void Test_align_center_should_size_based_on_content() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -1889,6 +1937,8 @@ namespace Facebook.Yoga public void Test_align_stretch_should_size_based_on_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.MarginTop = 20; @@ -1960,6 +2010,8 @@ namespace Facebook.Yoga public void Test_align_flex_start_with_shrinking_children() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 500; @@ -2029,6 +2081,8 @@ namespace Facebook.Yoga public void Test_align_flex_start_with_stretching_children() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 500; @@ -2097,6 +2151,8 @@ namespace Facebook.Yoga public void Test_align_flex_start_with_shrinking_children_with_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 500; diff --git a/csharp/tests/Facebook.Yoga/YGAlignSelfTest.cs b/csharp/tests/Facebook.Yoga/YGAlignSelfTest.cs index 2477fd2b..998d7208 100644 --- a/csharp/tests/Facebook.Yoga/YGAlignSelfTest.cs +++ b/csharp/tests/Facebook.Yoga/YGAlignSelfTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_align_self_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -60,6 +62,8 @@ namespace Facebook.Yoga public void Test_align_self_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -101,6 +105,8 @@ namespace Facebook.Yoga public void Test_align_self_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -142,6 +148,8 @@ namespace Facebook.Yoga public void Test_align_self_flex_end_override_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.FlexStart; @@ -184,6 +192,8 @@ namespace Facebook.Yoga public void Test_align_self_baseline() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; diff --git a/csharp/tests/Facebook.Yoga/YGAndroidNewsFeed.cs b/csharp/tests/Facebook.Yoga/YGAndroidNewsFeed.cs index 5c8249cd..e524cc49 100644 --- a/csharp/tests/Facebook.Yoga/YGAndroidNewsFeed.cs +++ b/csharp/tests/Facebook.Yoga/YGAndroidNewsFeed.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_android_news_feed() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignContent = YogaAlign.Stretch; diff --git a/csharp/tests/Facebook.Yoga/YGBorderTest.cs b/csharp/tests/Facebook.Yoga/YGBorderTest.cs index 854bb59b..084d00a7 100644 --- a/csharp/tests/Facebook.Yoga/YGBorderTest.cs +++ b/csharp/tests/Facebook.Yoga/YGBorderTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_border_no_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.BorderLeftWidth = 10; @@ -46,6 +48,8 @@ namespace Facebook.Yoga public void Test_border_container_match_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.BorderLeftWidth = 10; @@ -88,6 +92,8 @@ namespace Facebook.Yoga public void Test_border_flex_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.BorderLeftWidth = 10; @@ -132,6 +138,8 @@ namespace Facebook.Yoga public void Test_border_stretch_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.BorderLeftWidth = 10; @@ -175,6 +183,8 @@ namespace Facebook.Yoga public void Test_border_center_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; diff --git a/csharp/tests/Facebook.Yoga/YGDimensionTest.cs b/csharp/tests/Facebook.Yoga/YGDimensionTest.cs index 53a84dfe..8263bcd9 100644 --- a/csharp/tests/Facebook.Yoga/YGDimensionTest.cs +++ b/csharp/tests/Facebook.Yoga/YGDimensionTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_wrap_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); @@ -57,6 +59,8 @@ namespace Facebook.Yoga public void Test_wrap_grandchild() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); diff --git a/csharp/tests/Facebook.Yoga/YGDisplayTest.cs b/csharp/tests/Facebook.Yoga/YGDisplayTest.cs index 4b0da55c..ba6e17ee 100644 --- a/csharp/tests/Facebook.Yoga/YGDisplayTest.cs +++ b/csharp/tests/Facebook.Yoga/YGDisplayTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_display_none() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -74,6 +76,8 @@ namespace Facebook.Yoga public void Test_display_none_fixed_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -130,6 +134,8 @@ namespace Facebook.Yoga public void Test_display_none_with_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -190,6 +196,8 @@ namespace Facebook.Yoga public void Test_display_none_with_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -282,6 +290,8 @@ namespace Facebook.Yoga public void Test_display_none_with_position() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -338,6 +348,8 @@ namespace Facebook.Yoga public void Test_display_none_with_position_absolute() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; diff --git a/csharp/tests/Facebook.Yoga/YGFlexDirectionTest.cs b/csharp/tests/Facebook.Yoga/YGFlexDirectionTest.cs index 09b41dc0..99c352ea 100644 --- a/csharp/tests/Facebook.Yoga/YGFlexDirectionTest.cs +++ b/csharp/tests/Facebook.Yoga/YGFlexDirectionTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_flex_direction_column_no_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -85,6 +87,8 @@ namespace Facebook.Yoga public void Test_flex_direction_row_no_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -152,6 +156,8 @@ namespace Facebook.Yoga public void Test_flex_direction_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -219,6 +225,8 @@ namespace Facebook.Yoga public void Test_flex_direction_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -287,6 +295,8 @@ namespace Facebook.Yoga public void Test_flex_direction_column_reverse() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.ColumnReverse; @@ -355,6 +365,8 @@ namespace Facebook.Yoga public void Test_flex_direction_row_reverse() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.RowReverse; diff --git a/csharp/tests/Facebook.Yoga/YGFlexTest.cs b/csharp/tests/Facebook.Yoga/YGFlexTest.cs index a8d3a0a6..54345ed4 100644 --- a/csharp/tests/Facebook.Yoga/YGFlexTest.cs +++ b/csharp/tests/Facebook.Yoga/YGFlexTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_flex_basis_flex_grow_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -73,6 +75,8 @@ namespace Facebook.Yoga public void Test_flex_shrink_flex_grow_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -131,6 +135,8 @@ namespace Facebook.Yoga public void Test_flex_shrink_flex_grow_child_flex_shrink_other_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -190,6 +196,8 @@ namespace Facebook.Yoga public void Test_flex_basis_flex_grow_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -245,6 +253,8 @@ namespace Facebook.Yoga public void Test_flex_basis_flex_shrink_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -299,6 +309,8 @@ namespace Facebook.Yoga public void Test_flex_basis_flex_shrink_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -354,6 +366,8 @@ namespace Facebook.Yoga public void Test_flex_shrink_to_zero() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Height = 75; @@ -424,6 +438,8 @@ namespace Facebook.Yoga public void Test_flex_basis_overrides_main_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -495,6 +511,8 @@ namespace Facebook.Yoga public void Test_flex_grow_shrink_at_most() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -548,6 +566,8 @@ namespace Facebook.Yoga public void Test_flex_grow_less_than_factor_one() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; diff --git a/csharp/tests/Facebook.Yoga/YGFlexWrapTest.cs b/csharp/tests/Facebook.Yoga/YGFlexWrapTest.cs index 879fadc5..8812dc57 100644 --- a/csharp/tests/Facebook.Yoga/YGFlexWrapTest.cs +++ b/csharp/tests/Facebook.Yoga/YGFlexWrapTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_wrap_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Wrap = YogaWrap.Wrap; @@ -104,6 +106,8 @@ namespace Facebook.Yoga public void Test_wrap_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -190,6 +194,8 @@ namespace Facebook.Yoga public void Test_wrap_row_align_items_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -277,6 +283,8 @@ namespace Facebook.Yoga public void Test_wrap_row_align_items_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -364,6 +372,8 @@ namespace Facebook.Yoga public void Test_flex_wrap_children_with_min_main_overriding_flex_basis() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -422,6 +432,8 @@ namespace Facebook.Yoga public void Test_flex_wrap_wrap_to_child_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); @@ -505,6 +517,8 @@ namespace Facebook.Yoga public void Test_flex_wrap_align_stretch_fits_one_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -560,6 +574,8 @@ namespace Facebook.Yoga public void Test_wrap_reverse_row_align_content_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -661,6 +677,8 @@ namespace Facebook.Yoga public void Test_wrap_reverse_row_align_content_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -763,6 +781,8 @@ namespace Facebook.Yoga public void Test_wrap_reverse_row_single_line_different_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -864,6 +884,8 @@ namespace Facebook.Yoga public void Test_wrap_reverse_row_align_content_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -966,6 +988,8 @@ namespace Facebook.Yoga public void Test_wrap_reverse_row_align_content_space_around() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1068,6 +1092,8 @@ namespace Facebook.Yoga public void Test_wrap_reverse_column_fixed_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -1170,6 +1196,8 @@ namespace Facebook.Yoga public void Test_wrapped_row_within_align_items_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -1241,6 +1269,8 @@ namespace Facebook.Yoga public void Test_wrapped_row_within_align_items_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.FlexStart; @@ -1312,6 +1342,8 @@ namespace Facebook.Yoga public void Test_wrapped_row_within_align_items_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.FlexEnd; @@ -1383,6 +1415,8 @@ namespace Facebook.Yoga public void Test_wrapped_column_max_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1462,6 +1496,8 @@ namespace Facebook.Yoga public void Test_wrapped_column_max_height_flex() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1547,6 +1583,8 @@ namespace Facebook.Yoga public void Test_wrap_nodes_with_content_sizing_overflowing_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 500; @@ -1645,6 +1683,8 @@ namespace Facebook.Yoga public void Test_wrap_nodes_with_content_sizing_margin_cross() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 500; diff --git a/csharp/tests/Facebook.Yoga/YGGapTest.cs b/csharp/tests/Facebook.Yoga/YGGapTest.cs index 173e10f0..fb258ae1 100644 --- a/csharp/tests/Facebook.Yoga/YGGapTest.cs +++ b/csharp/tests/Facebook.Yoga/YGGapTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_column_gap_flexible() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -95,6 +97,8 @@ namespace Facebook.Yoga public void Test_column_gap_inflexible() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -164,6 +168,8 @@ namespace Facebook.Yoga public void Test_column_gap_mixed_flexible() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -235,6 +241,8 @@ namespace Facebook.Yoga public void Test_column_gap_child_margins() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -316,6 +324,8 @@ namespace Facebook.Yoga public void Test_column_row_gap_wrapping() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -479,6 +489,8 @@ namespace Facebook.Yoga public void Test_column_gap_justify_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -548,6 +560,8 @@ namespace Facebook.Yoga public void Test_column_gap_justify_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -618,6 +632,8 @@ namespace Facebook.Yoga public void Test_column_gap_justify_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -688,6 +704,8 @@ namespace Facebook.Yoga public void Test_column_gap_justify_space_between() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -758,6 +776,8 @@ namespace Facebook.Yoga public void Test_column_gap_justify_space_around() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -828,6 +848,8 @@ namespace Facebook.Yoga public void Test_column_gap_justify_space_evenly() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -898,6 +920,8 @@ namespace Facebook.Yoga public void Test_column_gap_wrap_align_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1017,6 +1041,8 @@ namespace Facebook.Yoga public void Test_column_gap_wrap_align_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1137,6 +1163,8 @@ namespace Facebook.Yoga public void Test_column_gap_wrap_align_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1257,6 +1285,8 @@ namespace Facebook.Yoga public void Test_column_gap_wrap_align_space_between() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1377,6 +1407,8 @@ namespace Facebook.Yoga public void Test_column_gap_wrap_align_space_around() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1497,6 +1529,8 @@ namespace Facebook.Yoga public void Test_column_gap_wrap_align_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1601,6 +1635,8 @@ namespace Facebook.Yoga public void Test_column_gap_determines_parent_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1669,6 +1705,8 @@ namespace Facebook.Yoga public void Test_row_gap_align_items_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1783,6 +1821,8 @@ namespace Facebook.Yoga public void Test_row_gap_align_items_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1897,6 +1937,8 @@ namespace Facebook.Yoga public void Test_row_gap_column_child_margins() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -1977,6 +2019,8 @@ namespace Facebook.Yoga public void Test_row_gap_row_wrap_child_margins() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -2053,6 +2097,8 @@ namespace Facebook.Yoga public void Test_row_gap_determines_parent_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; diff --git a/csharp/tests/Facebook.Yoga/YGJustifyContentTest.cs b/csharp/tests/Facebook.Yoga/YGJustifyContentTest.cs index bc5fba40..5e3c516d 100644 --- a/csharp/tests/Facebook.Yoga/YGJustifyContentTest.cs +++ b/csharp/tests/Facebook.Yoga/YGJustifyContentTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -87,6 +89,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -156,6 +160,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -225,6 +231,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_space_between() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -294,6 +302,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_space_around() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -363,6 +373,8 @@ namespace Facebook.Yoga public void Test_justify_content_column_flex_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 102; @@ -430,6 +442,8 @@ namespace Facebook.Yoga public void Test_justify_content_column_flex_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.FlexEnd; @@ -498,6 +512,8 @@ namespace Facebook.Yoga public void Test_justify_content_column_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -566,6 +582,8 @@ namespace Facebook.Yoga public void Test_justify_content_column_space_between() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.SpaceBetween; @@ -634,6 +652,8 @@ namespace Facebook.Yoga public void Test_justify_content_column_space_around() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.SpaceAround; @@ -702,6 +722,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_min_width_and_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -744,6 +766,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_max_width_and_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -787,6 +811,8 @@ namespace Facebook.Yoga public void Test_justify_content_column_min_height_and_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -828,6 +854,8 @@ namespace Facebook.Yoga public void Test_justify_content_colunn_max_height_and_margin() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -870,6 +898,8 @@ namespace Facebook.Yoga public void Test_justify_content_column_space_evenly() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.SpaceEvenly; @@ -938,6 +968,8 @@ namespace Facebook.Yoga public void Test_justify_content_row_space_evenly() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1007,6 +1039,8 @@ namespace Facebook.Yoga public void Test_justify_content_min_width_with_padding_child_width_greater_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignContent = YogaAlign.Stretch; @@ -1084,6 +1118,8 @@ namespace Facebook.Yoga public void Test_justify_content_min_width_with_padding_child_width_lower_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignContent = YogaAlign.Stretch; diff --git a/csharp/tests/Facebook.Yoga/YGMarginTest.cs b/csharp/tests/Facebook.Yoga/YGMarginTest.cs index 4316af3b..5d9991be 100644 --- a/csharp/tests/Facebook.Yoga/YGMarginTest.cs +++ b/csharp/tests/Facebook.Yoga/YGMarginTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_margin_start() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -60,6 +62,8 @@ namespace Facebook.Yoga public void Test_margin_top() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -100,6 +104,8 @@ namespace Facebook.Yoga public void Test_margin_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -142,6 +148,8 @@ namespace Facebook.Yoga public void Test_margin_bottom() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.FlexEnd; @@ -183,6 +191,8 @@ namespace Facebook.Yoga public void Test_margin_and_flex_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -225,6 +235,8 @@ namespace Facebook.Yoga public void Test_margin_and_flex_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -266,6 +278,8 @@ namespace Facebook.Yoga public void Test_margin_and_stretch_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -308,6 +322,8 @@ namespace Facebook.Yoga public void Test_margin_and_stretch_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -349,6 +365,8 @@ namespace Facebook.Yoga public void Test_margin_with_sibling_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -404,6 +422,8 @@ namespace Facebook.Yoga public void Test_margin_with_sibling_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -458,6 +478,8 @@ namespace Facebook.Yoga public void Test_margin_auto_bottom() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -515,6 +537,8 @@ namespace Facebook.Yoga public void Test_margin_auto_top() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -572,6 +596,8 @@ namespace Facebook.Yoga public void Test_margin_auto_bottom_and_top() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -630,6 +656,8 @@ namespace Facebook.Yoga public void Test_margin_auto_bottom_and_top_justify_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -688,6 +716,8 @@ namespace Facebook.Yoga public void Test_margin_auto_mutiple_children_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -761,6 +791,8 @@ namespace Facebook.Yoga public void Test_margin_auto_mutiple_children_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -835,6 +867,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_and_right_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -894,6 +928,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_and_right() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -951,6 +987,8 @@ namespace Facebook.Yoga public void Test_margin_auto_start_and_end_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1010,6 +1048,8 @@ namespace Facebook.Yoga public void Test_margin_auto_start_and_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -1067,6 +1107,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_and_right_column_and_center() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -1125,6 +1167,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -1182,6 +1226,8 @@ namespace Facebook.Yoga public void Test_margin_auto_right() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -1239,6 +1285,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_and_right_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1297,6 +1345,8 @@ namespace Facebook.Yoga public void Test_margin_auto_top_and_bottom_stretch() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -1354,6 +1404,8 @@ namespace Facebook.Yoga public void Test_margin_should_not_be_part_of_max_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 250; @@ -1396,6 +1448,8 @@ namespace Facebook.Yoga public void Test_margin_should_not_be_part_of_max_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 250; @@ -1438,6 +1492,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_right_child_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1481,6 +1537,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_child_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1523,6 +1581,8 @@ namespace Facebook.Yoga public void Test_margin_fix_left_auto_right_child_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1566,6 +1626,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_fix_right_child_bigger_than_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1609,6 +1671,8 @@ namespace Facebook.Yoga public void Test_margin_auto_top_stretching_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -1667,6 +1731,8 @@ namespace Facebook.Yoga public void Test_margin_auto_left_stretching_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; diff --git a/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs b/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs index a12bfdcb..af6f15e5 100644 --- a/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs +++ b/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_max_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -59,6 +61,8 @@ namespace Facebook.Yoga public void Test_max_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -100,6 +104,8 @@ namespace Facebook.Yoga public void Test_justify_content_min_max() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -142,6 +148,8 @@ namespace Facebook.Yoga public void Test_align_items_min_max() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.Center; @@ -184,6 +192,8 @@ namespace Facebook.Yoga public void Test_justify_content_overflow_min_max() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -255,6 +265,8 @@ namespace Facebook.Yoga public void Test_flex_grow_to_min() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -310,6 +322,8 @@ namespace Facebook.Yoga public void Test_flex_grow_in_at_most_container() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -366,6 +380,8 @@ namespace Facebook.Yoga public void Test_flex_grow_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -406,6 +422,8 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_min_max_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.MinHeight = 100; @@ -459,6 +477,8 @@ namespace Facebook.Yoga public void Test_flex_grow_within_max_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -514,6 +534,8 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_max_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -569,6 +591,8 @@ namespace Facebook.Yoga public void Test_flex_root_ignored() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexGrow = 1; @@ -625,6 +649,8 @@ namespace Facebook.Yoga public void Test_flex_grow_root_minimized() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -696,6 +722,8 @@ namespace Facebook.Yoga public void Test_flex_grow_height_maximized() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -766,6 +794,8 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_min_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -820,6 +850,8 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_min_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.MinHeight = 100; @@ -872,6 +904,8 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_max_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -941,6 +975,8 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_max_column() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -995,6 +1031,8 @@ namespace Facebook.Yoga public void Test_child_min_max_width_flexing() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -1053,6 +1091,8 @@ namespace Facebook.Yoga public void Test_min_width_overrides_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 50; @@ -1078,6 +1118,8 @@ namespace Facebook.Yoga public void Test_max_width_overrides_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -1103,6 +1145,8 @@ namespace Facebook.Yoga public void Test_min_height_overrides_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Height = 50; @@ -1128,6 +1172,8 @@ namespace Facebook.Yoga public void Test_max_height_overrides_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Height = 200; @@ -1153,6 +1199,8 @@ namespace Facebook.Yoga public void Test_min_max_percent_no_width_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.AlignItems = YogaAlign.FlexStart; diff --git a/csharp/tests/Facebook.Yoga/YGPaddingTest.cs b/csharp/tests/Facebook.Yoga/YGPaddingTest.cs index 145cf0db..8f44c6a3 100644 --- a/csharp/tests/Facebook.Yoga/YGPaddingTest.cs +++ b/csharp/tests/Facebook.Yoga/YGPaddingTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_padding_no_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.PaddingLeft = 10; @@ -46,6 +48,8 @@ namespace Facebook.Yoga public void Test_padding_container_match_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.PaddingLeft = 10; @@ -88,6 +92,8 @@ namespace Facebook.Yoga public void Test_padding_flex_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.PaddingLeft = 10; @@ -132,6 +138,8 @@ namespace Facebook.Yoga public void Test_padding_stretch_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.PaddingLeft = 10; @@ -175,6 +183,8 @@ namespace Facebook.Yoga public void Test_padding_center_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -220,6 +230,8 @@ namespace Facebook.Yoga public void Test_child_with_padding_align_end() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.FlexEnd; diff --git a/csharp/tests/Facebook.Yoga/YGPercentageTest.cs b/csharp/tests/Facebook.Yoga/YGPercentageTest.cs index 8dc2fae3..7d0cad6b 100644 --- a/csharp/tests/Facebook.Yoga/YGPercentageTest.cs +++ b/csharp/tests/Facebook.Yoga/YGPercentageTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_percentage_width_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -60,6 +62,8 @@ namespace Facebook.Yoga public void Test_percentage_position_left_top() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -103,6 +107,8 @@ namespace Facebook.Yoga public void Test_percentage_position_bottom_right() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -146,6 +152,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -202,6 +210,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_cross() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -257,6 +267,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_main_max_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -315,6 +327,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_cross_max_height() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -372,6 +386,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_main_max_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -430,6 +446,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_cross_max_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -487,6 +505,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_main_min_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -545,6 +565,8 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_cross_min_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -602,6 +624,8 @@ namespace Facebook.Yoga public void Test_percentage_multiple_nested_with_padding_margin_and_percentage_values() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -711,6 +735,8 @@ namespace Facebook.Yoga public void Test_percentage_margin_should_calculate_based_only_on_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -769,6 +795,8 @@ namespace Facebook.Yoga public void Test_percentage_padding_should_calculate_based_only_on_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -827,6 +855,8 @@ namespace Facebook.Yoga public void Test_percentage_absolute_position() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -870,6 +900,8 @@ namespace Facebook.Yoga public void Test_percentage_width_height_undefined_parent_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); @@ -908,6 +940,8 @@ namespace Facebook.Yoga public void Test_percent_within_flex_grow() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -990,6 +1024,8 @@ namespace Facebook.Yoga public void Test_percentage_container_in_wrapping_container() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.JustifyContent = YogaJustify.Center; @@ -1076,6 +1112,8 @@ namespace Facebook.Yoga public void Test_percent_absolute_position() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 60; diff --git a/csharp/tests/Facebook.Yoga/YGRoundingTest.cs b/csharp/tests/Facebook.Yoga/YGRoundingTest.cs index 72a22501..78cf068f 100644 --- a/csharp/tests/Facebook.Yoga/YGRoundingTest.cs +++ b/csharp/tests/Facebook.Yoga/YGRoundingTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_rounding_flex_basis_flex_grow_row_width_of_100() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -87,6 +89,8 @@ namespace Facebook.Yoga public void Test_rounding_flex_basis_flex_grow_row_prime_number_width() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -183,6 +187,8 @@ namespace Facebook.Yoga public void Test_rounding_flex_basis_flex_shrink_row() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -252,6 +258,8 @@ namespace Facebook.Yoga public void Test_rounding_flex_basis_overrides_main_size() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -323,6 +331,8 @@ namespace Facebook.Yoga public void Test_rounding_total_fractial() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 87.4f; @@ -394,6 +404,8 @@ namespace Facebook.Yoga public void Test_rounding_total_fractial_nested() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 87.4f; @@ -499,6 +511,8 @@ namespace Facebook.Yoga public void Test_rounding_fractial_input_1() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -570,6 +584,8 @@ namespace Facebook.Yoga public void Test_rounding_fractial_input_2() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -641,6 +657,8 @@ namespace Facebook.Yoga public void Test_rounding_fractial_input_3() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Top = 0.3f; @@ -713,6 +731,8 @@ namespace Facebook.Yoga public void Test_rounding_fractial_input_4() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Top = 0.7f; @@ -785,6 +805,8 @@ namespace Facebook.Yoga public void Test_rounding_inner_node_controversy_horizontal() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -870,6 +892,8 @@ namespace Facebook.Yoga public void Test_rounding_inner_node_controversy_vertical() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Height = 320; @@ -954,6 +978,8 @@ namespace Facebook.Yoga public void Test_rounding_inner_node_controversy_combined() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; diff --git a/csharp/tests/Facebook.Yoga/YGSizeOverflowTest.cs b/csharp/tests/Facebook.Yoga/YGSizeOverflowTest.cs index 52b29fbf..f4f7459d 100644 --- a/csharp/tests/Facebook.Yoga/YGSizeOverflowTest.cs +++ b/csharp/tests/Facebook.Yoga/YGSizeOverflowTest.cs @@ -19,6 +19,8 @@ namespace Facebook.Yoga public void Test_nested_overflowing_child() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -72,6 +74,8 @@ namespace Facebook.Yoga public void Test_nested_overflowing_child_in_constraint_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -127,6 +131,8 @@ namespace Facebook.Yoga public void Test_parent_wrap_child_size_overflowing_parent() { YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); YogaNode root = new YogaNode(config); root.Width = 100; diff --git a/enums.py b/enums.py index d39bddba..69dfd7ad 100644 --- a/enums.py +++ b/enums.py @@ -50,8 +50,12 @@ ENUMS = { "NodeType": ["Default", "Text"], "LogLevel": ["Error", "Warn", "Info", "Debug", "Verbose", "Fatal"], "ExperimentalFeature": [ - # Mimic web flex-basis behavior. - "WebFlexBasis" + # Mimic web flex-basis behavior (experiment may be broken) + "WebFlexBasis", + # Conformance fix: https://github.com/facebook/yoga/pull/1028 + "AbsolutePercentageAgainstPaddingEdge", + # Conformance fix: https://github.com/facebook/yoga/pull/1028 + "FixAbsoluteTrailingColumnMargin", ], "PrintOptions": [("Layout", 1), ("Style", 2), ("Children", 4)], "Gutter": ["Column", "Row", "All"], diff --git a/gentest/fixtures/YGAbsolutePositionTest.html b/gentest/fixtures/YGAbsolutePositionTest.html index 39f8e980..d0f5e9ee 100644 --- a/gentest/fixtures/YGAbsolutePositionTest.html +++ b/gentest/fixtures/YGAbsolutePositionTest.html @@ -88,3 +88,15 @@
+
+
+
+
+ +
+
+
+ +
+
+
diff --git a/gentest/gentest-javascript.js b/gentest/gentest-javascript.js index 2b005aad..8e596dfb 100644 --- a/gentest/gentest-javascript.js +++ b/gentest/gentest-javascript.js @@ -18,7 +18,8 @@ function toValueJavascript(value) { function toJavascriptUpper(symbol) { let out = ''; - for (const c of symbol) { + for (let i = 0; i < symbol.length; i++) { + const c = symbol.charAt(i); if (c == c.toUpperCase() && i != 0 && symbol[i - 1] != symbol[i - 1].toUpperCase()) { out += '_'; } @@ -40,8 +41,8 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { this.push(''); if (experiments.length > 0) { - for (const i in experiments) { - this.push('config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_' + toJavascriptUpper(experiments[i]) + ', true);'); + for (const experiment of experiments) { + this.push('config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_' + toJavascriptUpper(experiment) + ', true);'); } this.push(''); } diff --git a/gentest/gentest.js b/gentest/gentest.js index 4071829d..f4426bf1 100755 --- a/gentest/gentest.js +++ b/gentest/gentest.js @@ -5,6 +5,11 @@ * LICENSE file in the root directory of this source tree. */ +const DEFAULT_EXPERIMENTS = [ + 'AbsolutePercentageAgainstPaddingEdge', + 'FixAbsoluteTrailingColumnMargin', +]; + window.onload = function() { checkDefaultValues(); @@ -472,7 +477,7 @@ function calculateTree(root, roundToPixelGrid) { rawStyle: child.getAttribute('style'), experiments: child.getAttribute('experiments') ? child.getAttribute('experiments').split(' ') - : [], + : DEFAULT_EXPERIMENTS, }; var size = getRoundedSize(child); diff --git a/java/com/facebook/yoga/YogaExperimentalFeature.java b/java/com/facebook/yoga/YogaExperimentalFeature.java index 3fabbb91..3532e45e 100644 --- a/java/com/facebook/yoga/YogaExperimentalFeature.java +++ b/java/com/facebook/yoga/YogaExperimentalFeature.java @@ -10,7 +10,9 @@ package com.facebook.yoga; public enum YogaExperimentalFeature { - WEB_FLEX_BASIS(0); + WEB_FLEX_BASIS(0), + ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE(1), + FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN(2); private final int mIntValue; @@ -25,6 +27,8 @@ public enum YogaExperimentalFeature { public static YogaExperimentalFeature fromInt(int value) { switch (value) { case 0: return WEB_FLEX_BASIS; + case 1: return ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE; + case 2: return FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN; default: throw new IllegalArgumentException("Unknown enum value: " + value); } } diff --git a/java/tests/com/facebook/yoga/YGAbsolutePositionTest.java b/java/tests/com/facebook/yoga/YGAbsolutePositionTest.java index c1d4eda4..5220217a 100644 --- a/java/tests/com/facebook/yoga/YGAbsolutePositionTest.java +++ b/java/tests/com/facebook/yoga/YGAbsolutePositionTest.java @@ -27,6 +27,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_width_height_start_top() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -69,6 +71,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_width_height_end_bottom() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -111,6 +115,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_start_top_end_bottom() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -153,6 +159,8 @@ public class YGAbsolutePositionTest { @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); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -197,6 +205,8 @@ public class YGAbsolutePositionTest { @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); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -254,6 +264,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_within_border() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setMargin(YogaEdge.LEFT, 10f); @@ -370,6 +382,8 @@ public class YGAbsolutePositionTest { @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); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -413,6 +427,8 @@ public class YGAbsolutePositionTest { @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); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.FLEX_END); @@ -456,6 +472,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_justify_content_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -498,6 +516,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_align_items_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -540,6 +560,8 @@ public class YGAbsolutePositionTest { @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); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexGrow(1f); @@ -582,6 +604,8 @@ public class YGAbsolutePositionTest { @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); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -626,6 +650,8 @@ public class YGAbsolutePositionTest { @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); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -670,6 +696,8 @@ public class YGAbsolutePositionTest { @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); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -714,6 +742,8 @@ public class YGAbsolutePositionTest { @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); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -758,6 +788,8 @@ public class YGAbsolutePositionTest { @Test public void test_position_root_with_rtl_should_position_withoutdirection() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setPosition(YogaEdge.LEFT, 72f); @@ -783,6 +815,8 @@ public class YGAbsolutePositionTest { @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); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -858,6 +892,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_in_wrap_reverse_column_container() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWrap(YogaWrap.WRAP_REVERSE); @@ -899,6 +935,8 @@ public class YGAbsolutePositionTest { @Test public void test_absolute_layout_in_wrap_reverse_row_container() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -941,6 +979,8 @@ public class YGAbsolutePositionTest { @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); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWrap(YogaWrap.WRAP_REVERSE); @@ -983,6 +1023,8 @@ public class YGAbsolutePositionTest { @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); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1023,6 +1065,153 @@ public class YGAbsolutePositionTest { assertEquals(20f, root_child0.getLayoutHeight(), 0.0f); } + @Test + public void test_percent_absolute_position_infinite_height() { + YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + final YogaNode root = createNode(config); + root.setWidth(300f); + + final YogaNode root_child0 = createNode(config); + root_child0.setWidth(300f); + root.addChildAt(root_child0, 0); + + final YogaNode root_child1 = createNode(config); + root_child1.setPositionType(YogaPositionType.ABSOLUTE); + root_child1.setPositionPercent(YogaEdge.LEFT, 20f); + root_child1.setPositionPercent(YogaEdge.TOP, 20f); + root_child1.setWidthPercent(20f); + root_child1.setHeightPercent(20f); + root.addChildAt(root_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(300f, root.getLayoutWidth(), 0.0f); + assertEquals(0f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(0f, root_child0.getLayoutY(), 0.0f); + assertEquals(300f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(0f, root_child0.getLayoutHeight(), 0.0f); + + assertEquals(60f, root_child1.getLayoutX(), 0.0f); + assertEquals(0f, root_child1.getLayoutY(), 0.0f); + assertEquals(60f, root_child1.getLayoutWidth(), 0.0f); + assertEquals(0f, root_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(300f, root.getLayoutWidth(), 0.0f); + assertEquals(0f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(0f, root_child0.getLayoutY(), 0.0f); + assertEquals(300f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(0f, root_child0.getLayoutHeight(), 0.0f); + + assertEquals(60f, root_child1.getLayoutX(), 0.0f); + assertEquals(0f, root_child1.getLayoutY(), 0.0f); + assertEquals(60f, root_child1.getLayoutWidth(), 0.0f); + assertEquals(0f, root_child1.getLayoutHeight(), 0.0f); + } + + @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); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + final YogaNode root = createNode(config); + root.setPadding(YogaEdge.TOP, 10); + root.setBorder(YogaEdge.TOP, 10f); + root.setWidth(100f); + root.setHeight(100f); + + final YogaNode root_child0 = createNode(config); + root_child0.setPositionType(YogaPositionType.ABSOLUTE); + root_child0.setWidth(100f); + root_child0.setHeightPercent(50f); + root.addChildAt(root_child0, 0); + root.setDirection(YogaDirection.LTR); + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); + + assertEquals(0f, root.getLayoutX(), 0.0f); + assertEquals(0f, root.getLayoutY(), 0.0f); + assertEquals(100f, root.getLayoutWidth(), 0.0f); + assertEquals(100f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(10f, root_child0.getLayoutY(), 0.0f); + assertEquals(100f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(50f, root_child0.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(100f, root.getLayoutWidth(), 0.0f); + assertEquals(100f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(10f, root_child0.getLayoutY(), 0.0f); + assertEquals(100f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(50f, root_child0.getLayoutHeight(), 0.0f); + } + + @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); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + final YogaNode root = createNode(config); + root.setJustifyContent(YogaJustify.CENTER); + root.setAlignItems(YogaAlign.CENTER); + root.setPadding(YogaEdge.TOP, 20); + root.setPadding(YogaEdge.BOTTOM, 20); + root.setWidth(100f); + root.setHeight(100f); + + final YogaNode root_child0 = createNode(config); + root_child0.setPositionType(YogaPositionType.ABSOLUTE); + root_child0.setWidth(100f); + root_child0.setHeightPercent(50f); + root.addChildAt(root_child0, 0); + root.setDirection(YogaDirection.LTR); + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); + + assertEquals(0f, root.getLayoutX(), 0.0f); + assertEquals(0f, root.getLayoutY(), 0.0f); + assertEquals(100f, root.getLayoutWidth(), 0.0f); + assertEquals(100f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(25f, root_child0.getLayoutY(), 0.0f); + assertEquals(100f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(50f, root_child0.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(100f, root.getLayoutWidth(), 0.0f); + assertEquals(100f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(25f, root_child0.getLayoutY(), 0.0f); + assertEquals(100f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(50f, root_child0.getLayoutHeight(), 0.0f); + } + private YogaNode createNode(YogaConfig config) { return mNodeFactory.create(config); } diff --git a/java/tests/com/facebook/yoga/YGAlignContentTest.java b/java/tests/com/facebook/yoga/YGAlignContentTest.java index 61451c32..a3bdce56 100644 --- a/java/tests/com/facebook/yoga/YGAlignContentTest.java +++ b/java/tests/com/facebook/yoga/YGAlignContentTest.java @@ -27,6 +27,8 @@ public class YGAlignContentTest { @Test public void test_align_content_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -128,6 +130,8 @@ public class YGAlignContentTest { @Test public void test_align_content_flex_start_without_height_on_children() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWrap(YogaWrap.WRAP); @@ -225,6 +229,8 @@ public class YGAlignContentTest { @Test public void test_align_content_flex_start_with_flex() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWrap(YogaWrap.WRAP); @@ -328,6 +334,8 @@ public class YGAlignContentTest { @Test public void test_align_content_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignContent(YogaAlign.FLEX_END); @@ -429,6 +437,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignContent(YogaAlign.STRETCH); @@ -525,6 +535,8 @@ public class YGAlignContentTest { @Test public void test_align_content_spacebetween() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -627,6 +639,8 @@ public class YGAlignContentTest { @Test public void test_align_content_spacearound() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -729,6 +743,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -826,6 +842,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_children() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -939,6 +957,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_flex() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1042,6 +1062,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_flex_no_shrink() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1144,6 +1166,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1249,6 +1273,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_padding() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1354,6 +1380,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_single_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1409,6 +1437,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_fixed_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1507,6 +1537,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_max_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1605,6 +1637,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_row_with_min_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1703,6 +1737,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignContent(YogaAlign.STRETCH); @@ -1818,6 +1854,8 @@ public class YGAlignContentTest { @Test public void test_align_content_stretch_is_not_overriding_align_items() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignContent(YogaAlign.STRETCH); diff --git a/java/tests/com/facebook/yoga/YGAlignItemsTest.java b/java/tests/com/facebook/yoga/YGAlignItemsTest.java index 20544ed4..3b13e585 100644 --- a/java/tests/com/facebook/yoga/YGAlignItemsTest.java +++ b/java/tests/com/facebook/yoga/YGAlignItemsTest.java @@ -27,6 +27,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -65,6 +67,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -105,6 +109,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.FLEX_START); @@ -145,6 +151,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.FLEX_END); @@ -185,6 +193,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -241,6 +251,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -312,6 +324,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child_multiline() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -430,6 +444,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child_multiline_override() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -550,6 +566,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child_multiline_no_override_on_secondline() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -669,6 +687,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child_top() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -741,6 +761,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child_top2() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -813,6 +835,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_double_nested_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -899,6 +923,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.BASELINE); @@ -954,6 +980,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1033,6 +1061,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_child_padding() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1112,6 +1142,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_multiline() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1229,6 +1261,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_multiline_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.BASELINE); @@ -1345,6 +1379,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_multiline_column2() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.BASELINE); @@ -1461,6 +1497,8 @@ public class YGAlignItemsTest { @Test public void test_align_baseline_multiline_row_and_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1578,6 +1616,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_center_child_with_margin_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1635,6 +1675,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_flex_end_child_with_margin_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1692,6 +1734,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_center_child_without_margin_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1747,6 +1791,8 @@ public class YGAlignItemsTest { @Test public void test_align_items_flex_end_child_without_margin_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1802,6 +1848,8 @@ public class YGAlignItemsTest { @Test public void test_align_center_should_size_based_on_content() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -1873,6 +1921,8 @@ public class YGAlignItemsTest { @Test public void test_align_stretch_should_size_based_on_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setMargin(YogaEdge.TOP, 20f); @@ -1943,6 +1993,8 @@ public class YGAlignItemsTest { @Test public void test_align_flex_start_with_shrinking_children() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(500f); @@ -2011,6 +2063,8 @@ public class YGAlignItemsTest { @Test public void test_align_flex_start_with_stretching_children() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(500f); @@ -2078,6 +2132,8 @@ public class YGAlignItemsTest { @Test public void test_align_flex_start_with_shrinking_children_with_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(500f); diff --git a/java/tests/com/facebook/yoga/YGAlignSelfTest.java b/java/tests/com/facebook/yoga/YGAlignSelfTest.java index e5ebc9e8..8a47fddc 100644 --- a/java/tests/com/facebook/yoga/YGAlignSelfTest.java +++ b/java/tests/com/facebook/yoga/YGAlignSelfTest.java @@ -27,6 +27,8 @@ public class YGAlignSelfTest { @Test public void test_align_self_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -67,6 +69,8 @@ public class YGAlignSelfTest { @Test public void test_align_self_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -107,6 +111,8 @@ public class YGAlignSelfTest { @Test public void test_align_self_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -147,6 +153,8 @@ public class YGAlignSelfTest { @Test public void test_align_self_flex_end_override_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.FLEX_START); @@ -188,6 +196,8 @@ public class YGAlignSelfTest { @Test public void test_align_self_baseline() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); diff --git a/java/tests/com/facebook/yoga/YGAndroidNewsFeed.java b/java/tests/com/facebook/yoga/YGAndroidNewsFeed.java index 5a2cc190..8747ec96 100644 --- a/java/tests/com/facebook/yoga/YGAndroidNewsFeed.java +++ b/java/tests/com/facebook/yoga/YGAndroidNewsFeed.java @@ -27,6 +27,8 @@ public class YGAndroidNewsFeed { @Test public void test_android_news_feed() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignContent(YogaAlign.STRETCH); diff --git a/java/tests/com/facebook/yoga/YGBorderTest.java b/java/tests/com/facebook/yoga/YGBorderTest.java index 35d7c782..ac72b09f 100644 --- a/java/tests/com/facebook/yoga/YGBorderTest.java +++ b/java/tests/com/facebook/yoga/YGBorderTest.java @@ -27,6 +27,8 @@ public class YGBorderTest { @Test public void test_border_no_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setBorder(YogaEdge.LEFT, 10f); @@ -53,6 +55,8 @@ public class YGBorderTest { @Test public void test_border_container_match_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setBorder(YogaEdge.LEFT, 10f); @@ -94,6 +98,8 @@ public class YGBorderTest { @Test public void test_border_flex_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setBorder(YogaEdge.LEFT, 10f); @@ -137,6 +143,8 @@ public class YGBorderTest { @Test public void test_border_stretch_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setBorder(YogaEdge.LEFT, 10f); @@ -179,6 +187,8 @@ public class YGBorderTest { @Test public void test_border_center_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); diff --git a/java/tests/com/facebook/yoga/YGDimensionTest.java b/java/tests/com/facebook/yoga/YGDimensionTest.java index 3ab10187..915726e8 100644 --- a/java/tests/com/facebook/yoga/YGDimensionTest.java +++ b/java/tests/com/facebook/yoga/YGDimensionTest.java @@ -27,6 +27,8 @@ public class YGDimensionTest { @Test public void test_wrap_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); @@ -64,6 +66,8 @@ public class YGDimensionTest { @Test public void test_wrap_grandchild() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); diff --git a/java/tests/com/facebook/yoga/YGDisplayTest.java b/java/tests/com/facebook/yoga/YGDisplayTest.java index 57928a8d..95ae45ba 100644 --- a/java/tests/com/facebook/yoga/YGDisplayTest.java +++ b/java/tests/com/facebook/yoga/YGDisplayTest.java @@ -27,6 +27,8 @@ public class YGDisplayTest { @Test public void test_display_none() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -81,6 +83,8 @@ public class YGDisplayTest { @Test public void test_display_none_fixed_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -136,6 +140,8 @@ public class YGDisplayTest { @Test public void test_display_none_with_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -195,6 +201,8 @@ public class YGDisplayTest { @Test public void test_display_none_with_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -286,6 +294,8 @@ public class YGDisplayTest { @Test public void test_display_none_with_position() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -341,6 +351,8 @@ public class YGDisplayTest { @Test public void test_display_none_with_position_absolute() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); diff --git a/java/tests/com/facebook/yoga/YGFlexDirectionTest.java b/java/tests/com/facebook/yoga/YGFlexDirectionTest.java index d6b40a02..0574338c 100644 --- a/java/tests/com/facebook/yoga/YGFlexDirectionTest.java +++ b/java/tests/com/facebook/yoga/YGFlexDirectionTest.java @@ -27,6 +27,8 @@ public class YGFlexDirectionTest { @Test public void test_flex_direction_column_no_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -92,6 +94,8 @@ public class YGFlexDirectionTest { @Test public void test_flex_direction_row_no_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -158,6 +162,8 @@ public class YGFlexDirectionTest { @Test public void test_flex_direction_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -224,6 +230,8 @@ public class YGFlexDirectionTest { @Test public void test_flex_direction_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -291,6 +299,8 @@ public class YGFlexDirectionTest { @Test public void test_flex_direction_column_reverse() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.COLUMN_REVERSE); @@ -358,6 +368,8 @@ public class YGFlexDirectionTest { @Test public void test_flex_direction_row_reverse() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW_REVERSE); diff --git a/java/tests/com/facebook/yoga/YGFlexTest.java b/java/tests/com/facebook/yoga/YGFlexTest.java index 5315c2d2..2dcc68fe 100644 --- a/java/tests/com/facebook/yoga/YGFlexTest.java +++ b/java/tests/com/facebook/yoga/YGFlexTest.java @@ -27,6 +27,8 @@ public class YGFlexTest { @Test public void test_flex_basis_flex_grow_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -80,6 +82,8 @@ public class YGFlexTest { @Test public void test_flex_shrink_flex_grow_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -137,6 +141,8 @@ public class YGFlexTest { @Test public void test_flex_shrink_flex_grow_child_flex_shrink_other_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -195,6 +201,8 @@ public class YGFlexTest { @Test public void test_flex_basis_flex_grow_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -249,6 +257,8 @@ public class YGFlexTest { @Test public void test_flex_basis_flex_shrink_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -302,6 +312,8 @@ public class YGFlexTest { @Test public void test_flex_basis_flex_shrink_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -356,6 +368,8 @@ public class YGFlexTest { @Test public void test_flex_shrink_to_zero() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setHeight(75f); @@ -425,6 +439,8 @@ public class YGFlexTest { @Test public void test_flex_basis_overrides_main_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -495,6 +511,8 @@ public class YGFlexTest { @Test public void test_flex_grow_shrink_at_most() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -547,6 +565,8 @@ public class YGFlexTest { @Test public void test_flex_grow_less_than_factor_one() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); diff --git a/java/tests/com/facebook/yoga/YGFlexWrapTest.java b/java/tests/com/facebook/yoga/YGFlexWrapTest.java index 7c2f2e2b..4121650c 100644 --- a/java/tests/com/facebook/yoga/YGFlexWrapTest.java +++ b/java/tests/com/facebook/yoga/YGFlexWrapTest.java @@ -27,6 +27,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWrap(YogaWrap.WRAP); @@ -111,6 +113,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -196,6 +200,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_row_align_items_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -282,6 +288,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_row_align_items_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -368,6 +376,8 @@ public class YGFlexWrapTest { @Test public void test_flex_wrap_children_with_min_main_overriding_flex_basis() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -425,6 +435,8 @@ public class YGFlexWrapTest { @Test public void test_flex_wrap_wrap_to_child_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); @@ -507,6 +519,8 @@ public class YGFlexWrapTest { @Test public void test_flex_wrap_align_stretch_fits_one_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -561,6 +575,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_reverse_row_align_content_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -661,6 +677,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_reverse_row_align_content_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -762,6 +780,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_reverse_row_single_line_different_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -862,6 +882,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_reverse_row_align_content_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -963,6 +985,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_reverse_row_align_content_space_around() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1064,6 +1088,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_reverse_column_fixed_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -1165,6 +1191,8 @@ public class YGFlexWrapTest { @Test public void test_wrapped_row_within_align_items_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -1235,6 +1263,8 @@ public class YGFlexWrapTest { @Test public void test_wrapped_row_within_align_items_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.FLEX_START); @@ -1305,6 +1335,8 @@ public class YGFlexWrapTest { @Test public void test_wrapped_row_within_align_items_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.FLEX_END); @@ -1375,6 +1407,8 @@ public class YGFlexWrapTest { @Test public void test_wrapped_column_max_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1453,6 +1487,8 @@ public class YGFlexWrapTest { @Test public void test_wrapped_column_max_height_flex() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1537,6 +1573,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_nodes_with_content_sizing_overflowing_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(500f); @@ -1634,6 +1672,8 @@ public class YGFlexWrapTest { @Test public void test_wrap_nodes_with_content_sizing_margin_cross() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(500f); diff --git a/java/tests/com/facebook/yoga/YGGapTest.java b/java/tests/com/facebook/yoga/YGGapTest.java index 29d08d8f..f8ac88a0 100644 --- a/java/tests/com/facebook/yoga/YGGapTest.java +++ b/java/tests/com/facebook/yoga/YGGapTest.java @@ -27,6 +27,8 @@ public class YGGapTest { @Test public void test_column_gap_flexible() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -102,6 +104,8 @@ public class YGGapTest { @Test public void test_column_gap_inflexible() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -170,6 +174,8 @@ public class YGGapTest { @Test public void test_column_gap_mixed_flexible() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -240,6 +246,8 @@ public class YGGapTest { @Test public void test_column_gap_child_margins() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -320,6 +328,8 @@ public class YGGapTest { @Test public void test_column_row_gap_wrapping() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -482,6 +492,8 @@ public class YGGapTest { @Test public void test_column_gap_justify_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -550,6 +562,8 @@ public class YGGapTest { @Test public void test_column_gap_justify_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -619,6 +633,8 @@ public class YGGapTest { @Test public void test_column_gap_justify_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -688,6 +704,8 @@ public class YGGapTest { @Test public void test_column_gap_justify_space_between() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -757,6 +775,8 @@ public class YGGapTest { @Test public void test_column_gap_justify_space_around() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -826,6 +846,8 @@ public class YGGapTest { @Test public void test_column_gap_justify_space_evenly() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -895,6 +917,8 @@ public class YGGapTest { @Test public void test_column_gap_wrap_align_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1013,6 +1037,8 @@ public class YGGapTest { @Test public void test_column_gap_wrap_align_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1132,6 +1158,8 @@ public class YGGapTest { @Test public void test_column_gap_wrap_align_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1251,6 +1279,8 @@ public class YGGapTest { @Test public void test_column_gap_wrap_align_space_between() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1370,6 +1400,8 @@ public class YGGapTest { @Test public void test_column_gap_wrap_align_space_around() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1489,6 +1521,8 @@ public class YGGapTest { @Test public void test_column_gap_wrap_align_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1592,6 +1626,8 @@ public class YGGapTest { @Test public void test_column_gap_determines_parent_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1659,6 +1695,8 @@ public class YGGapTest { @Test public void test_row_gap_align_items_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1772,6 +1810,8 @@ public class YGGapTest { @Test public void test_row_gap_align_items_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1885,6 +1925,8 @@ public class YGGapTest { @Test public void test_row_gap_column_child_margins() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -1964,6 +2006,8 @@ public class YGGapTest { @Test public void test_row_gap_row_wrap_child_margins() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -2039,6 +2083,8 @@ public class YGGapTest { @Test public void test_row_gap_determines_parent_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); diff --git a/java/tests/com/facebook/yoga/YGJustifyContentTest.java b/java/tests/com/facebook/yoga/YGJustifyContentTest.java index f82270c1..9d53d3ab 100644 --- a/java/tests/com/facebook/yoga/YGJustifyContentTest.java +++ b/java/tests/com/facebook/yoga/YGJustifyContentTest.java @@ -27,6 +27,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -94,6 +96,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -162,6 +166,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -230,6 +236,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_space_between() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -298,6 +306,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_space_around() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -366,6 +376,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_column_flex_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(102f); @@ -432,6 +444,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_column_flex_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.FLEX_END); @@ -499,6 +513,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_column_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -566,6 +582,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_column_space_between() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.SPACE_BETWEEN); @@ -633,6 +651,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_column_space_around() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.SPACE_AROUND); @@ -700,6 +720,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_min_width_and_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -741,6 +763,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_max_width_and_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -783,6 +807,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_column_min_height_and_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -823,6 +849,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_colunn_max_height_and_margin() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -864,6 +892,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_column_space_evenly() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.SPACE_EVENLY); @@ -931,6 +961,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_row_space_evenly() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -999,6 +1031,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_min_width_with_padding_child_width_greater_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignContent(YogaAlign.STRETCH); @@ -1075,6 +1109,8 @@ public class YGJustifyContentTest { @Test public void test_justify_content_min_width_with_padding_child_width_lower_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignContent(YogaAlign.STRETCH); diff --git a/java/tests/com/facebook/yoga/YGMarginTest.java b/java/tests/com/facebook/yoga/YGMarginTest.java index 36645dd3..af01cc61 100644 --- a/java/tests/com/facebook/yoga/YGMarginTest.java +++ b/java/tests/com/facebook/yoga/YGMarginTest.java @@ -27,6 +27,8 @@ public class YGMarginTest { @Test public void test_margin_start() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -67,6 +69,8 @@ public class YGMarginTest { @Test public void test_margin_top() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -106,6 +110,8 @@ public class YGMarginTest { @Test public void test_margin_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -147,6 +153,8 @@ public class YGMarginTest { @Test public void test_margin_bottom() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.FLEX_END); @@ -187,6 +195,8 @@ public class YGMarginTest { @Test public void test_margin_and_flex_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -228,6 +238,8 @@ public class YGMarginTest { @Test public void test_margin_and_flex_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -268,6 +280,8 @@ public class YGMarginTest { @Test public void test_margin_and_stretch_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -309,6 +323,8 @@ public class YGMarginTest { @Test public void test_margin_and_stretch_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -349,6 +365,8 @@ public class YGMarginTest { @Test public void test_margin_with_sibling_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -403,6 +421,8 @@ public class YGMarginTest { @Test public void test_margin_with_sibling_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -456,6 +476,8 @@ public class YGMarginTest { @Test public void test_margin_auto_bottom() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -512,6 +534,8 @@ public class YGMarginTest { @Test public void test_margin_auto_top() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -568,6 +592,8 @@ public class YGMarginTest { @Test public void test_margin_auto_bottom_and_top() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -625,6 +651,8 @@ public class YGMarginTest { @Test public void test_margin_auto_bottom_and_top_justify_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -682,6 +710,8 @@ public class YGMarginTest { @Test public void test_margin_auto_mutiple_children_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -754,6 +784,8 @@ public class YGMarginTest { @Test public void test_margin_auto_mutiple_children_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -827,6 +859,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_and_right_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -885,6 +919,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_and_right() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -941,6 +977,8 @@ public class YGMarginTest { @Test public void test_margin_auto_start_and_end_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -999,6 +1037,8 @@ public class YGMarginTest { @Test public void test_margin_auto_start_and_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -1055,6 +1095,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_and_right_column_and_center() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -1112,6 +1154,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -1168,6 +1212,8 @@ public class YGMarginTest { @Test public void test_margin_auto_right() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -1224,6 +1270,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_and_right_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1281,6 +1329,8 @@ public class YGMarginTest { @Test public void test_margin_auto_top_and_bottom_stretch() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -1337,6 +1387,8 @@ public class YGMarginTest { @Test public void test_margin_should_not_be_part_of_max_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(250f); @@ -1378,6 +1430,8 @@ public class YGMarginTest { @Test public void test_margin_should_not_be_part_of_max_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(250f); @@ -1419,6 +1473,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_right_child_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1461,6 +1517,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_child_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1502,6 +1560,8 @@ public class YGMarginTest { @Test public void test_margin_fix_left_auto_right_child_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1544,6 +1604,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_fix_right_child_bigger_than_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1586,6 +1648,8 @@ public class YGMarginTest { @Test public void test_margin_auto_top_stretching_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -1643,6 +1707,8 @@ public class YGMarginTest { @Test public void test_margin_auto_left_stretching_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); diff --git a/java/tests/com/facebook/yoga/YGMinMaxDimensionTest.java b/java/tests/com/facebook/yoga/YGMinMaxDimensionTest.java index 0550e894..4b778e63 100644 --- a/java/tests/com/facebook/yoga/YGMinMaxDimensionTest.java +++ b/java/tests/com/facebook/yoga/YGMinMaxDimensionTest.java @@ -27,6 +27,8 @@ public class YGMinMaxDimensionTest { @Test public void test_max_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -66,6 +68,8 @@ public class YGMinMaxDimensionTest { @Test public void test_max_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -106,6 +110,8 @@ public class YGMinMaxDimensionTest { @Test public void test_justify_content_min_max() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -147,6 +153,8 @@ public class YGMinMaxDimensionTest { @Test public void test_align_items_min_max() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.CENTER); @@ -188,6 +196,8 @@ public class YGMinMaxDimensionTest { @Test public void test_justify_content_overflow_min_max() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -258,6 +268,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_to_min() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -312,6 +324,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_in_at_most_container() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -367,6 +381,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -406,6 +422,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_within_constrained_min_max_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setMinHeight(100f); @@ -458,6 +476,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_within_max_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -512,6 +532,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_within_constrained_max_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -566,6 +588,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_root_ignored() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexGrow(1f); @@ -621,6 +645,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_root_minimized() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -691,6 +717,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_height_maximized() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -760,6 +788,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_within_constrained_min_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -813,6 +843,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_within_constrained_min_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setMinHeight(100f); @@ -864,6 +896,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_within_constrained_max_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -932,6 +966,8 @@ public class YGMinMaxDimensionTest { @Test public void test_flex_grow_within_constrained_max_column() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -985,6 +1021,8 @@ public class YGMinMaxDimensionTest { @Test public void test_child_min_max_width_flexing() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -1042,6 +1080,8 @@ public class YGMinMaxDimensionTest { @Test public void test_min_width_overrides_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(50f); @@ -1066,6 +1106,8 @@ public class YGMinMaxDimensionTest { @Test public void test_max_width_overrides_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -1090,6 +1132,8 @@ public class YGMinMaxDimensionTest { @Test public void test_min_height_overrides_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setHeight(50f); @@ -1114,6 +1158,8 @@ public class YGMinMaxDimensionTest { @Test public void test_max_height_overrides_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setHeight(200f); @@ -1138,6 +1184,8 @@ public class YGMinMaxDimensionTest { @Test public void test_min_max_percent_no_width_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setAlignItems(YogaAlign.FLEX_START); diff --git a/java/tests/com/facebook/yoga/YGPaddingTest.java b/java/tests/com/facebook/yoga/YGPaddingTest.java index 2279cf15..cd73de36 100644 --- a/java/tests/com/facebook/yoga/YGPaddingTest.java +++ b/java/tests/com/facebook/yoga/YGPaddingTest.java @@ -27,6 +27,8 @@ public class YGPaddingTest { @Test public void test_padding_no_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setPadding(YogaEdge.LEFT, 10); @@ -53,6 +55,8 @@ public class YGPaddingTest { @Test public void test_padding_container_match_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setPadding(YogaEdge.LEFT, 10); @@ -94,6 +98,8 @@ public class YGPaddingTest { @Test public void test_padding_flex_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setPadding(YogaEdge.LEFT, 10); @@ -137,6 +143,8 @@ public class YGPaddingTest { @Test public void test_padding_stretch_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setPadding(YogaEdge.LEFT, 10); @@ -179,6 +187,8 @@ public class YGPaddingTest { @Test public void test_padding_center_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -223,6 +233,8 @@ public class YGPaddingTest { @Test public void test_child_with_padding_align_end() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.FLEX_END); diff --git a/java/tests/com/facebook/yoga/YGPercentageTest.java b/java/tests/com/facebook/yoga/YGPercentageTest.java index f843bbac..5395d973 100644 --- a/java/tests/com/facebook/yoga/YGPercentageTest.java +++ b/java/tests/com/facebook/yoga/YGPercentageTest.java @@ -27,6 +27,8 @@ public class YGPercentageTest { @Test public void test_percentage_width_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -67,6 +69,8 @@ public class YGPercentageTest { @Test public void test_percentage_position_left_top() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -109,6 +113,8 @@ public class YGPercentageTest { @Test public void test_percentage_position_bottom_right() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -151,6 +157,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -206,6 +214,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_cross() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -260,6 +270,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_main_max_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -317,6 +329,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_cross_max_height() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -373,6 +387,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_main_max_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -430,6 +446,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_cross_max_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -486,6 +504,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_main_min_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -543,6 +563,8 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_cross_min_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -599,6 +621,8 @@ public class YGPercentageTest { @Test public void test_percentage_multiple_nested_with_padding_margin_and_percentage_values() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -707,6 +731,8 @@ public class YGPercentageTest { @Test public void test_percentage_margin_should_calculate_based_only_on_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -764,6 +790,8 @@ public class YGPercentageTest { @Test public void test_percentage_padding_should_calculate_based_only_on_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -821,6 +849,8 @@ public class YGPercentageTest { @Test public void test_percentage_absolute_position() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(200f); @@ -863,6 +893,8 @@ public class YGPercentageTest { @Test public void test_percentage_width_height_undefined_parent_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); @@ -900,6 +932,8 @@ public class YGPercentageTest { @Test public void test_percent_within_flex_grow() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -981,6 +1015,8 @@ public class YGPercentageTest { @Test public void test_percentage_container_in_wrapping_container() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setJustifyContent(YogaJustify.CENTER); @@ -1066,6 +1102,8 @@ public class YGPercentageTest { @Test public void test_percent_absolute_position() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(60f); diff --git a/java/tests/com/facebook/yoga/YGRoundingTest.java b/java/tests/com/facebook/yoga/YGRoundingTest.java index 7493ec7b..0340b779 100644 --- a/java/tests/com/facebook/yoga/YGRoundingTest.java +++ b/java/tests/com/facebook/yoga/YGRoundingTest.java @@ -27,6 +27,8 @@ public class YGRoundingTest { @Test public void test_rounding_flex_basis_flex_grow_row_width_of_100() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -94,6 +96,8 @@ public class YGRoundingTest { @Test public void test_rounding_flex_basis_flex_grow_row_prime_number_width() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -189,6 +193,8 @@ public class YGRoundingTest { @Test public void test_rounding_flex_basis_flex_shrink_row() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -257,6 +263,8 @@ public class YGRoundingTest { @Test public void test_rounding_flex_basis_overrides_main_size() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -327,6 +335,8 @@ public class YGRoundingTest { @Test public void test_rounding_total_fractial() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(87.4f); @@ -397,6 +407,8 @@ public class YGRoundingTest { @Test public void test_rounding_total_fractial_nested() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(87.4f); @@ -501,6 +513,8 @@ public class YGRoundingTest { @Test public void test_rounding_fractial_input_1() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -571,6 +585,8 @@ public class YGRoundingTest { @Test public void test_rounding_fractial_input_2() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -641,6 +657,8 @@ public class YGRoundingTest { @Test public void test_rounding_fractial_input_3() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setPosition(YogaEdge.TOP, 0.3f); @@ -712,6 +730,8 @@ public class YGRoundingTest { @Test public void test_rounding_fractial_input_4() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setPosition(YogaEdge.TOP, 0.7f); @@ -783,6 +803,8 @@ public class YGRoundingTest { @Test public void test_rounding_inner_node_controversy_horizontal() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -867,6 +889,8 @@ public class YGRoundingTest { @Test public void test_rounding_inner_node_controversy_vertical() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setHeight(320f); @@ -950,6 +974,8 @@ public class YGRoundingTest { @Test public void test_rounding_inner_node_controversy_combined() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setFlexDirection(YogaFlexDirection.ROW); diff --git a/java/tests/com/facebook/yoga/YGSizeOverflowTest.java b/java/tests/com/facebook/yoga/YGSizeOverflowTest.java index 63b3db6a..1bdb5190 100644 --- a/java/tests/com/facebook/yoga/YGSizeOverflowTest.java +++ b/java/tests/com/facebook/yoga/YGSizeOverflowTest.java @@ -27,6 +27,8 @@ public class YGSizeOverflowTest { @Test public void test_nested_overflowing_child() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -79,6 +81,8 @@ public class YGSizeOverflowTest { @Test public void test_nested_overflowing_child_in_constraint_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); @@ -133,6 +137,8 @@ public class YGSizeOverflowTest { @Test public void test_parent_wrap_child_size_overflowing_parent() { YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); final YogaNode root = createNode(config); root.setWidth(100f); diff --git a/javascript/src_js/generated/YGEnums.d.ts b/javascript/src_js/generated/YGEnums.d.ts index 26272de5..323a6b05 100644 --- a/javascript/src_js/generated/YGEnums.d.ts +++ b/javascript/src_js/generated/YGEnums.d.ts @@ -87,6 +87,12 @@ export const EDGE_ALL: EDGE_ALL; type EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS = 0 & ['EXPERIMENTAL_FEATURE'] export const EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS; +type EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE = 1 & ['EXPERIMENTAL_FEATURE'] +export const EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE: EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE; + +type EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN = 2 & ['EXPERIMENTAL_FEATURE'] +export const EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN: EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN; + type FLEX_DIRECTION_COLUMN = 0 & ['FLEX_DIRECTION'] export const FLEX_DIRECTION_COLUMN: FLEX_DIRECTION_COLUMN; @@ -254,7 +260,9 @@ export type Edge = | typeof EDGE_ALL; export type ExperimentalFeature = - | typeof EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS; + | typeof EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS + | typeof EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE + | typeof EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN; export type FlexDirection = | typeof FLEX_DIRECTION_COLUMN diff --git a/javascript/src_js/generated/YGEnums.js b/javascript/src_js/generated/YGEnums.js index b9a4cbde..ac93434e 100644 --- a/javascript/src_js/generated/YGEnums.js +++ b/javascript/src_js/generated/YGEnums.js @@ -38,6 +38,8 @@ module.exports = { EDGE_ALL: 8, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 0, + EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE: 1, + EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN: 2, FLEX_DIRECTION_COLUMN: 0, FLEX_DIRECTION_COLUMN_REVERSE: 1, diff --git a/javascript/tests/generated/YGAbsolutePositionTest.test.js b/javascript/tests/generated/YGAbsolutePositionTest.test.js index 7cd75cc1..6b89d8d9 100644 --- a/javascript/tests/generated/YGAbsolutePositionTest.test.js +++ b/javascript/tests/generated/YGAbsolutePositionTest.test.js @@ -11,6 +11,9 @@ test("absolute_layout_width_height_start_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); @@ -58,6 +61,9 @@ test("absolute_layout_width_height_end_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.setWidth(100); @@ -105,6 +111,9 @@ test("absolute_layout_start_top_end_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.setWidth(100); @@ -152,6 +161,9 @@ test("absolute_layout_width_height_start_top_end_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.setWidth(100); @@ -201,6 +213,9 @@ test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_pare 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); @@ -263,6 +278,9 @@ test("absolute_layout_within_border", () => { 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_LEFT, 10); @@ -384,6 +402,9 @@ test("absolute_layout_align_items_and_justify_content_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); @@ -432,6 +453,9 @@ test("absolute_layout_align_items_and_justify_content_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.setJustifyContent(Yoga.JUSTIFY_FLEX_END); @@ -480,6 +504,9 @@ test("absolute_layout_justify_content_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); @@ -527,6 +554,9 @@ test("absolute_layout_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); @@ -574,6 +604,9 @@ test("absolute_layout_align_items_center_on_child_only", () => { 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.setFlexGrow(1); @@ -621,6 +654,9 @@ test("absolute_layout_align_items_and_justify_content_center_and_top_position", 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); @@ -670,6 +706,9 @@ test("absolute_layout_align_items_and_justify_content_center_and_bottom_position 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); @@ -719,6 +758,9 @@ test("absolute_layout_align_items_and_justify_content_center_and_left_position", 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); @@ -768,6 +810,9 @@ test("absolute_layout_align_items_and_justify_content_center_and_right_position" 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); @@ -817,6 +862,9 @@ test("position_root_with_rtl_should_position_withoutdirection", () => { 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.setPosition(Yoga.EDGE_LEFT, 72); @@ -847,6 +895,9 @@ test("absolute_layout_percentage_bottom_based_on_parent_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(100); @@ -927,6 +978,9 @@ test("absolute_layout_in_wrap_reverse_column_container", () => { 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.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); @@ -973,6 +1027,9 @@ test("absolute_layout_in_wrap_reverse_row_container", () => { 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); @@ -1020,6 +1077,9 @@ test("absolute_layout_in_wrap_reverse_column_container_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.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); @@ -1067,6 +1127,9 @@ test("absolute_layout_in_wrap_reverse_row_container_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1111,3 +1174,168 @@ test("absolute_layout_in_wrap_reverse_row_container_flex_end", () => { config.free(); } }); +test("percent_absolute_position_infinite_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(300); + + const root_child0 = Yoga.Node.create(config); + root_child0.setWidth(300); + root.insertChild(root_child0, 0); + + const root_child1 = Yoga.Node.create(config); + root_child1.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child1.setPosition(Yoga.EDGE_LEFT, "20%"); + root_child1.setPosition(Yoga.EDGE_TOP, "20%"); + root_child1.setWidth("20%"); + root_child1.setHeight("20%"); + root.insertChild(root_child1, 1); + root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(300); + expect(root.getComputedHeight()).toBe(0); + + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(300); + expect(root_child0.getComputedHeight()).toBe(0); + + expect(root_child1.getComputedLeft()).toBe(60); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(60); + expect(root_child1.getComputedHeight()).toBe(0); + + root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(300); + expect(root.getComputedHeight()).toBe(0); + + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(300); + expect(root_child0.getComputedHeight()).toBe(0); + + expect(root_child1.getComputedLeft()).toBe(60); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(60); + expect(root_child1.getComputedHeight()).toBe(0); + } finally { + if (typeof root !== "undefined") { + root.freeRecursive(); + } + + config.free(); + } +}); +test("absolute_layout_percentage_height_based_on_padded_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.setPadding(Yoga.EDGE_TOP, 10); + root.setBorder(Yoga.EDGE_TOP, 10); + root.setWidth(100); + root.setHeight(100); + + const root_child0 = Yoga.Node.create(config); + root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child0.setWidth(100); + root_child0.setHeight("50%"); + root.insertChild(root_child0, 0); + root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); + + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); + + root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); + + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); + } finally { + if (typeof root !== "undefined") { + root.freeRecursive(); + } + + config.free(); + } +}); +test("absolute_layout_percentage_height_based_on_padded_parent_and_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.setJustifyContent(Yoga.JUSTIFY_CENTER); + root.setAlignItems(Yoga.ALIGN_CENTER); + root.setPadding(Yoga.EDGE_TOP, 20); + root.setPadding(Yoga.EDGE_BOTTOM, 20); + root.setWidth(100); + root.setHeight(100); + + const root_child0 = Yoga.Node.create(config); + root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child0.setWidth(100); + root_child0.setHeight("50%"); + root.insertChild(root_child0, 0); + root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); + + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(25); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); + + root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); + + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(25); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); + } finally { + if (typeof root !== "undefined") { + root.freeRecursive(); + } + + config.free(); + } +}); diff --git a/javascript/tests/generated/YGAlignContentTest.test.js b/javascript/tests/generated/YGAlignContentTest.test.js index bd3ec73e..f6706a9a 100644 --- a/javascript/tests/generated/YGAlignContentTest.test.js +++ b/javascript/tests/generated/YGAlignContentTest.test.js @@ -11,6 +11,9 @@ test("align_content_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -117,6 +120,9 @@ test("align_content_flex_start_without_height_on_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.setFlexWrap(Yoga.WRAP_WRAP); @@ -219,6 +225,9 @@ test("align_content_flex_start_with_flex", () => { 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.setFlexWrap(Yoga.WRAP_WRAP); @@ -327,6 +336,9 @@ test("align_content_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.setAlignContent(Yoga.ALIGN_FLEX_END); @@ -433,6 +445,9 @@ test("align_content_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.setAlignContent(Yoga.ALIGN_STRETCH); @@ -534,6 +549,9 @@ test("align_content_spacebetween", () => { 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); @@ -641,6 +659,9 @@ test("align_content_spacearound", () => { 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); @@ -748,6 +769,9 @@ test("align_content_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); @@ -850,6 +874,9 @@ test("align_content_stretch_row_with_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -968,6 +995,9 @@ test("align_content_stretch_row_with_flex", () => { 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); @@ -1076,6 +1106,9 @@ test("align_content_stretch_row_with_flex_no_shrink", () => { 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); @@ -1183,6 +1216,9 @@ test("align_content_stretch_row_with_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); @@ -1293,6 +1329,9 @@ test("align_content_stretch_row_with_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); @@ -1403,6 +1442,9 @@ test("align_content_stretch_row_with_single_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); @@ -1463,6 +1505,9 @@ test("align_content_stretch_row_with_fixed_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1566,6 +1611,9 @@ test("align_content_stretch_row_with_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1669,6 +1717,9 @@ test("align_content_stretch_row_with_min_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1772,6 +1823,9 @@ test("align_content_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.setAlignContent(Yoga.ALIGN_STRETCH); @@ -1892,6 +1946,9 @@ test("align_content_stretch_is_not_overriding_align_items", () => { 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.setAlignContent(Yoga.ALIGN_STRETCH); diff --git a/javascript/tests/generated/YGAlignItemsTest.test.js b/javascript/tests/generated/YGAlignItemsTest.test.js index 4f27c016..d6fea434 100644 --- a/javascript/tests/generated/YGAlignItemsTest.test.js +++ b/javascript/tests/generated/YGAlignItemsTest.test.js @@ -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); diff --git a/javascript/tests/generated/YGAlignSelfTest.test.js b/javascript/tests/generated/YGAlignSelfTest.test.js index b8f1db3f..928a7d62 100644 --- a/javascript/tests/generated/YGAlignSelfTest.test.js +++ b/javascript/tests/generated/YGAlignSelfTest.test.js @@ -11,6 +11,9 @@ test("align_self_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.setWidth(100); @@ -56,6 +59,9 @@ test("align_self_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.setWidth(100); @@ -101,6 +107,9 @@ test("align_self_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.setWidth(100); @@ -146,6 +155,9 @@ test("align_self_flex_end_override_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); @@ -192,6 +204,9 @@ test("align_self_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); diff --git a/javascript/tests/generated/YGAndroidNewsFeed.test.js b/javascript/tests/generated/YGAndroidNewsFeed.test.js index c198cae1..2ab527fe 100644 --- a/javascript/tests/generated/YGAndroidNewsFeed.test.js +++ b/javascript/tests/generated/YGAndroidNewsFeed.test.js @@ -11,6 +11,9 @@ test("android_news_feed", () => { 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.setAlignContent(Yoga.ALIGN_STRETCH); diff --git a/javascript/tests/generated/YGBorderTest.test.js b/javascript/tests/generated/YGBorderTest.test.js index edd8aab8..d4d22fd8 100644 --- a/javascript/tests/generated/YGBorderTest.test.js +++ b/javascript/tests/generated/YGBorderTest.test.js @@ -11,6 +11,9 @@ test("border_no_size", () => { 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.setBorder(Yoga.EDGE_LEFT, 10); @@ -42,6 +45,9 @@ test("border_container_match_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.setBorder(Yoga.EDGE_LEFT, 10); @@ -88,6 +94,9 @@ test("border_flex_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.setBorder(Yoga.EDGE_LEFT, 10); @@ -136,6 +145,9 @@ test("border_stretch_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.setBorder(Yoga.EDGE_LEFT, 10); @@ -183,6 +195,9 @@ test("border_center_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.setJustifyContent(Yoga.JUSTIFY_CENTER); diff --git a/javascript/tests/generated/YGDimensionTest.test.js b/javascript/tests/generated/YGDimensionTest.test.js index 582b4e61..21b7421c 100644 --- a/javascript/tests/generated/YGDimensionTest.test.js +++ b/javascript/tests/generated/YGDimensionTest.test.js @@ -11,6 +11,9 @@ test("wrap_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); @@ -53,6 +56,9 @@ test("wrap_grandchild", () => { 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); diff --git a/javascript/tests/generated/YGDisplayTest.test.js b/javascript/tests/generated/YGDisplayTest.test.js index 004ff905..b9fd8eac 100644 --- a/javascript/tests/generated/YGDisplayTest.test.js +++ b/javascript/tests/generated/YGDisplayTest.test.js @@ -11,6 +11,9 @@ test("display_none", () => { 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); @@ -70,6 +73,9 @@ test("display_none_fixed_size", () => { 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); @@ -130,6 +136,9 @@ test("display_none_with_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); @@ -194,6 +203,9 @@ test("display_none_with_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); @@ -290,6 +302,9 @@ test("display_none_with_position", () => { 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); @@ -350,6 +365,9 @@ test("display_none_with_position_absolute", () => { 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); diff --git a/javascript/tests/generated/YGFlexDirectionTest.test.js b/javascript/tests/generated/YGFlexDirectionTest.test.js index d7c5e0d7..f977af0e 100644 --- a/javascript/tests/generated/YGFlexDirectionTest.test.js +++ b/javascript/tests/generated/YGFlexDirectionTest.test.js @@ -11,6 +11,9 @@ test("flex_direction_column_no_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(100); @@ -81,6 +84,9 @@ test("flex_direction_row_no_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -152,6 +158,9 @@ test("flex_direction_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); @@ -223,6 +232,9 @@ test("flex_direction_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); @@ -295,6 +307,9 @@ test("flex_direction_column_reverse", () => { 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_COLUMN_REVERSE); @@ -367,6 +382,9 @@ test("flex_direction_row_reverse", () => { 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_REVERSE); diff --git a/javascript/tests/generated/YGFlexTest.test.js b/javascript/tests/generated/YGFlexTest.test.js index 141ad7cf..789ea167 100644 --- a/javascript/tests/generated/YGFlexTest.test.js +++ b/javascript/tests/generated/YGFlexTest.test.js @@ -11,6 +11,9 @@ test("flex_basis_flex_grow_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); @@ -69,6 +72,9 @@ test("flex_shrink_flex_grow_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); @@ -131,6 +137,9 @@ test("flex_shrink_flex_grow_child_flex_shrink_other_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); @@ -194,6 +203,9 @@ test("flex_basis_flex_grow_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); @@ -253,6 +265,9 @@ test("flex_basis_flex_shrink_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); @@ -311,6 +326,9 @@ test("flex_basis_flex_shrink_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); @@ -370,6 +388,9 @@ test("flex_shrink_to_zero", () => { 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.setHeight(75); @@ -444,6 +465,9 @@ test("flex_basis_overrides_main_size", () => { 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); @@ -519,6 +543,9 @@ test("flex_grow_shrink_at_most", () => { 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); @@ -576,6 +603,9 @@ test("flex_grow_less_than_factor_one", () => { 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); diff --git a/javascript/tests/generated/YGFlexWrapTest.test.js b/javascript/tests/generated/YGFlexWrapTest.test.js index cd0388dd..f1cf1f41 100644 --- a/javascript/tests/generated/YGFlexWrapTest.test.js +++ b/javascript/tests/generated/YGFlexWrapTest.test.js @@ -11,6 +11,9 @@ test("wrap_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.setFlexWrap(Yoga.WRAP_WRAP); @@ -100,6 +103,9 @@ test("wrap_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); @@ -190,6 +196,9 @@ test("wrap_row_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -281,6 +290,9 @@ test("wrap_row_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -372,6 +384,9 @@ test("flex_wrap_children_with_min_main_overriding_flex_basis", () => { 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); @@ -434,6 +449,9 @@ test("flex_wrap_wrap_to_child_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); @@ -521,6 +539,9 @@ test("flex_wrap_align_stretch_fits_one_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); @@ -580,6 +601,9 @@ test("wrap_reverse_row_align_content_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -685,6 +709,9 @@ test("wrap_reverse_row_align_content_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -791,6 +818,9 @@ test("wrap_reverse_row_single_line_different_size", () => { 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); @@ -896,6 +926,9 @@ test("wrap_reverse_row_align_content_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); @@ -1002,6 +1035,9 @@ test("wrap_reverse_row_align_content_space_around", () => { 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); @@ -1108,6 +1144,9 @@ test("wrap_reverse_column_fixed_size", () => { 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); @@ -1214,6 +1253,9 @@ test("wrapped_row_within_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); @@ -1289,6 +1331,9 @@ test("wrapped_row_within_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); @@ -1364,6 +1409,9 @@ test("wrapped_row_within_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); @@ -1439,6 +1487,9 @@ test("wrapped_column_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.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -1522,6 +1573,9 @@ test("wrapped_column_max_height_flex", () => { 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); @@ -1611,6 +1665,9 @@ test("wrap_nodes_with_content_sizing_overflowing_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.setWidth(500); @@ -1713,6 +1770,9 @@ test("wrap_nodes_with_content_sizing_margin_cross", () => { 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); diff --git a/javascript/tests/generated/YGGapTest.test.js b/javascript/tests/generated/YGGapTest.test.js index 11ffa6d6..765eeea5 100644 --- a/javascript/tests/generated/YGGapTest.test.js +++ b/javascript/tests/generated/YGGapTest.test.js @@ -11,6 +11,9 @@ test("column_gap_flexible", () => { 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); @@ -91,6 +94,9 @@ test("column_gap_inflexible", () => { 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); @@ -164,6 +170,9 @@ test("column_gap_mixed_flexible", () => { 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); @@ -239,6 +248,9 @@ test("column_gap_child_margins", () => { 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); @@ -324,6 +336,9 @@ test("column_row_gap_wrapping", () => { 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); @@ -491,6 +506,9 @@ test("column_gap_justify_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -564,6 +582,9 @@ test("column_gap_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -638,6 +659,9 @@ test("column_gap_justify_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -712,6 +736,9 @@ test("column_gap_justify_space_between", () => { 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); @@ -786,6 +813,9 @@ test("column_gap_justify_space_around", () => { 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); @@ -860,6 +890,9 @@ test("column_gap_justify_space_evenly", () => { 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); @@ -934,6 +967,9 @@ test("column_gap_wrap_align_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1057,6 +1093,9 @@ test("column_gap_wrap_align_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1181,6 +1220,9 @@ test("column_gap_wrap_align_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1305,6 +1347,9 @@ test("column_gap_wrap_align_space_between", () => { 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); @@ -1429,6 +1474,9 @@ test("column_gap_wrap_align_space_around", () => { 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); @@ -1553,6 +1601,9 @@ test("column_gap_wrap_align_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); @@ -1661,6 +1712,9 @@ test("column_gap_determines_parent_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1733,6 +1787,9 @@ test("row_gap_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -1851,6 +1908,9 @@ test("row_gap_align_items_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); @@ -1969,6 +2029,9 @@ test("row_gap_column_child_margins", () => { 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); @@ -2053,6 +2116,9 @@ test("row_gap_row_wrap_child_margins", () => { 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); @@ -2133,6 +2199,9 @@ test("row_gap_determines_parent_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(100); diff --git a/javascript/tests/generated/YGJustifyContentTest.test.js b/javascript/tests/generated/YGJustifyContentTest.test.js index 145eb54a..5066cfb1 100644 --- a/javascript/tests/generated/YGJustifyContentTest.test.js +++ b/javascript/tests/generated/YGJustifyContentTest.test.js @@ -11,6 +11,9 @@ test("justify_content_row_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -83,6 +86,9 @@ test("justify_content_row_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -156,6 +162,9 @@ test("justify_content_row_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -229,6 +238,9 @@ test("justify_content_row_space_between", () => { 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); @@ -302,6 +314,9 @@ test("justify_content_row_space_around", () => { 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); @@ -375,6 +390,9 @@ test("justify_content_column_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.setWidth(102); @@ -446,6 +464,9 @@ test("justify_content_column_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.setJustifyContent(Yoga.JUSTIFY_FLEX_END); @@ -518,6 +539,9 @@ test("justify_content_column_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); @@ -590,6 +614,9 @@ test("justify_content_column_space_between", () => { 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_SPACE_BETWEEN); @@ -662,6 +689,9 @@ test("justify_content_column_space_around", () => { 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_SPACE_AROUND); @@ -734,6 +764,9 @@ test("justify_content_row_min_width_and_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); @@ -780,6 +813,9 @@ test("justify_content_row_max_width_and_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); @@ -827,6 +863,9 @@ test("justify_content_column_min_height_and_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.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -872,6 +911,9 @@ test("justify_content_colunn_max_height_and_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.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -918,6 +960,9 @@ test("justify_content_column_space_evenly", () => { 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_SPACE_EVENLY); @@ -990,6 +1035,9 @@ test("justify_content_row_space_evenly", () => { 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); @@ -1063,6 +1111,9 @@ test("justify_content_min_width_with_padding_child_width_greater_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.setAlignContent(Yoga.ALIGN_STRETCH); @@ -1144,6 +1195,9 @@ test("justify_content_min_width_with_padding_child_width_lower_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.setAlignContent(Yoga.ALIGN_STRETCH); diff --git a/javascript/tests/generated/YGMarginTest.test.js b/javascript/tests/generated/YGMarginTest.test.js index 888b189a..65ee1a17 100644 --- a/javascript/tests/generated/YGMarginTest.test.js +++ b/javascript/tests/generated/YGMarginTest.test.js @@ -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); diff --git a/javascript/tests/generated/YGMinMaxDimensionTest.test.js b/javascript/tests/generated/YGMinMaxDimensionTest.test.js index 0642e299..55fac642 100644 --- a/javascript/tests/generated/YGMinMaxDimensionTest.test.js +++ b/javascript/tests/generated/YGMinMaxDimensionTest.test.js @@ -11,6 +11,9 @@ test("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(100); @@ -55,6 +58,9 @@ test("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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -100,6 +106,9 @@ test("justify_content_min_max", () => { 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); @@ -146,6 +155,9 @@ test("align_items_min_max", () => { 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); @@ -192,6 +204,9 @@ test("justify_content_overflow_min_max", () => { 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); @@ -267,6 +282,9 @@ test("flex_grow_to_min", () => { 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); @@ -326,6 +344,9 @@ test("flex_grow_in_at_most_container", () => { 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); @@ -386,6 +407,9 @@ test("flex_grow_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); @@ -430,6 +454,9 @@ test("flex_grow_within_constrained_min_max_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.setMinHeight(100); @@ -487,6 +514,9 @@ test("flex_grow_within_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(200); @@ -546,6 +576,9 @@ test("flex_grow_within_constrained_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(200); @@ -605,6 +638,9 @@ test("flex_root_ignored", () => { 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.setFlexGrow(1); @@ -665,6 +701,9 @@ test("flex_grow_root_minimized", () => { 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); @@ -740,6 +779,9 @@ test("flex_grow_height_maximized", () => { 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); @@ -814,6 +856,9 @@ test("flex_grow_within_constrained_min_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); @@ -872,6 +917,9 @@ test("flex_grow_within_constrained_min_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.setMinHeight(100); @@ -928,6 +976,9 @@ test("flex_grow_within_constrained_max_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.setWidth(200); @@ -1001,6 +1052,9 @@ test("flex_grow_within_constrained_max_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); @@ -1059,6 +1113,9 @@ test("child_min_max_width_flexing", () => { 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); @@ -1121,6 +1178,9 @@ test("min_width_overrides_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(50); @@ -1150,6 +1210,9 @@ test("max_width_overrides_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(200); @@ -1179,6 +1242,9 @@ test("min_height_overrides_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.setHeight(50); @@ -1208,6 +1274,9 @@ test("max_height_overrides_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.setHeight(200); @@ -1237,6 +1306,9 @@ test("min_max_percent_no_width_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.setAlignItems(Yoga.ALIGN_FLEX_START); diff --git a/javascript/tests/generated/YGPaddingTest.test.js b/javascript/tests/generated/YGPaddingTest.test.js index 1f9498c3..5d03d3d4 100644 --- a/javascript/tests/generated/YGPaddingTest.test.js +++ b/javascript/tests/generated/YGPaddingTest.test.js @@ -11,6 +11,9 @@ test("padding_no_size", () => { 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.setPadding(Yoga.EDGE_LEFT, 10); @@ -42,6 +45,9 @@ test("padding_container_match_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.setPadding(Yoga.EDGE_LEFT, 10); @@ -88,6 +94,9 @@ test("padding_flex_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.setPadding(Yoga.EDGE_LEFT, 10); @@ -136,6 +145,9 @@ test("padding_stretch_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.setPadding(Yoga.EDGE_LEFT, 10); @@ -183,6 +195,9 @@ test("padding_center_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.setJustifyContent(Yoga.JUSTIFY_CENTER); @@ -232,6 +247,9 @@ test("child_with_padding_align_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.setJustifyContent(Yoga.JUSTIFY_FLEX_END); diff --git a/javascript/tests/generated/YGPercentageTest.test.js b/javascript/tests/generated/YGPercentageTest.test.js index 2c34df61..6682442a 100644 --- a/javascript/tests/generated/YGPercentageTest.test.js +++ b/javascript/tests/generated/YGPercentageTest.test.js @@ -11,6 +11,9 @@ test("percentage_width_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -56,6 +59,9 @@ test("percentage_position_left_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); @@ -103,6 +109,9 @@ test("percentage_position_bottom_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -150,6 +159,9 @@ test("percentage_flex_basis", () => { 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); @@ -210,6 +222,9 @@ test("percentage_flex_basis_cross", () => { 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); @@ -269,6 +284,9 @@ test("percentage_flex_basis_main_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -331,6 +349,9 @@ test("percentage_flex_basis_cross_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(200); @@ -392,6 +413,9 @@ test("percentage_flex_basis_main_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -454,6 +478,9 @@ test("percentage_flex_basis_cross_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(200); @@ -515,6 +542,9 @@ test("percentage_flex_basis_main_min_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -577,6 +607,9 @@ test("percentage_flex_basis_cross_min_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(200); @@ -638,6 +671,9 @@ test("percentage_multiple_nested_with_padding_margin_and_percentage_values", () 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); @@ -751,6 +787,9 @@ test("percentage_margin_should_calculate_based_only_on_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(200); @@ -813,6 +852,9 @@ test("percentage_padding_should_calculate_based_only_on_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(200); @@ -875,6 +917,9 @@ test("percentage_absolute_position", () => { 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); @@ -922,6 +967,9 @@ test("percentage_width_height_undefined_parent_size", () => { 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); @@ -964,6 +1012,9 @@ test("percent_within_flex_grow", () => { 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); @@ -1050,6 +1101,9 @@ test("percentage_container_in_wrapping_container", () => { 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); @@ -1140,6 +1194,9 @@ test("percent_absolute_position", () => { 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(60); diff --git a/javascript/tests/generated/YGRoundingTest.test.js b/javascript/tests/generated/YGRoundingTest.test.js index c1cac6e4..33a1a2d2 100644 --- a/javascript/tests/generated/YGRoundingTest.test.js +++ b/javascript/tests/generated/YGRoundingTest.test.js @@ -11,6 +11,9 @@ test("rounding_flex_basis_flex_grow_row_width_of_100", () => { 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); @@ -83,6 +86,9 @@ test("rounding_flex_basis_flex_grow_row_prime_number_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.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -183,6 +189,9 @@ test("rounding_flex_basis_flex_shrink_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); @@ -256,6 +265,9 @@ test("rounding_flex_basis_overrides_main_size", () => { 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); @@ -331,6 +343,9 @@ test("rounding_total_fractial", () => { 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(87.4); @@ -406,6 +421,9 @@ test("rounding_total_fractial_nested", () => { 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(87.4); @@ -515,6 +533,9 @@ test("rounding_fractial_input_1", () => { 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); @@ -590,6 +611,9 @@ test("rounding_fractial_input_2", () => { 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); @@ -665,6 +689,9 @@ test("rounding_fractial_input_3", () => { 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.setPosition(Yoga.EDGE_TOP, 0.3); @@ -741,6 +768,9 @@ test("rounding_fractial_input_4", () => { 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.setPosition(Yoga.EDGE_TOP, 0.7); @@ -817,6 +847,9 @@ test("rounding_inner_node_controversy_horizontal", () => { 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); @@ -906,6 +939,9 @@ test("rounding_inner_node_controversy_vertical", () => { 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.setHeight(320); @@ -994,6 +1030,9 @@ test("rounding_inner_node_controversy_combined", () => { 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); diff --git a/javascript/tests/generated/YGSizeOverflowTest.test.js b/javascript/tests/generated/YGSizeOverflowTest.test.js index 6fa2c119..c8d4e802 100644 --- a/javascript/tests/generated/YGSizeOverflowTest.test.js +++ b/javascript/tests/generated/YGSizeOverflowTest.test.js @@ -11,6 +11,9 @@ test("nested_overflowing_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.setWidth(100); @@ -68,6 +71,9 @@ test("nested_overflowing_child_in_constraint_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.setWidth(100); @@ -127,6 +133,9 @@ test("parent_wrap_child_size_overflowing_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.setWidth(100); diff --git a/tests/YGInfiniteHeightTest.cpp b/tests/YGInfiniteHeightTest.cpp deleted file mode 100644 index 42012a4f..00000000 --- a/tests/YGInfiniteHeightTest.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#include -#include - -// This test isn't correct from the Flexbox standard standpoint, -// because percentages are calculated with parent constraints. -// However, we need to make sure we fail gracefully in this case, not returning -// NaN -TEST(YogaTest, percent_absolute_position_infinite_height) { - const YGConfigRef config = YGConfigNew(); - - const YGNodeRef root = YGNodeNewWithConfig(config); - YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); - YGNodeStyleSetWidth(root, 300); - - const YGNodeRef root_child0 = YGNodeNewWithConfig(config); - YGNodeStyleSetWidth(root_child0, 300); - YGNodeStyleSetHeight(root_child0, 300); - YGNodeInsertChild(root, root_child0, 0); - - const YGNodeRef root_child1 = YGNodeNewWithConfig(config); - YGNodeStyleSetPositionType(root_child1, YGPositionTypeAbsolute); - YGNodeStyleSetPositionPercent(root_child1, YGEdgeLeft, 20); - YGNodeStyleSetPositionPercent(root_child1, YGEdgeTop, 20); - YGNodeStyleSetWidthPercent(root_child1, 20); - YGNodeStyleSetHeightPercent(root_child1, 20); - YGNodeInsertChild(root, root_child1, 1); - YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); - - ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); - ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); - ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root)); - ASSERT_FLOAT_EQ(300, YGNodeLayoutGetHeight(root)); - - ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); - ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0)); - ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root_child0)); - ASSERT_FLOAT_EQ(300, YGNodeLayoutGetHeight(root_child0)); - - ASSERT_FLOAT_EQ(60, YGNodeLayoutGetLeft(root_child1)); - ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child1)); - ASSERT_FLOAT_EQ(60, YGNodeLayoutGetWidth(root_child1)); - ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root_child1)); - - YGNodeFreeRecursive(root); - - YGConfigFree(config); -} diff --git a/tests/generated/YGAbsolutePositionTest.cpp b/tests/generated/YGAbsolutePositionTest.cpp index 0ad6d75c..4b96c2d5 100644 --- a/tests/generated/YGAbsolutePositionTest.cpp +++ b/tests/generated/YGAbsolutePositionTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, absolute_layout_width_height_start_top) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -56,6 +58,8 @@ TEST(YogaTest, absolute_layout_width_height_start_top) { TEST(YogaTest, absolute_layout_width_height_end_bottom) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -99,6 +103,8 @@ TEST(YogaTest, absolute_layout_width_height_end_bottom) { TEST(YogaTest, absolute_layout_start_top_end_bottom) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -142,6 +148,8 @@ TEST(YogaTest, absolute_layout_start_top_end_bottom) { TEST(YogaTest, absolute_layout_width_height_start_top_end_bottom) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -187,6 +195,8 @@ TEST(YogaTest, absolute_layout_width_height_start_top_end_bottom) { TEST(YogaTest, do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -245,6 +255,8 @@ TEST(YogaTest, do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hi TEST(YogaTest, absolute_layout_within_border) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetMargin(root, YGEdgeLeft, 10); @@ -362,6 +374,8 @@ TEST(YogaTest, absolute_layout_within_border) { TEST(YogaTest, absolute_layout_align_items_and_justify_content_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -406,6 +420,8 @@ TEST(YogaTest, absolute_layout_align_items_and_justify_content_center) { TEST(YogaTest, absolute_layout_align_items_and_justify_content_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd); @@ -450,6 +466,8 @@ TEST(YogaTest, absolute_layout_align_items_and_justify_content_flex_end) { TEST(YogaTest, absolute_layout_justify_content_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -493,6 +511,8 @@ TEST(YogaTest, absolute_layout_justify_content_center) { TEST(YogaTest, absolute_layout_align_items_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -536,6 +556,8 @@ TEST(YogaTest, absolute_layout_align_items_center) { TEST(YogaTest, absolute_layout_align_items_center_on_child_only) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexGrow(root, 1); @@ -579,6 +601,8 @@ TEST(YogaTest, absolute_layout_align_items_center_on_child_only) { TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_top_position) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -624,6 +648,8 @@ TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_top_po TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_bottom_position) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -669,6 +695,8 @@ TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_bottom TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_left_position) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -714,6 +742,8 @@ TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_left_p TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_right_position) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -759,6 +789,8 @@ TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_right_ TEST(YogaTest, position_root_with_rtl_should_position_withoutdirection) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPosition(root, YGEdgeLeft, 72); @@ -785,6 +817,8 @@ TEST(YogaTest, position_root_with_rtl_should_position_withoutdirection) { TEST(YogaTest, absolute_layout_percentage_bottom_based_on_parent_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -861,6 +895,8 @@ TEST(YogaTest, absolute_layout_percentage_bottom_based_on_parent_height) { TEST(YogaTest, absolute_layout_in_wrap_reverse_column_container) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexWrap(root, YGWrapWrapReverse); @@ -903,6 +939,8 @@ TEST(YogaTest, absolute_layout_in_wrap_reverse_column_container) { TEST(YogaTest, absolute_layout_in_wrap_reverse_row_container) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -946,6 +984,8 @@ TEST(YogaTest, absolute_layout_in_wrap_reverse_row_container) { TEST(YogaTest, absolute_layout_in_wrap_reverse_column_container_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexWrap(root, YGWrapWrapReverse); @@ -989,6 +1029,8 @@ TEST(YogaTest, absolute_layout_in_wrap_reverse_column_container_flex_end) { TEST(YogaTest, absolute_layout_in_wrap_reverse_row_container_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1030,3 +1072,153 @@ TEST(YogaTest, absolute_layout_in_wrap_reverse_row_container_flex_end) { YGConfigFree(config); } + +TEST(YogaTest, percent_absolute_position_infinite_height) { + const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); + + const YGNodeRef root = YGNodeNewWithConfig(config); + YGNodeStyleSetWidth(root, 300); + + const YGNodeRef root_child0 = YGNodeNewWithConfig(config); + YGNodeStyleSetWidth(root_child0, 300); + YGNodeInsertChild(root, root_child0, 0); + + const YGNodeRef root_child1 = YGNodeNewWithConfig(config); + YGNodeStyleSetPositionType(root_child1, YGPositionTypeAbsolute); + YGNodeStyleSetPositionPercent(root_child1, YGEdgeLeft, 20); + YGNodeStyleSetPositionPercent(root_child1, YGEdgeTop, 20); + YGNodeStyleSetWidthPercent(root_child1, 20); + YGNodeStyleSetHeightPercent(root_child1, 20); + YGNodeInsertChild(root, root_child1, 1); + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root_child0)); + + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetLeft(root_child1)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child1)); + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetWidth(root_child1)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root_child1)); + + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(300, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root_child0)); + + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetLeft(root_child1)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child1)); + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetWidth(root_child1)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetHeight(root_child1)); + + YGNodeFreeRecursive(root); + + YGConfigFree(config); +} + +TEST(YogaTest, absolute_layout_percentage_height_based_on_padded_parent) { + const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); + + const YGNodeRef root = YGNodeNewWithConfig(config); + YGNodeStyleSetPadding(root, YGEdgeTop, 10); + YGNodeStyleSetBorder(root, YGEdgeTop, 10); + YGNodeStyleSetWidth(root, 100); + YGNodeStyleSetHeight(root, 100); + + const YGNodeRef root_child0 = YGNodeNewWithConfig(config); + YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute); + YGNodeStyleSetWidth(root_child0, 100); + YGNodeStyleSetHeightPercent(root_child0, 50); + YGNodeInsertChild(root, root_child0, 0); + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(10, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(50, YGNodeLayoutGetHeight(root_child0)); + + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(10, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(50, YGNodeLayoutGetHeight(root_child0)); + + YGNodeFreeRecursive(root); + + YGConfigFree(config); +} + +TEST(YogaTest, absolute_layout_percentage_height_based_on_padded_parent_and_align_items_center) { + const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); + + const YGNodeRef root = YGNodeNewWithConfig(config); + YGNodeStyleSetJustifyContent(root, YGJustifyCenter); + YGNodeStyleSetAlignItems(root, YGAlignCenter); + YGNodeStyleSetPadding(root, YGEdgeTop, 20); + YGNodeStyleSetPadding(root, YGEdgeBottom, 20); + YGNodeStyleSetWidth(root, 100); + YGNodeStyleSetHeight(root, 100); + + const YGNodeRef root_child0 = YGNodeNewWithConfig(config); + YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute); + YGNodeStyleSetWidth(root_child0, 100); + YGNodeStyleSetHeightPercent(root_child0, 50); + YGNodeInsertChild(root, root_child0, 0); + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(25, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(50, YGNodeLayoutGetHeight(root_child0)); + + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(25, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(50, YGNodeLayoutGetHeight(root_child0)); + + YGNodeFreeRecursive(root); + + YGConfigFree(config); +} diff --git a/tests/generated/YGAlignContentTest.cpp b/tests/generated/YGAlignContentTest.cpp index 0421c59b..32efb6f4 100644 --- a/tests/generated/YGAlignContentTest.cpp +++ b/tests/generated/YGAlignContentTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, align_content_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -115,6 +117,8 @@ TEST(YogaTest, align_content_flex_start) { TEST(YogaTest, align_content_flex_start_without_height_on_children) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexWrap(root, YGWrapWrap); @@ -213,6 +217,8 @@ TEST(YogaTest, align_content_flex_start_without_height_on_children) { TEST(YogaTest, align_content_flex_start_with_flex) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexWrap(root, YGWrapWrap); @@ -317,6 +323,8 @@ TEST(YogaTest, align_content_flex_start_with_flex) { TEST(YogaTest, align_content_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignContent(root, YGAlignFlexEnd); @@ -419,6 +427,8 @@ TEST(YogaTest, align_content_flex_end) { TEST(YogaTest, align_content_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignContent(root, YGAlignStretch); @@ -516,6 +526,8 @@ TEST(YogaTest, align_content_stretch) { TEST(YogaTest, align_content_spacebetween) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -619,6 +631,8 @@ TEST(YogaTest, align_content_spacebetween) { TEST(YogaTest, align_content_spacearound) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -722,6 +736,8 @@ TEST(YogaTest, align_content_spacearound) { TEST(YogaTest, align_content_stretch_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -820,6 +836,8 @@ TEST(YogaTest, align_content_stretch_row) { TEST(YogaTest, align_content_stretch_row_with_children) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -934,6 +952,8 @@ TEST(YogaTest, align_content_stretch_row_with_children) { TEST(YogaTest, align_content_stretch_row_with_flex) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1038,6 +1058,8 @@ TEST(YogaTest, align_content_stretch_row_with_flex) { TEST(YogaTest, align_content_stretch_row_with_flex_no_shrink) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1141,6 +1163,8 @@ TEST(YogaTest, align_content_stretch_row_with_flex_no_shrink) { TEST(YogaTest, align_content_stretch_row_with_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1247,6 +1271,8 @@ TEST(YogaTest, align_content_stretch_row_with_margin) { TEST(YogaTest, align_content_stretch_row_with_padding) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1353,6 +1379,8 @@ TEST(YogaTest, align_content_stretch_row_with_padding) { TEST(YogaTest, align_content_stretch_row_with_single_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1409,6 +1437,8 @@ TEST(YogaTest, align_content_stretch_row_with_single_row) { TEST(YogaTest, align_content_stretch_row_with_fixed_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1508,6 +1538,8 @@ TEST(YogaTest, align_content_stretch_row_with_fixed_height) { TEST(YogaTest, align_content_stretch_row_with_max_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1607,6 +1639,8 @@ TEST(YogaTest, align_content_stretch_row_with_max_height) { TEST(YogaTest, align_content_stretch_row_with_min_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1706,6 +1740,8 @@ TEST(YogaTest, align_content_stretch_row_with_min_height) { TEST(YogaTest, align_content_stretch_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignContent(root, YGAlignStretch); @@ -1822,6 +1858,8 @@ TEST(YogaTest, align_content_stretch_column) { TEST(YogaTest, align_content_stretch_is_not_overriding_align_items) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignContent(root, YGAlignStretch); diff --git a/tests/generated/YGAlignItemsTest.cpp b/tests/generated/YGAlignItemsTest.cpp index 254e325d..611e303f 100644 --- a/tests/generated/YGAlignItemsTest.cpp +++ b/tests/generated/YGAlignItemsTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, align_items_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -52,6 +54,8 @@ TEST(YogaTest, align_items_stretch) { TEST(YogaTest, align_items_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -93,6 +97,8 @@ TEST(YogaTest, align_items_center) { TEST(YogaTest, align_items_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignFlexStart); @@ -134,6 +140,8 @@ TEST(YogaTest, align_items_flex_start) { TEST(YogaTest, align_items_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignFlexEnd); @@ -175,6 +183,8 @@ TEST(YogaTest, align_items_flex_end) { TEST(YogaTest, align_baseline) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -232,6 +242,8 @@ TEST(YogaTest, align_baseline) { TEST(YogaTest, align_baseline_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -304,6 +316,8 @@ TEST(YogaTest, align_baseline_child) { TEST(YogaTest, align_baseline_child_multiline) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -423,6 +437,8 @@ TEST(YogaTest, align_baseline_child_multiline) { TEST(YogaTest, align_baseline_child_multiline_override) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -544,6 +560,8 @@ TEST(YogaTest, align_baseline_child_multiline_override) { TEST(YogaTest, align_baseline_child_multiline_no_override_on_secondline) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -664,6 +682,8 @@ TEST(YogaTest, align_baseline_child_multiline_no_override_on_secondline) { TEST(YogaTest, align_baseline_child_top) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -737,6 +757,8 @@ TEST(YogaTest, align_baseline_child_top) { TEST(YogaTest, align_baseline_child_top2) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -810,6 +832,8 @@ TEST(YogaTest, align_baseline_child_top2) { TEST(YogaTest, align_baseline_double_nested_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -897,6 +921,8 @@ TEST(YogaTest, align_baseline_double_nested_child) { TEST(YogaTest, align_baseline_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignBaseline); @@ -953,6 +979,8 @@ TEST(YogaTest, align_baseline_column) { TEST(YogaTest, align_baseline_child_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1033,6 +1061,8 @@ TEST(YogaTest, align_baseline_child_margin) { TEST(YogaTest, align_baseline_child_padding) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1113,6 +1143,8 @@ TEST(YogaTest, align_baseline_child_padding) { TEST(YogaTest, align_baseline_multiline) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1231,6 +1263,8 @@ TEST(YogaTest, align_baseline_multiline) { TEST(YogaTest, align_baseline_multiline_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignBaseline); @@ -1348,6 +1382,8 @@ TEST(YogaTest, align_baseline_multiline_column) { TEST(YogaTest, align_baseline_multiline_column2) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignBaseline); @@ -1465,6 +1501,8 @@ TEST(YogaTest, align_baseline_multiline_column2) { TEST(YogaTest, align_baseline_multiline_row_and_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1583,6 +1621,8 @@ TEST(YogaTest, align_baseline_multiline_row_and_column) { TEST(YogaTest, align_items_center_child_with_margin_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1641,6 +1681,8 @@ TEST(YogaTest, align_items_center_child_with_margin_bigger_than_parent) { TEST(YogaTest, align_items_flex_end_child_with_margin_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1699,6 +1741,8 @@ TEST(YogaTest, align_items_flex_end_child_with_margin_bigger_than_parent) { TEST(YogaTest, align_items_center_child_without_margin_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1755,6 +1799,8 @@ TEST(YogaTest, align_items_center_child_without_margin_bigger_than_parent) { TEST(YogaTest, align_items_flex_end_child_without_margin_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1811,6 +1857,8 @@ TEST(YogaTest, align_items_flex_end_child_without_margin_bigger_than_parent) { TEST(YogaTest, align_center_should_size_based_on_content) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -1883,6 +1931,8 @@ TEST(YogaTest, align_center_should_size_based_on_content) { TEST(YogaTest, align_stretch_should_size_based_on_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetMargin(root, YGEdgeTop, 20); @@ -1954,6 +2004,8 @@ TEST(YogaTest, align_stretch_should_size_based_on_parent) { TEST(YogaTest, align_flex_start_with_shrinking_children) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 500); @@ -2023,6 +2075,8 @@ TEST(YogaTest, align_flex_start_with_shrinking_children) { TEST(YogaTest, align_flex_start_with_stretching_children) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 500); @@ -2091,6 +2145,8 @@ TEST(YogaTest, align_flex_start_with_stretching_children) { TEST(YogaTest, align_flex_start_with_shrinking_children_with_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 500); diff --git a/tests/generated/YGAlignSelfTest.cpp b/tests/generated/YGAlignSelfTest.cpp index 2eaf5c12..83cb8b80 100644 --- a/tests/generated/YGAlignSelfTest.cpp +++ b/tests/generated/YGAlignSelfTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, align_self_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -54,6 +56,8 @@ TEST(YogaTest, align_self_center) { TEST(YogaTest, align_self_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -95,6 +99,8 @@ TEST(YogaTest, align_self_flex_end) { TEST(YogaTest, align_self_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -136,6 +142,8 @@ TEST(YogaTest, align_self_flex_start) { TEST(YogaTest, align_self_flex_end_override_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignFlexStart); @@ -178,6 +186,8 @@ TEST(YogaTest, align_self_flex_end_override_flex_start) { TEST(YogaTest, align_self_baseline) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); diff --git a/tests/generated/YGAndroidNewsFeed.cpp b/tests/generated/YGAndroidNewsFeed.cpp index afa4d1ad..f05b11a0 100644 --- a/tests/generated/YGAndroidNewsFeed.cpp +++ b/tests/generated/YGAndroidNewsFeed.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, android_news_feed) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignContent(root, YGAlignStretch); diff --git a/tests/generated/YGBorderTest.cpp b/tests/generated/YGBorderTest.cpp index 71f45e6f..87607c12 100644 --- a/tests/generated/YGBorderTest.cpp +++ b/tests/generated/YGBorderTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, border_no_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetBorder(root, YGEdgeLeft, 10); @@ -40,6 +42,8 @@ TEST(YogaTest, border_no_size) { TEST(YogaTest, border_container_match_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetBorder(root, YGEdgeLeft, 10); @@ -82,6 +86,8 @@ TEST(YogaTest, border_container_match_child) { TEST(YogaTest, border_flex_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetBorder(root, YGEdgeLeft, 10); @@ -126,6 +132,8 @@ TEST(YogaTest, border_flex_child) { TEST(YogaTest, border_stretch_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetBorder(root, YGEdgeLeft, 10); @@ -169,6 +177,8 @@ TEST(YogaTest, border_stretch_child) { TEST(YogaTest, border_center_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); diff --git a/tests/generated/YGDimensionTest.cpp b/tests/generated/YGDimensionTest.cpp index aaa058e0..24878cd6 100644 --- a/tests/generated/YGDimensionTest.cpp +++ b/tests/generated/YGDimensionTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, wrap_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); @@ -51,6 +53,8 @@ TEST(YogaTest, wrap_child) { TEST(YogaTest, wrap_grandchild) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); diff --git a/tests/generated/YGDisplayTest.cpp b/tests/generated/YGDisplayTest.cpp index fd132342..cce7a367 100644 --- a/tests/generated/YGDisplayTest.cpp +++ b/tests/generated/YGDisplayTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, display_none) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -68,6 +70,8 @@ TEST(YogaTest, display_none) { TEST(YogaTest, display_none_fixed_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -124,6 +128,8 @@ TEST(YogaTest, display_none_fixed_size) { TEST(YogaTest, display_none_with_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -184,6 +190,8 @@ TEST(YogaTest, display_none_with_margin) { TEST(YogaTest, display_none_with_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -276,6 +284,8 @@ TEST(YogaTest, display_none_with_child) { TEST(YogaTest, display_none_with_position) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -332,6 +342,8 @@ TEST(YogaTest, display_none_with_position) { TEST(YogaTest, display_none_with_position_absolute) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); diff --git a/tests/generated/YGFlexDirectionTest.cpp b/tests/generated/YGFlexDirectionTest.cpp index 6d0cafbf..c7e4c78f 100644 --- a/tests/generated/YGFlexDirectionTest.cpp +++ b/tests/generated/YGFlexDirectionTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, flex_direction_column_no_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -79,6 +81,8 @@ TEST(YogaTest, flex_direction_column_no_height) { TEST(YogaTest, flex_direction_row_no_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -146,6 +150,8 @@ TEST(YogaTest, flex_direction_row_no_width) { TEST(YogaTest, flex_direction_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -213,6 +219,8 @@ TEST(YogaTest, flex_direction_column) { TEST(YogaTest, flex_direction_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -281,6 +289,8 @@ TEST(YogaTest, flex_direction_row) { TEST(YogaTest, flex_direction_column_reverse) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionColumnReverse); @@ -349,6 +359,8 @@ TEST(YogaTest, flex_direction_column_reverse) { TEST(YogaTest, flex_direction_row_reverse) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRowReverse); diff --git a/tests/generated/YGFlexTest.cpp b/tests/generated/YGFlexTest.cpp index db8a16b2..514feafe 100644 --- a/tests/generated/YGFlexTest.cpp +++ b/tests/generated/YGFlexTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, flex_basis_flex_grow_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -67,6 +69,8 @@ TEST(YogaTest, flex_basis_flex_grow_column) { TEST(YogaTest, flex_shrink_flex_grow_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -125,6 +129,8 @@ TEST(YogaTest, flex_shrink_flex_grow_row) { TEST(YogaTest, flex_shrink_flex_grow_child_flex_shrink_other_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -184,6 +190,8 @@ TEST(YogaTest, flex_shrink_flex_grow_child_flex_shrink_other_child) { TEST(YogaTest, flex_basis_flex_grow_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -239,6 +247,8 @@ TEST(YogaTest, flex_basis_flex_grow_row) { TEST(YogaTest, flex_basis_flex_shrink_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -293,6 +303,8 @@ TEST(YogaTest, flex_basis_flex_shrink_column) { TEST(YogaTest, flex_basis_flex_shrink_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -348,6 +360,8 @@ TEST(YogaTest, flex_basis_flex_shrink_row) { TEST(YogaTest, flex_shrink_to_zero) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetHeight(root, 75); @@ -418,6 +432,8 @@ TEST(YogaTest, flex_shrink_to_zero) { TEST(YogaTest, flex_basis_overrides_main_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -489,6 +505,8 @@ TEST(YogaTest, flex_basis_overrides_main_size) { TEST(YogaTest, flex_grow_shrink_at_most) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -542,6 +560,8 @@ TEST(YogaTest, flex_grow_shrink_at_most) { TEST(YogaTest, flex_grow_less_than_factor_one) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); diff --git a/tests/generated/YGFlexWrapTest.cpp b/tests/generated/YGFlexWrapTest.cpp index 86981aa8..1fa1224a 100644 --- a/tests/generated/YGFlexWrapTest.cpp +++ b/tests/generated/YGFlexWrapTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, wrap_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexWrap(root, YGWrapWrap); @@ -98,6 +100,8 @@ TEST(YogaTest, wrap_column) { TEST(YogaTest, wrap_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -184,6 +188,8 @@ TEST(YogaTest, wrap_row) { TEST(YogaTest, wrap_row_align_items_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -271,6 +277,8 @@ TEST(YogaTest, wrap_row_align_items_flex_end) { TEST(YogaTest, wrap_row_align_items_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -358,6 +366,8 @@ TEST(YogaTest, wrap_row_align_items_center) { TEST(YogaTest, flex_wrap_children_with_min_main_overriding_flex_basis) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -416,6 +426,8 @@ TEST(YogaTest, flex_wrap_children_with_min_main_overriding_flex_basis) { TEST(YogaTest, flex_wrap_wrap_to_child_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); @@ -499,6 +511,8 @@ TEST(YogaTest, flex_wrap_wrap_to_child_height) { TEST(YogaTest, flex_wrap_align_stretch_fits_one_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -554,6 +568,8 @@ TEST(YogaTest, flex_wrap_align_stretch_fits_one_row) { TEST(YogaTest, wrap_reverse_row_align_content_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -655,6 +671,8 @@ TEST(YogaTest, wrap_reverse_row_align_content_flex_start) { TEST(YogaTest, wrap_reverse_row_align_content_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -757,6 +775,8 @@ TEST(YogaTest, wrap_reverse_row_align_content_center) { TEST(YogaTest, wrap_reverse_row_single_line_different_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -858,6 +878,8 @@ TEST(YogaTest, wrap_reverse_row_single_line_different_size) { TEST(YogaTest, wrap_reverse_row_align_content_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -960,6 +982,8 @@ TEST(YogaTest, wrap_reverse_row_align_content_stretch) { TEST(YogaTest, wrap_reverse_row_align_content_space_around) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1062,6 +1086,8 @@ TEST(YogaTest, wrap_reverse_row_align_content_space_around) { TEST(YogaTest, wrap_reverse_column_fixed_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -1164,6 +1190,8 @@ TEST(YogaTest, wrap_reverse_column_fixed_size) { TEST(YogaTest, wrapped_row_within_align_items_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -1235,6 +1263,8 @@ TEST(YogaTest, wrapped_row_within_align_items_center) { TEST(YogaTest, wrapped_row_within_align_items_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignFlexStart); @@ -1306,6 +1336,8 @@ TEST(YogaTest, wrapped_row_within_align_items_flex_start) { TEST(YogaTest, wrapped_row_within_align_items_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignFlexEnd); @@ -1377,6 +1409,8 @@ TEST(YogaTest, wrapped_row_within_align_items_flex_end) { TEST(YogaTest, wrapped_column_max_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1456,6 +1490,8 @@ TEST(YogaTest, wrapped_column_max_height) { TEST(YogaTest, wrapped_column_max_height_flex) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1541,6 +1577,8 @@ TEST(YogaTest, wrapped_column_max_height_flex) { TEST(YogaTest, wrap_nodes_with_content_sizing_overflowing_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 500); @@ -1639,6 +1677,8 @@ TEST(YogaTest, wrap_nodes_with_content_sizing_overflowing_margin) { TEST(YogaTest, wrap_nodes_with_content_sizing_margin_cross) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 500); diff --git a/tests/generated/YGGapTest.cpp b/tests/generated/YGGapTest.cpp index 2fd0c70a..8f05158d 100644 --- a/tests/generated/YGGapTest.cpp +++ b/tests/generated/YGGapTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, column_gap_flexible) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -89,6 +91,8 @@ TEST(YogaTest, column_gap_flexible) { TEST(YogaTest, column_gap_inflexible) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -158,6 +162,8 @@ TEST(YogaTest, column_gap_inflexible) { TEST(YogaTest, column_gap_mixed_flexible) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -229,6 +235,8 @@ TEST(YogaTest, column_gap_mixed_flexible) { TEST(YogaTest, column_gap_child_margins) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -310,6 +318,8 @@ TEST(YogaTest, column_gap_child_margins) { TEST(YogaTest, column_row_gap_wrapping) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -473,6 +483,8 @@ TEST(YogaTest, column_row_gap_wrapping) { TEST(YogaTest, column_gap_justify_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -542,6 +554,8 @@ TEST(YogaTest, column_gap_justify_flex_start) { TEST(YogaTest, column_gap_justify_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -612,6 +626,8 @@ TEST(YogaTest, column_gap_justify_center) { TEST(YogaTest, column_gap_justify_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -682,6 +698,8 @@ TEST(YogaTest, column_gap_justify_flex_end) { TEST(YogaTest, column_gap_justify_space_between) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -752,6 +770,8 @@ TEST(YogaTest, column_gap_justify_space_between) { TEST(YogaTest, column_gap_justify_space_around) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -822,6 +842,8 @@ TEST(YogaTest, column_gap_justify_space_around) { TEST(YogaTest, column_gap_justify_space_evenly) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -892,6 +914,8 @@ TEST(YogaTest, column_gap_justify_space_evenly) { TEST(YogaTest, column_gap_wrap_align_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1011,6 +1035,8 @@ TEST(YogaTest, column_gap_wrap_align_flex_start) { TEST(YogaTest, column_gap_wrap_align_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1131,6 +1157,8 @@ TEST(YogaTest, column_gap_wrap_align_center) { TEST(YogaTest, column_gap_wrap_align_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1251,6 +1279,8 @@ TEST(YogaTest, column_gap_wrap_align_flex_end) { TEST(YogaTest, column_gap_wrap_align_space_between) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1371,6 +1401,8 @@ TEST(YogaTest, column_gap_wrap_align_space_between) { TEST(YogaTest, column_gap_wrap_align_space_around) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1491,6 +1523,8 @@ TEST(YogaTest, column_gap_wrap_align_space_around) { TEST(YogaTest, column_gap_wrap_align_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1595,6 +1629,8 @@ TEST(YogaTest, column_gap_wrap_align_stretch) { TEST(YogaTest, column_gap_determines_parent_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1663,6 +1699,8 @@ TEST(YogaTest, column_gap_determines_parent_width) { TEST(YogaTest, row_gap_align_items_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1777,6 +1815,8 @@ TEST(YogaTest, row_gap_align_items_stretch) { TEST(YogaTest, row_gap_align_items_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1891,6 +1931,8 @@ TEST(YogaTest, row_gap_align_items_end) { TEST(YogaTest, row_gap_column_child_margins) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -1971,6 +2013,8 @@ TEST(YogaTest, row_gap_column_child_margins) { TEST(YogaTest, row_gap_row_wrap_child_margins) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -2047,6 +2091,8 @@ TEST(YogaTest, row_gap_row_wrap_child_margins) { TEST(YogaTest, row_gap_determines_parent_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); diff --git a/tests/generated/YGJustifyContentTest.cpp b/tests/generated/YGJustifyContentTest.cpp index 67d8ebd6..17064063 100644 --- a/tests/generated/YGJustifyContentTest.cpp +++ b/tests/generated/YGJustifyContentTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, justify_content_row_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -81,6 +83,8 @@ TEST(YogaTest, justify_content_row_flex_start) { TEST(YogaTest, justify_content_row_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -150,6 +154,8 @@ TEST(YogaTest, justify_content_row_flex_end) { TEST(YogaTest, justify_content_row_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -219,6 +225,8 @@ TEST(YogaTest, justify_content_row_center) { TEST(YogaTest, justify_content_row_space_between) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -288,6 +296,8 @@ TEST(YogaTest, justify_content_row_space_between) { TEST(YogaTest, justify_content_row_space_around) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -357,6 +367,8 @@ TEST(YogaTest, justify_content_row_space_around) { TEST(YogaTest, justify_content_column_flex_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 102); @@ -424,6 +436,8 @@ TEST(YogaTest, justify_content_column_flex_start) { TEST(YogaTest, justify_content_column_flex_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd); @@ -492,6 +506,8 @@ TEST(YogaTest, justify_content_column_flex_end) { TEST(YogaTest, justify_content_column_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -560,6 +576,8 @@ TEST(YogaTest, justify_content_column_center) { TEST(YogaTest, justify_content_column_space_between) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifySpaceBetween); @@ -628,6 +646,8 @@ TEST(YogaTest, justify_content_column_space_between) { TEST(YogaTest, justify_content_column_space_around) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifySpaceAround); @@ -696,6 +716,8 @@ TEST(YogaTest, justify_content_column_space_around) { TEST(YogaTest, justify_content_row_min_width_and_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -738,6 +760,8 @@ TEST(YogaTest, justify_content_row_min_width_and_margin) { TEST(YogaTest, justify_content_row_max_width_and_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -781,6 +805,8 @@ TEST(YogaTest, justify_content_row_max_width_and_margin) { TEST(YogaTest, justify_content_column_min_height_and_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -822,6 +848,8 @@ TEST(YogaTest, justify_content_column_min_height_and_margin) { TEST(YogaTest, justify_content_colunn_max_height_and_margin) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -864,6 +892,8 @@ TEST(YogaTest, justify_content_colunn_max_height_and_margin) { TEST(YogaTest, justify_content_column_space_evenly) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifySpaceEvenly); @@ -932,6 +962,8 @@ TEST(YogaTest, justify_content_column_space_evenly) { TEST(YogaTest, justify_content_row_space_evenly) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1001,6 +1033,8 @@ TEST(YogaTest, justify_content_row_space_evenly) { TEST(YogaTest, justify_content_min_width_with_padding_child_width_greater_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignContent(root, YGAlignStretch); @@ -1078,6 +1112,8 @@ TEST(YogaTest, justify_content_min_width_with_padding_child_width_greater_than_p TEST(YogaTest, justify_content_min_width_with_padding_child_width_lower_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignContent(root, YGAlignStretch); diff --git a/tests/generated/YGMarginTest.cpp b/tests/generated/YGMarginTest.cpp index 515baa13..e16dcd0d 100644 --- a/tests/generated/YGMarginTest.cpp +++ b/tests/generated/YGMarginTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, margin_start) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -54,6 +56,8 @@ TEST(YogaTest, margin_start) { TEST(YogaTest, margin_top) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -94,6 +98,8 @@ TEST(YogaTest, margin_top) { TEST(YogaTest, margin_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -136,6 +142,8 @@ TEST(YogaTest, margin_end) { TEST(YogaTest, margin_bottom) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd); @@ -177,6 +185,8 @@ TEST(YogaTest, margin_bottom) { TEST(YogaTest, margin_and_flex_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -219,6 +229,8 @@ TEST(YogaTest, margin_and_flex_row) { TEST(YogaTest, margin_and_flex_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -260,6 +272,8 @@ TEST(YogaTest, margin_and_flex_column) { TEST(YogaTest, margin_and_stretch_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -302,6 +316,8 @@ TEST(YogaTest, margin_and_stretch_row) { TEST(YogaTest, margin_and_stretch_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -343,6 +359,8 @@ TEST(YogaTest, margin_and_stretch_column) { TEST(YogaTest, margin_with_sibling_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -398,6 +416,8 @@ TEST(YogaTest, margin_with_sibling_row) { TEST(YogaTest, margin_with_sibling_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -452,6 +472,8 @@ TEST(YogaTest, margin_with_sibling_column) { TEST(YogaTest, margin_auto_bottom) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -509,6 +531,8 @@ TEST(YogaTest, margin_auto_bottom) { TEST(YogaTest, margin_auto_top) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -566,6 +590,8 @@ TEST(YogaTest, margin_auto_top) { TEST(YogaTest, margin_auto_bottom_and_top) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -624,6 +650,8 @@ TEST(YogaTest, margin_auto_bottom_and_top) { TEST(YogaTest, margin_auto_bottom_and_top_justify_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -682,6 +710,8 @@ TEST(YogaTest, margin_auto_bottom_and_top_justify_center) { TEST(YogaTest, margin_auto_mutiple_children_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -755,6 +785,8 @@ TEST(YogaTest, margin_auto_mutiple_children_column) { TEST(YogaTest, margin_auto_mutiple_children_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -829,6 +861,8 @@ TEST(YogaTest, margin_auto_mutiple_children_row) { TEST(YogaTest, margin_auto_left_and_right_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -888,6 +922,8 @@ TEST(YogaTest, margin_auto_left_and_right_column) { TEST(YogaTest, margin_auto_left_and_right) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -945,6 +981,8 @@ TEST(YogaTest, margin_auto_left_and_right) { TEST(YogaTest, margin_auto_start_and_end_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1004,6 +1042,8 @@ TEST(YogaTest, margin_auto_start_and_end_column) { TEST(YogaTest, margin_auto_start_and_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -1061,6 +1101,8 @@ TEST(YogaTest, margin_auto_start_and_end) { TEST(YogaTest, margin_auto_left_and_right_column_and_center) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -1119,6 +1161,8 @@ TEST(YogaTest, margin_auto_left_and_right_column_and_center) { TEST(YogaTest, margin_auto_left) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -1176,6 +1220,8 @@ TEST(YogaTest, margin_auto_left) { TEST(YogaTest, margin_auto_right) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -1233,6 +1279,8 @@ TEST(YogaTest, margin_auto_right) { TEST(YogaTest, margin_auto_left_and_right_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1291,6 +1339,8 @@ TEST(YogaTest, margin_auto_left_and_right_stretch) { TEST(YogaTest, margin_auto_top_and_bottom_stretch) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -1348,6 +1398,8 @@ TEST(YogaTest, margin_auto_top_and_bottom_stretch) { TEST(YogaTest, margin_should_not_be_part_of_max_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 250); @@ -1390,6 +1442,8 @@ TEST(YogaTest, margin_should_not_be_part_of_max_height) { TEST(YogaTest, margin_should_not_be_part_of_max_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 250); @@ -1432,6 +1486,8 @@ TEST(YogaTest, margin_should_not_be_part_of_max_width) { TEST(YogaTest, margin_auto_left_right_child_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1475,6 +1531,8 @@ TEST(YogaTest, margin_auto_left_right_child_bigger_than_parent) { TEST(YogaTest, margin_auto_left_child_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1517,6 +1575,8 @@ TEST(YogaTest, margin_auto_left_child_bigger_than_parent) { TEST(YogaTest, margin_fix_left_auto_right_child_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1560,6 +1620,8 @@ TEST(YogaTest, margin_fix_left_auto_right_child_bigger_than_parent) { TEST(YogaTest, margin_auto_left_fix_right_child_bigger_than_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1603,6 +1665,8 @@ TEST(YogaTest, margin_auto_left_fix_right_child_bigger_than_parent) { TEST(YogaTest, margin_auto_top_stretching_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -1661,6 +1725,8 @@ TEST(YogaTest, margin_auto_top_stretching_child) { TEST(YogaTest, margin_auto_left_stretching_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); diff --git a/tests/generated/YGMinMaxDimensionTest.cpp b/tests/generated/YGMinMaxDimensionTest.cpp index f6ac495e..6c5652a4 100644 --- a/tests/generated/YGMinMaxDimensionTest.cpp +++ b/tests/generated/YGMinMaxDimensionTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, max_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -53,6 +55,8 @@ TEST(YogaTest, max_width) { TEST(YogaTest, max_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -94,6 +98,8 @@ TEST(YogaTest, max_height) { TEST(YogaTest, justify_content_min_max) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -136,6 +142,8 @@ TEST(YogaTest, justify_content_min_max) { TEST(YogaTest, align_items_min_max) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignCenter); @@ -178,6 +186,8 @@ TEST(YogaTest, align_items_min_max) { TEST(YogaTest, justify_content_overflow_min_max) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -249,6 +259,8 @@ TEST(YogaTest, justify_content_overflow_min_max) { TEST(YogaTest, flex_grow_to_min) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -304,6 +316,8 @@ TEST(YogaTest, flex_grow_to_min) { TEST(YogaTest, flex_grow_in_at_most_container) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -360,6 +374,8 @@ TEST(YogaTest, flex_grow_in_at_most_container) { TEST(YogaTest, flex_grow_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -400,6 +416,8 @@ TEST(YogaTest, flex_grow_child) { TEST(YogaTest, flex_grow_within_constrained_min_max_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetMinHeight(root, 100); @@ -453,6 +471,8 @@ TEST(YogaTest, flex_grow_within_constrained_min_max_column) { TEST(YogaTest, flex_grow_within_max_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -508,6 +528,8 @@ TEST(YogaTest, flex_grow_within_max_width) { TEST(YogaTest, flex_grow_within_constrained_max_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -563,6 +585,8 @@ TEST(YogaTest, flex_grow_within_constrained_max_width) { TEST(YogaTest, flex_root_ignored) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexGrow(root, 1); @@ -619,6 +643,8 @@ TEST(YogaTest, flex_root_ignored) { TEST(YogaTest, flex_grow_root_minimized) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -690,6 +716,8 @@ TEST(YogaTest, flex_grow_root_minimized) { TEST(YogaTest, flex_grow_height_maximized) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -760,6 +788,8 @@ TEST(YogaTest, flex_grow_height_maximized) { TEST(YogaTest, flex_grow_within_constrained_min_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -814,6 +844,8 @@ TEST(YogaTest, flex_grow_within_constrained_min_row) { TEST(YogaTest, flex_grow_within_constrained_min_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetMinHeight(root, 100); @@ -866,6 +898,8 @@ TEST(YogaTest, flex_grow_within_constrained_min_column) { TEST(YogaTest, flex_grow_within_constrained_max_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -935,6 +969,8 @@ TEST(YogaTest, flex_grow_within_constrained_max_row) { TEST(YogaTest, flex_grow_within_constrained_max_column) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -989,6 +1025,8 @@ TEST(YogaTest, flex_grow_within_constrained_max_column) { TEST(YogaTest, child_min_max_width_flexing) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -1047,6 +1085,8 @@ TEST(YogaTest, child_min_max_width_flexing) { TEST(YogaTest, min_width_overrides_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 50); @@ -1072,6 +1112,8 @@ TEST(YogaTest, min_width_overrides_width) { TEST(YogaTest, max_width_overrides_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -1097,6 +1139,8 @@ TEST(YogaTest, max_width_overrides_width) { TEST(YogaTest, min_height_overrides_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetHeight(root, 50); @@ -1122,6 +1166,8 @@ TEST(YogaTest, min_height_overrides_height) { TEST(YogaTest, max_height_overrides_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetHeight(root, 200); @@ -1147,6 +1193,8 @@ TEST(YogaTest, max_height_overrides_height) { TEST(YogaTest, min_max_percent_no_width_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetAlignItems(root, YGAlignFlexStart); diff --git a/tests/generated/YGPaddingTest.cpp b/tests/generated/YGPaddingTest.cpp index a955cf46..bf8d7f15 100644 --- a/tests/generated/YGPaddingTest.cpp +++ b/tests/generated/YGPaddingTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, padding_no_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPadding(root, YGEdgeLeft, 10); @@ -40,6 +42,8 @@ TEST(YogaTest, padding_no_size) { TEST(YogaTest, padding_container_match_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPadding(root, YGEdgeLeft, 10); @@ -82,6 +86,8 @@ TEST(YogaTest, padding_container_match_child) { TEST(YogaTest, padding_flex_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPadding(root, YGEdgeLeft, 10); @@ -126,6 +132,8 @@ TEST(YogaTest, padding_flex_child) { TEST(YogaTest, padding_stretch_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPadding(root, YGEdgeLeft, 10); @@ -169,6 +177,8 @@ TEST(YogaTest, padding_stretch_child) { TEST(YogaTest, padding_center_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -214,6 +224,8 @@ TEST(YogaTest, padding_center_child) { TEST(YogaTest, child_with_padding_align_end) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyFlexEnd); diff --git a/tests/generated/YGPercentageTest.cpp b/tests/generated/YGPercentageTest.cpp index 5bca4eb4..9e4a7af3 100644 --- a/tests/generated/YGPercentageTest.cpp +++ b/tests/generated/YGPercentageTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, percentage_width_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -54,6 +56,8 @@ TEST(YogaTest, percentage_width_height) { TEST(YogaTest, percentage_position_left_top) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -97,6 +101,8 @@ TEST(YogaTest, percentage_position_left_top) { TEST(YogaTest, percentage_position_bottom_right) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -140,6 +146,8 @@ TEST(YogaTest, percentage_position_bottom_right) { TEST(YogaTest, percentage_flex_basis) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -196,6 +204,8 @@ TEST(YogaTest, percentage_flex_basis) { TEST(YogaTest, percentage_flex_basis_cross) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -251,6 +261,8 @@ TEST(YogaTest, percentage_flex_basis_cross) { TEST(YogaTest, percentage_flex_basis_main_max_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -309,6 +321,8 @@ TEST(YogaTest, percentage_flex_basis_main_max_height) { TEST(YogaTest, percentage_flex_basis_cross_max_height) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -366,6 +380,8 @@ TEST(YogaTest, percentage_flex_basis_cross_max_height) { TEST(YogaTest, percentage_flex_basis_main_max_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -424,6 +440,8 @@ TEST(YogaTest, percentage_flex_basis_main_max_width) { TEST(YogaTest, percentage_flex_basis_cross_max_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -481,6 +499,8 @@ TEST(YogaTest, percentage_flex_basis_cross_max_width) { TEST(YogaTest, percentage_flex_basis_main_min_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -539,6 +559,8 @@ TEST(YogaTest, percentage_flex_basis_main_min_width) { TEST(YogaTest, percentage_flex_basis_cross_min_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -596,6 +618,8 @@ TEST(YogaTest, percentage_flex_basis_cross_min_width) { TEST(YogaTest, percentage_multiple_nested_with_padding_margin_and_percentage_values) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -705,6 +729,8 @@ TEST(YogaTest, percentage_multiple_nested_with_padding_margin_and_percentage_val TEST(YogaTest, percentage_margin_should_calculate_based_only_on_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -763,6 +789,8 @@ TEST(YogaTest, percentage_margin_should_calculate_based_only_on_width) { TEST(YogaTest, percentage_padding_should_calculate_based_only_on_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -821,6 +849,8 @@ TEST(YogaTest, percentage_padding_should_calculate_based_only_on_width) { TEST(YogaTest, percentage_absolute_position) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -864,6 +894,8 @@ TEST(YogaTest, percentage_absolute_position) { TEST(YogaTest, percentage_width_height_undefined_parent_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); @@ -902,6 +934,8 @@ TEST(YogaTest, percentage_width_height_undefined_parent_size) { TEST(YogaTest, percent_within_flex_grow) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -984,6 +1018,8 @@ TEST(YogaTest, percent_within_flex_grow) { TEST(YogaTest, percentage_container_in_wrapping_container) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetJustifyContent(root, YGJustifyCenter); @@ -1070,6 +1106,8 @@ TEST(YogaTest, percentage_container_in_wrapping_container) { TEST(YogaTest, percent_absolute_position) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 60); diff --git a/tests/generated/YGRoundingTest.cpp b/tests/generated/YGRoundingTest.cpp index 70968202..3df23f72 100644 --- a/tests/generated/YGRoundingTest.cpp +++ b/tests/generated/YGRoundingTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, rounding_flex_basis_flex_grow_row_width_of_100) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -81,6 +83,8 @@ TEST(YogaTest, rounding_flex_basis_flex_grow_row_width_of_100) { TEST(YogaTest, rounding_flex_basis_flex_grow_row_prime_number_width) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -177,6 +181,8 @@ TEST(YogaTest, rounding_flex_basis_flex_grow_row_prime_number_width) { TEST(YogaTest, rounding_flex_basis_flex_shrink_row) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -246,6 +252,8 @@ TEST(YogaTest, rounding_flex_basis_flex_shrink_row) { TEST(YogaTest, rounding_flex_basis_overrides_main_size) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -317,6 +325,8 @@ TEST(YogaTest, rounding_flex_basis_overrides_main_size) { TEST(YogaTest, rounding_total_fractial) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 87.4f); @@ -388,6 +398,8 @@ TEST(YogaTest, rounding_total_fractial) { TEST(YogaTest, rounding_total_fractial_nested) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 87.4f); @@ -493,6 +505,8 @@ TEST(YogaTest, rounding_total_fractial_nested) { TEST(YogaTest, rounding_fractial_input_1) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -564,6 +578,8 @@ TEST(YogaTest, rounding_fractial_input_1) { TEST(YogaTest, rounding_fractial_input_2) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -635,6 +651,8 @@ TEST(YogaTest, rounding_fractial_input_2) { TEST(YogaTest, rounding_fractial_input_3) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPosition(root, YGEdgeTop, 0.3f); @@ -707,6 +725,8 @@ TEST(YogaTest, rounding_fractial_input_3) { TEST(YogaTest, rounding_fractial_input_4) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPosition(root, YGEdgeTop, 0.7f); @@ -779,6 +799,8 @@ TEST(YogaTest, rounding_fractial_input_4) { TEST(YogaTest, rounding_inner_node_controversy_horizontal) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -864,6 +886,8 @@ TEST(YogaTest, rounding_inner_node_controversy_horizontal) { TEST(YogaTest, rounding_inner_node_controversy_vertical) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetHeight(root, 320); @@ -948,6 +972,8 @@ TEST(YogaTest, rounding_inner_node_controversy_vertical) { TEST(YogaTest, rounding_inner_node_controversy_combined) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); diff --git a/tests/generated/YGSizeOverflowTest.cpp b/tests/generated/YGSizeOverflowTest.cpp index 30d9fc0e..d365539f 100644 --- a/tests/generated/YGSizeOverflowTest.cpp +++ b/tests/generated/YGSizeOverflowTest.cpp @@ -13,6 +13,8 @@ TEST(YogaTest, nested_overflowing_child) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -66,6 +68,8 @@ TEST(YogaTest, nested_overflowing_child) { TEST(YogaTest, nested_overflowing_child_in_constraint_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -121,6 +125,8 @@ TEST(YogaTest, nested_overflowing_child_in_constraint_parent) { TEST(YogaTest, parent_wrap_child_size_overflowing_parent) { const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); diff --git a/yoga/YGEnums.cpp b/yoga/YGEnums.cpp index 3c3c0929..acb1bd07 100644 --- a/yoga/YGEnums.cpp +++ b/yoga/YGEnums.cpp @@ -91,6 +91,10 @@ const char* YGExperimentalFeatureToString(const YGExperimentalFeature value) { switch (value) { case YGExperimentalFeatureWebFlexBasis: return "web-flex-basis"; + case YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge: + return "absolute-percentage-against-padding-edge"; + case YGExperimentalFeatureFixAbsoluteTrailingColumnMargin: + return "fix-absolute-trailing-column-margin"; } return "unknown"; } diff --git a/yoga/YGEnums.h b/yoga/YGEnums.h index 8e4bb4ef..834e5f66 100644 --- a/yoga/YGEnums.h +++ b/yoga/YGEnums.h @@ -56,7 +56,9 @@ YG_ENUM_SEQ_DECL( YG_ENUM_SEQ_DECL( YGExperimentalFeature, - YGExperimentalFeatureWebFlexBasis) + YGExperimentalFeatureWebFlexBasis, + YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, + YGExperimentalFeatureFixAbsoluteTrailingColumnMargin) YG_ENUM_SEQ_DECL( YGFlexDirection, diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index a66adec1..dc04b72f 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -1595,13 +1595,21 @@ static void YGNodeAbsoluteLayoutChild( depth, generationCount); + auto trailingMarginOuterSize = + YGConfigIsExperimentalFeatureEnabled( + node->getConfig(), + YGExperimentalFeatureFixAbsoluteTrailingColumnMargin) + ? isMainAxisRow ? height : width + : width; + if (child->isTrailingPosDefined(mainAxis) && !child->isLeadingPositionDefined(mainAxis)) { child->setLayoutPosition( node->getLayout().measuredDimensions[dim[mainAxis]] - child->getLayout().measuredDimensions[dim[mainAxis]] - node->getTrailingBorder(mainAxis) - - child->getTrailingMargin(mainAxis, width).unwrap() - + child->getTrailingMargin(mainAxis, trailingMarginOuterSize) + .unwrap() - child->getTrailingPosition(mainAxis, isMainAxisRow ? width : height) .unwrap(), leading[mainAxis]); @@ -1620,6 +1628,22 @@ static void YGNodeAbsoluteLayoutChild( (node->getLayout().measuredDimensions[dim[mainAxis]] - child->getLayout().measuredDimensions[dim[mainAxis]]), leading[mainAxis]); + } else if ( + YGConfigIsExperimentalFeatureEnabled( + node->getConfig(), + YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge) && + child->isLeadingPositionDefined(mainAxis)) { + child->setLayoutPosition( + child->getLeadingPosition( + mainAxis, node->getLayout().measuredDimensions[dim[mainAxis]]) + .unwrap() + + node->getLeadingBorder(mainAxis) + + child + ->getLeadingMargin( + mainAxis, + node->getLayout().measuredDimensions[dim[mainAxis]]) + .unwrap(), + leading[mainAxis]); } if (child->isTrailingPosDefined(crossAxis) && @@ -1628,7 +1652,8 @@ static void YGNodeAbsoluteLayoutChild( node->getLayout().measuredDimensions[dim[crossAxis]] - child->getLayout().measuredDimensions[dim[crossAxis]] - node->getTrailingBorder(crossAxis) - - child->getTrailingMargin(crossAxis, width).unwrap() - + child->getTrailingMargin(crossAxis, trailingMarginOuterSize) + .unwrap() - child ->getTrailingPosition(crossAxis, isMainAxisRow ? height : width) .unwrap(), @@ -1650,6 +1675,23 @@ static void YGNodeAbsoluteLayoutChild( (node->getLayout().measuredDimensions[dim[crossAxis]] - child->getLayout().measuredDimensions[dim[crossAxis]]), leading[crossAxis]); + } else if ( + YGConfigIsExperimentalFeatureEnabled( + node->getConfig(), + YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge) && + child->isLeadingPositionDefined(crossAxis)) { + child->setLayoutPosition( + child->getLeadingPosition( + crossAxis, + node->getLayout().measuredDimensions[dim[crossAxis]]) + .unwrap() + + node->getLeadingBorder(crossAxis) + + child + ->getLeadingMargin( + crossAxis, + node->getLayout().measuredDimensions[dim[crossAxis]]) + .unwrap(), + leading[crossAxis]); } } @@ -3569,9 +3611,17 @@ static void YGNodelayoutImpl( YGNodeAbsoluteLayoutChild( node, child, - availableInnerWidth, + YGConfigIsExperimentalFeatureEnabled( + node->getConfig(), + YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge) + ? node->getLayout().measuredDimensions[YGDimensionWidth] + : availableInnerWidth, isMainAxisRow ? measureModeMainDim : measureModeCrossDim, - availableInnerHeight, + YGConfigIsExperimentalFeatureEnabled( + node->getConfig(), + YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge) + ? node->getLayout().measuredDimensions[YGDimensionHeight] + : availableInnerHeight, direction, config, layoutMarkerData,