From 3db38f2a80cd331bb757eba65baa2d10c9b41f39 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Thu, 27 Apr 2017 07:09:24 -0700 Subject: [PATCH] Remove rounding from experimental features Summary: Rounding has been successfully adopted by multiple products and frameworks. Time to move it out of experimental mode. Rounding can still be turned of by setting the point scale factor to 0 on the config. Reviewed By: gkassabli Differential Revision: D4953838 fbshipit-source-id: 3ee5f27d92f95b3ed4a01c98bc35e9157f2e91c5 --- .../Facebook.Yoga/YogaExperimentalFeature.cs | 1 - .../tests/Facebook.Yoga/YGPercentageTest.cs | 16 ---------- csharp/tests/Facebook.Yoga/YGRoundingTest.cs | 13 -------- enums.py | 3 +- gentest/fixtures/YGPercentageTest.html | 32 +++++++++---------- gentest/fixtures/YGRoundingTest.html | 26 +++++++-------- gentest/gentest.js | 13 ++------ .../yoga/YogaExperimentalFeature.java | 10 +++--- .../com/facebook/yoga/YGPercentageTest.java | 16 ---------- .../com/facebook/yoga/YGRoundingTest.java | 13 -------- .../tests/com/facebook/yoga/YogaNodeTest.java | 12 +++---- javascript/sources/YGEnums.js | 7 ++-- .../tests/Facebook.Yoga/YGPercentageTest.js | 32 ------------------- .../tests/Facebook.Yoga/YGRoundingTest.js | 26 --------------- tests/YGPercentageTest.cpp | 16 ---------- tests/YGRoundingMeasureFuncTest.cpp | 4 --- tests/YGRoundingTest.cpp | 13 -------- yoga/YGEnums.c | 2 -- yoga/YGEnums.h | 3 +- yoga/Yoga.c | 6 +--- 20 files changed, 48 insertions(+), 216 deletions(-) diff --git a/csharp/Facebook.Yoga/YogaExperimentalFeature.cs b/csharp/Facebook.Yoga/YogaExperimentalFeature.cs index 53a6524b..d6210367 100644 --- a/csharp/Facebook.Yoga/YogaExperimentalFeature.cs +++ b/csharp/Facebook.Yoga/YogaExperimentalFeature.cs @@ -11,7 +11,6 @@ namespace Facebook.Yoga { public enum YogaExperimentalFeature { - Rounding, WebFlexBasis, MinFlexFix, } diff --git a/csharp/tests/Facebook.Yoga/YGPercentageTest.cs b/csharp/tests/Facebook.Yoga/YGPercentageTest.cs index a861f320..fdf4d28e 100644 --- a/csharp/tests/Facebook.Yoga/YGPercentageTest.cs +++ b/csharp/tests/Facebook.Yoga/YGPercentageTest.cs @@ -21,7 +21,6 @@ namespace Facebook.Yoga public void Test_percentage_width_height() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -63,7 +62,6 @@ namespace Facebook.Yoga public void Test_percentage_position_left_top() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -107,7 +105,6 @@ namespace Facebook.Yoga public void Test_percentage_position_bottom_right() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -151,7 +148,6 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -208,7 +204,6 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_cross() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -264,7 +259,6 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_cross_min_height() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -320,7 +314,6 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_main_max_height() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -379,7 +372,6 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_cross_max_height() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -437,7 +429,6 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_main_max_width() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -496,7 +487,6 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_cross_max_width() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -554,7 +544,6 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_main_min_width() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -613,7 +602,6 @@ namespace Facebook.Yoga public void Test_percentage_flex_basis_cross_min_width() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -671,7 +659,6 @@ namespace Facebook.Yoga public void Test_percentage_multiple_nested_with_padding_margin_and_percentage_values() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -781,7 +768,6 @@ namespace Facebook.Yoga public void Test_percentage_margin_should_calculate_based_only_on_width() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -840,7 +826,6 @@ namespace Facebook.Yoga public void Test_percentage_padding_should_calculate_based_only_on_width() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Width = 200; @@ -899,7 +884,6 @@ namespace Facebook.Yoga public void Test_percentage_absolute_position() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Width = 200; diff --git a/csharp/tests/Facebook.Yoga/YGRoundingTest.cs b/csharp/tests/Facebook.Yoga/YGRoundingTest.cs index 8c82ce02..5074adc2 100644 --- a/csharp/tests/Facebook.Yoga/YGRoundingTest.cs +++ b/csharp/tests/Facebook.Yoga/YGRoundingTest.cs @@ -21,7 +21,6 @@ namespace Facebook.Yoga public void Test_rounding_flex_basis_flex_grow_row_width_of_100() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -90,7 +89,6 @@ namespace Facebook.Yoga public void Test_rounding_flex_basis_flex_grow_row_prime_number_width() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -187,7 +185,6 @@ namespace Facebook.Yoga public void Test_rounding_flex_basis_flex_shrink_row() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -257,7 +254,6 @@ namespace Facebook.Yoga public void Test_rounding_flex_basis_overrides_main_size() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -329,7 +325,6 @@ namespace Facebook.Yoga public void Test_rounding_total_fractial() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Width = 87.4f; @@ -401,7 +396,6 @@ namespace Facebook.Yoga public void Test_rounding_total_fractial_nested() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Width = 87.4f; @@ -507,7 +501,6 @@ namespace Facebook.Yoga public void Test_rounding_fractial_input_1() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -579,7 +572,6 @@ namespace Facebook.Yoga public void Test_rounding_fractial_input_2() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Width = 100; @@ -651,7 +643,6 @@ namespace Facebook.Yoga public void Test_rounding_fractial_input_3() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Top = 0.3f; @@ -724,7 +715,6 @@ namespace Facebook.Yoga public void Test_rounding_fractial_input_4() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Top = 0.7f; @@ -797,7 +787,6 @@ namespace Facebook.Yoga public void Test_rounding_inner_node_controversy_horizontal() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; @@ -883,7 +872,6 @@ namespace Facebook.Yoga public void Test_rounding_inner_node_controversy_vertical() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.Height = 320; @@ -968,7 +956,6 @@ namespace Facebook.Yoga public void Test_rounding_inner_node_controversy_combined() { YogaConfig config = new YogaConfig(); - config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(config); root.FlexDirection = YogaFlexDirection.Row; diff --git a/enums.py b/enums.py index 54c0d262..122df36b 100644 --- a/enums.py +++ b/enums.py @@ -92,7 +92,6 @@ ENUMS = { 'Verbose', ], 'ExperimentalFeature': [ - 'Rounding', # Mimic web flex-basis behavior. 'WebFlexBasis', 'MinFlexFix' @@ -145,7 +144,7 @@ with open(root + '/yoga/YGEnums.h', 'w') as f: f.write('#include "YGMacros.h"\n\n') f.write('YG_EXTERN_C_BEGIN\n\n') for name, values in sorted(ENUMS.items()): - f.write('#define YG%sCount %s\n' % (name, len(values))) + f.write('#define YG%sCount %s\n' % (name, len(values))) f.write('typedef YG_ENUM_BEGIN(YG%s) {\n' % name) for value in values: if isinstance(value, tuple): diff --git a/gentest/fixtures/YGPercentageTest.html b/gentest/fixtures/YGPercentageTest.html index 87b3c0a6..66b062c5 100644 --- a/gentest/fixtures/YGPercentageTest.html +++ b/gentest/fixtures/YGPercentageTest.html @@ -1,61 +1,61 @@ -
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -64,19 +64,19 @@
-
+
-
+
-
+
diff --git a/gentest/fixtures/YGRoundingTest.html b/gentest/fixtures/YGRoundingTest.html index 75062efe..c0cbc0d2 100644 --- a/gentest/fixtures/YGRoundingTest.html +++ b/gentest/fixtures/YGRoundingTest.html @@ -1,10 +1,10 @@ -
+
-
+
@@ -12,25 +12,25 @@
-
+
-
+
-
+
-
+
@@ -39,31 +39,31 @@
-
+
-
+
-
+
-
+
-
+
@@ -72,7 +72,7 @@
-
+
@@ -81,7 +81,7 @@
-
+
diff --git a/gentest/gentest.js b/gentest/gentest.js index c326541f..c69a09c6 100755 --- a/gentest/gentest.js +++ b/gentest/gentest.js @@ -431,11 +431,6 @@ function getRoundedSize(node) { function calculateTree(root, roundToPixelGrid) { var rootLayout = []; - // Any occurrence of "Rounding" mark during node tree traverse turns this feature on for whole subtree. - if ((root.getAttribute('experiments') || '').split(' ').indexOf('Rounding') != -1) { - roundToPixelGrid = true; - } - for (var i = 0; i < root.children.length; i++) { var child = root.children[i]; var layout = { @@ -453,11 +448,9 @@ function calculateTree(root, roundToPixelGrid) { : [], }; - if (roundToPixelGrid) { - var size = getRoundedSize(child); - layout.width = size.width; - layout.height = size.height; - } + var size = getRoundedSize(child); + layout.width = size.width; + layout.height = size.height; rootLayout.push(layout); } diff --git a/java/com/facebook/yoga/YogaExperimentalFeature.java b/java/com/facebook/yoga/YogaExperimentalFeature.java index 1ac1f9b3..178ece40 100644 --- a/java/com/facebook/yoga/YogaExperimentalFeature.java +++ b/java/com/facebook/yoga/YogaExperimentalFeature.java @@ -13,9 +13,8 @@ import com.facebook.proguard.annotations.DoNotStrip; @DoNotStrip public enum YogaExperimentalFeature { - ROUNDING(0), - WEB_FLEX_BASIS(1), - MIN_FLEX_FIX(2); + WEB_FLEX_BASIS(0), + MIN_FLEX_FIX(1); private int mIntValue; @@ -29,9 +28,8 @@ public enum YogaExperimentalFeature { public static YogaExperimentalFeature fromInt(int value) { switch (value) { - case 0: return ROUNDING; - case 1: return WEB_FLEX_BASIS; - case 2: return MIN_FLEX_FIX; + case 0: return WEB_FLEX_BASIS; + case 1: return MIN_FLEX_FIX; default: throw new IllegalArgumentException("Unknown enum value: " + value); } } diff --git a/java/tests/com/facebook/yoga/YGPercentageTest.java b/java/tests/com/facebook/yoga/YGPercentageTest.java index 88a19644..c75356de 100644 --- a/java/tests/com/facebook/yoga/YGPercentageTest.java +++ b/java/tests/com/facebook/yoga/YGPercentageTest.java @@ -19,7 +19,6 @@ public class YGPercentageTest { @Test public void test_percentage_width_height() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -60,7 +59,6 @@ public class YGPercentageTest { @Test public void test_percentage_position_left_top() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -103,7 +101,6 @@ public class YGPercentageTest { @Test public void test_percentage_position_bottom_right() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -146,7 +143,6 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -202,7 +198,6 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_cross() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setWidth(200f); @@ -257,7 +252,6 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_cross_min_height() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setWidth(200f); @@ -312,7 +306,6 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_main_max_height() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -370,7 +363,6 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_cross_max_height() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setWidth(200f); @@ -427,7 +419,6 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_main_max_width() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -485,7 +476,6 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_cross_max_width() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setWidth(200f); @@ -542,7 +532,6 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_main_min_width() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -600,7 +589,6 @@ public class YGPercentageTest { @Test public void test_percentage_flex_basis_cross_min_width() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setWidth(200f); @@ -657,7 +645,6 @@ public class YGPercentageTest { @Test public void test_percentage_multiple_nested_with_padding_margin_and_percentage_values() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setWidth(200f); @@ -766,7 +753,6 @@ public class YGPercentageTest { @Test public void test_percentage_margin_should_calculate_based_only_on_width() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setWidth(200f); @@ -824,7 +810,6 @@ public class YGPercentageTest { @Test public void test_percentage_padding_should_calculate_based_only_on_width() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setWidth(200f); @@ -882,7 +867,6 @@ public class YGPercentageTest { @Test public void test_percentage_absolute_position() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setWidth(200f); diff --git a/java/tests/com/facebook/yoga/YGRoundingTest.java b/java/tests/com/facebook/yoga/YGRoundingTest.java index 089a3957..c27eafbb 100644 --- a/java/tests/com/facebook/yoga/YGRoundingTest.java +++ b/java/tests/com/facebook/yoga/YGRoundingTest.java @@ -19,7 +19,6 @@ public class YGRoundingTest { @Test public void test_rounding_flex_basis_flex_grow_row_width_of_100() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -87,7 +86,6 @@ public class YGRoundingTest { @Test public void test_rounding_flex_basis_flex_grow_row_prime_number_width() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -183,7 +181,6 @@ public class YGRoundingTest { @Test public void test_rounding_flex_basis_flex_shrink_row() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -252,7 +249,6 @@ public class YGRoundingTest { @Test public void test_rounding_flex_basis_overrides_main_size() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setWidth(100f); @@ -323,7 +319,6 @@ public class YGRoundingTest { @Test public void test_rounding_total_fractial() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setWidth(87.4f); @@ -394,7 +389,6 @@ public class YGRoundingTest { @Test public void test_rounding_total_fractial_nested() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setWidth(87.4f); @@ -499,7 +493,6 @@ public class YGRoundingTest { @Test public void test_rounding_fractial_input_1() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setWidth(100f); @@ -570,7 +563,6 @@ public class YGRoundingTest { @Test public void test_rounding_fractial_input_2() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setWidth(100f); @@ -641,7 +633,6 @@ public class YGRoundingTest { @Test public void test_rounding_fractial_input_3() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setPosition(YogaEdge.TOP, 0.3f); @@ -713,7 +704,6 @@ public class YGRoundingTest { @Test public void test_rounding_fractial_input_4() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setPosition(YogaEdge.TOP, 0.7f); @@ -785,7 +775,6 @@ public class YGRoundingTest { @Test public void test_rounding_inner_node_controversy_horizontal() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setFlexDirection(YogaFlexDirection.ROW); @@ -870,7 +859,6 @@ public class YGRoundingTest { @Test public void test_rounding_inner_node_controversy_vertical() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setHeight(320f); @@ -954,7 +942,6 @@ public class YGRoundingTest { @Test public void test_rounding_inner_node_controversy_combined() { YogaConfig config = new YogaConfig(); - config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true); final YogaNode root = new YogaNode(config); root.setFlexDirection(YogaFlexDirection.ROW); diff --git a/java/tests/com/facebook/yoga/YogaNodeTest.java b/java/tests/com/facebook/yoga/YogaNodeTest.java index 6e773f57..95b0b56f 100644 --- a/java/tests/com/facebook/yoga/YogaNodeTest.java +++ b/java/tests/com/facebook/yoga/YogaNodeTest.java @@ -84,8 +84,8 @@ public class YogaNodeTest { } }); node.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); - assertEquals(100.5f, node.getLayoutWidth(), 0.0f); - assertEquals(100.5f, node.getLayoutHeight(), 0.0f); + assertEquals(101f, node.getLayoutWidth(), 0.01f); + assertEquals(101f, node.getLayoutHeight(), 0.01f); } @Test @@ -102,8 +102,8 @@ public class YogaNodeTest { } }); node.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); - assertEquals(Float.MIN_VALUE, node.getLayoutWidth(), 0.0f); - assertEquals(Float.MIN_VALUE, node.getLayoutHeight(), 0.0f); + assertEquals(Float.MIN_VALUE, node.getLayoutWidth(), 0.01f); + assertEquals(Float.MIN_VALUE, node.getLayoutHeight(), 0.01f); } @Test @@ -120,8 +120,8 @@ public class YogaNodeTest { } }); node.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); - assertEquals(Float.MAX_VALUE, node.getLayoutWidth(), 0.0f); - assertEquals(Float.MAX_VALUE, node.getLayoutHeight(), 0.0f); + assertEquals(Float.MAX_VALUE, node.getLayoutWidth(), 0.01f); + assertEquals(Float.MAX_VALUE, node.getLayoutHeight(), 0.01f); } private YogaLogLevel mLogLevel; diff --git a/javascript/sources/YGEnums.js b/javascript/sources/YGEnums.js index 9d1cb2c2..d4596827 100644 --- a/javascript/sources/YGEnums.js +++ b/javascript/sources/YGEnums.js @@ -43,10 +43,9 @@ module.exports = { EDGE_VERTICAL: 7, EDGE_ALL: 8, - EXPERIMENTAL_FEATURE_COUNT: 3, - EXPERIMENTAL_FEATURE_ROUNDING: 0, - EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 1, - EXPERIMENTAL_FEATURE_MIN_FLEX_FIX: 2, + EXPERIMENTAL_FEATURE_COUNT: 2, + EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 0, + EXPERIMENTAL_FEATURE_MIN_FLEX_FIX: 1, FLEX_DIRECTION_COUNT: 4, FLEX_DIRECTION_COLUMN: 0, diff --git a/javascript/tests/Facebook.Yoga/YGPercentageTest.js b/javascript/tests/Facebook.Yoga/YGPercentageTest.js index f94761aa..350bb48b 100644 --- a/javascript/tests/Facebook.Yoga/YGPercentageTest.js +++ b/javascript/tests/Facebook.Yoga/YGPercentageTest.js @@ -14,8 +14,6 @@ var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); it("percentage_width_height", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -60,8 +58,6 @@ it("percentage_width_height", function () { it("percentage_position_left_top", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -108,8 +104,6 @@ it("percentage_position_left_top", function () { it("percentage_position_bottom_right", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -156,8 +150,6 @@ it("percentage_position_bottom_right", function () { it("percentage_flex_basis", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -217,8 +209,6 @@ it("percentage_flex_basis", function () { it("percentage_flex_basis_cross", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setWidth(200); @@ -277,8 +267,6 @@ it("percentage_flex_basis_cross", function () { it("percentage_flex_basis_cross_min_height", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setWidth(200); @@ -337,8 +325,6 @@ it("percentage_flex_basis_cross_min_height", function () { it("percentage_flex_basis_main_max_height", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -400,8 +386,6 @@ it("percentage_flex_basis_main_max_height", function () { it("percentage_flex_basis_cross_max_height", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setWidth(200); @@ -462,8 +446,6 @@ it("percentage_flex_basis_cross_max_height", function () { it("percentage_flex_basis_main_max_width", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -525,8 +507,6 @@ it("percentage_flex_basis_main_max_width", function () { it("percentage_flex_basis_cross_max_width", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setWidth(200); @@ -587,8 +567,6 @@ it("percentage_flex_basis_cross_max_width", function () { it("percentage_flex_basis_main_min_width", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -650,8 +628,6 @@ it("percentage_flex_basis_main_min_width", function () { it("percentage_flex_basis_cross_min_width", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setWidth(200); @@ -712,8 +688,6 @@ it("percentage_flex_basis_cross_min_width", function () { it("percentage_multiple_nested_with_padding_margin_and_percentage_values", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setWidth(200); @@ -826,8 +800,6 @@ it("percentage_multiple_nested_with_padding_margin_and_percentage_values", funct it("percentage_margin_should_calculate_based_only_on_width", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setWidth(200); @@ -889,8 +861,6 @@ it("percentage_margin_should_calculate_based_only_on_width", function () { it("percentage_padding_should_calculate_based_only_on_width", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setWidth(200); @@ -952,8 +922,6 @@ it("percentage_padding_should_calculate_based_only_on_width", function () { it("percentage_absolute_position", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setWidth(200); diff --git a/javascript/tests/Facebook.Yoga/YGRoundingTest.js b/javascript/tests/Facebook.Yoga/YGRoundingTest.js index ab069ffb..c0eecc87 100644 --- a/javascript/tests/Facebook.Yoga/YGRoundingTest.js +++ b/javascript/tests/Facebook.Yoga/YGRoundingTest.js @@ -14,8 +14,6 @@ var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); it("rounding_flex_basis_flex_grow_row_width_of_100", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -87,8 +85,6 @@ it("rounding_flex_basis_flex_grow_row_width_of_100", function () { it("rounding_flex_basis_flex_grow_row_prime_number_width", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -188,8 +184,6 @@ it("rounding_flex_basis_flex_grow_row_prime_number_width", function () { it("rounding_flex_basis_flex_shrink_row", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -262,8 +256,6 @@ it("rounding_flex_basis_flex_shrink_row", function () { it("rounding_flex_basis_overrides_main_size", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setWidth(100); @@ -338,8 +330,6 @@ it("rounding_flex_basis_overrides_main_size", function () { it("rounding_total_fractial", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setWidth(87.4); @@ -414,8 +404,6 @@ it("rounding_total_fractial", function () { it("rounding_total_fractial_nested", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setWidth(87.4); @@ -524,8 +512,6 @@ it("rounding_total_fractial_nested", function () { it("rounding_fractial_input_1", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setWidth(100); @@ -600,8 +586,6 @@ it("rounding_fractial_input_1", function () { it("rounding_fractial_input_2", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setWidth(100); @@ -676,8 +660,6 @@ it("rounding_fractial_input_2", function () { it("rounding_fractial_input_3", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setPosition(Yoga.EDGE_TOP, 0.3); @@ -753,8 +735,6 @@ it("rounding_fractial_input_3", function () { it("rounding_fractial_input_4", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setPosition(Yoga.EDGE_TOP, 0.7); @@ -830,8 +810,6 @@ it("rounding_fractial_input_4", function () { it("rounding_inner_node_controversy_horizontal", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -920,8 +898,6 @@ it("rounding_inner_node_controversy_horizontal", function () { it("rounding_inner_node_controversy_vertical", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setHeight(320); @@ -1009,8 +985,6 @@ it("rounding_inner_node_controversy_vertical", function () { it("rounding_inner_node_controversy_combined", function () { var config = Yoga.Config.create(); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ROUNDING, true); - try { var root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); diff --git a/tests/YGPercentageTest.cpp b/tests/YGPercentageTest.cpp index 86ee8b78..3dbe951d 100644 --- a/tests/YGPercentageTest.cpp +++ b/tests/YGPercentageTest.cpp @@ -14,7 +14,6 @@ TEST(YogaTest, percentage_width_height) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -56,7 +55,6 @@ TEST(YogaTest, percentage_width_height) { TEST(YogaTest, percentage_position_left_top) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -100,7 +98,6 @@ TEST(YogaTest, percentage_position_left_top) { TEST(YogaTest, percentage_position_bottom_right) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -144,7 +141,6 @@ TEST(YogaTest, percentage_position_bottom_right) { TEST(YogaTest, percentage_flex_basis) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -201,7 +197,6 @@ TEST(YogaTest, percentage_flex_basis) { TEST(YogaTest, percentage_flex_basis_cross) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -257,7 +252,6 @@ TEST(YogaTest, percentage_flex_basis_cross) { TEST(YogaTest, percentage_flex_basis_cross_min_height) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -313,7 +307,6 @@ TEST(YogaTest, percentage_flex_basis_cross_min_height) { TEST(YogaTest, percentage_flex_basis_main_max_height) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -372,7 +365,6 @@ TEST(YogaTest, percentage_flex_basis_main_max_height) { TEST(YogaTest, percentage_flex_basis_cross_max_height) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -430,7 +422,6 @@ TEST(YogaTest, percentage_flex_basis_cross_max_height) { TEST(YogaTest, percentage_flex_basis_main_max_width) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -489,7 +480,6 @@ TEST(YogaTest, percentage_flex_basis_main_max_width) { TEST(YogaTest, percentage_flex_basis_cross_max_width) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -547,7 +537,6 @@ TEST(YogaTest, percentage_flex_basis_cross_max_width) { TEST(YogaTest, percentage_flex_basis_main_min_width) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -606,7 +595,6 @@ TEST(YogaTest, percentage_flex_basis_main_min_width) { TEST(YogaTest, percentage_flex_basis_cross_min_width) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -664,7 +652,6 @@ 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, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -774,7 +761,6 @@ 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, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -833,7 +819,6 @@ 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, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); @@ -892,7 +877,6 @@ TEST(YogaTest, percentage_padding_should_calculate_based_only_on_width) { TEST(YogaTest, percentage_absolute_position) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 200); diff --git a/tests/YGRoundingMeasureFuncTest.cpp b/tests/YGRoundingMeasureFuncTest.cpp index 02fb9362..b8558260 100644 --- a/tests/YGRoundingMeasureFuncTest.cpp +++ b/tests/YGRoundingMeasureFuncTest.cpp @@ -32,8 +32,6 @@ static YGSize _measureCeil(YGNodeRef node, TEST(YogaTest, rounding_feature_with_custom_measure_func_floor) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); - const YGNodeRef root = YGNodeNewWithConfig(config); const YGNodeRef root_child0 = YGNodeNewWithConfig(config); @@ -82,8 +80,6 @@ TEST(YogaTest, rounding_feature_with_custom_measure_func_floor) { TEST(YogaTest, rounding_feature_with_custom_measure_func_ceil) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); - const YGNodeRef root = YGNodeNewWithConfig(config); const YGNodeRef root_child0 = YGNodeNewWithConfig(config); diff --git a/tests/YGRoundingTest.cpp b/tests/YGRoundingTest.cpp index ed79f5c3..b3ec16b0 100644 --- a/tests/YGRoundingTest.cpp +++ b/tests/YGRoundingTest.cpp @@ -14,7 +14,6 @@ TEST(YogaTest, rounding_flex_basis_flex_grow_row_width_of_100) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -83,7 +82,6 @@ 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, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -180,7 +178,6 @@ 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, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -250,7 +247,6 @@ TEST(YogaTest, rounding_flex_basis_flex_shrink_row) { TEST(YogaTest, rounding_flex_basis_overrides_main_size) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -322,7 +318,6 @@ TEST(YogaTest, rounding_flex_basis_overrides_main_size) { TEST(YogaTest, rounding_total_fractial) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 87.4f); @@ -394,7 +389,6 @@ TEST(YogaTest, rounding_total_fractial) { TEST(YogaTest, rounding_total_fractial_nested) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 87.4f); @@ -500,7 +494,6 @@ TEST(YogaTest, rounding_total_fractial_nested) { TEST(YogaTest, rounding_fractial_input_1) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -572,7 +565,6 @@ TEST(YogaTest, rounding_fractial_input_1) { TEST(YogaTest, rounding_fractial_input_2) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetWidth(root, 100); @@ -644,7 +636,6 @@ TEST(YogaTest, rounding_fractial_input_2) { TEST(YogaTest, rounding_fractial_input_3) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPosition(root, YGEdgeTop, 0.3f); @@ -717,7 +708,6 @@ TEST(YogaTest, rounding_fractial_input_3) { TEST(YogaTest, rounding_fractial_input_4) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetPosition(root, YGEdgeTop, 0.7f); @@ -790,7 +780,6 @@ TEST(YogaTest, rounding_fractial_input_4) { TEST(YogaTest, rounding_inner_node_controversy_horizontal) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); @@ -876,7 +865,6 @@ TEST(YogaTest, rounding_inner_node_controversy_horizontal) { TEST(YogaTest, rounding_inner_node_controversy_vertical) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetHeight(root, 320); @@ -961,7 +949,6 @@ TEST(YogaTest, rounding_inner_node_controversy_vertical) { TEST(YogaTest, rounding_inner_node_controversy_combined) { const YGConfigRef config = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureRounding, true); const YGNodeRef root = YGNodeNewWithConfig(config); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); diff --git a/yoga/YGEnums.c b/yoga/YGEnums.c index 0108e6a6..c3e4521c 100644 --- a/yoga/YGEnums.c +++ b/yoga/YGEnums.c @@ -89,8 +89,6 @@ const char *YGEdgeToString(const YGEdge value){ const char *YGExperimentalFeatureToString(const YGExperimentalFeature value){ switch(value){ - case YGExperimentalFeatureRounding: - return "rounding"; case YGExperimentalFeatureWebFlexBasis: return "web-flex-basis"; case YGExperimentalFeatureMinFlexFix: diff --git a/yoga/YGEnums.h b/yoga/YGEnums.h index 8a929b9e..972c5210 100644 --- a/yoga/YGEnums.h +++ b/yoga/YGEnums.h @@ -62,9 +62,8 @@ typedef YG_ENUM_BEGIN(YGEdge) { } YG_ENUM_END(YGEdge); WIN_EXPORT const char *YGEdgeToString(const YGEdge value); -#define YGExperimentalFeatureCount 3 +#define YGExperimentalFeatureCount 2 typedef YG_ENUM_BEGIN(YGExperimentalFeature) { - YGExperimentalFeatureRounding, YGExperimentalFeatureWebFlexBasis, YGExperimentalFeatureMinFlexFix, } YG_ENUM_END(YGExperimentalFeature); diff --git a/yoga/Yoga.c b/yoga/Yoga.c index 12ec5c5c..2ec84287 100644 --- a/yoga/Yoga.c +++ b/yoga/Yoga.c @@ -202,7 +202,6 @@ static YGNode gYGNodeDefaults = { static YGConfig gYGConfigDefaults = { .experimentalFeatures = { - [YGExperimentalFeatureRounding] = false, [YGExperimentalFeatureMinFlexFix] = false, [YGExperimentalFeatureWebFlexBasis] = false, }, @@ -3386,10 +3385,7 @@ void YGNodeCalculateLayout(const YGNodeRef node, "initial", node->config)) { YGNodeSetPosition(node, node->layout.direction, parentWidth, parentHeight, parentWidth); - - if (YGConfigIsExperimentalFeatureEnabled(node->config, YGExperimentalFeatureRounding)) { - YGRoundToPixelGrid(node, node->config->pointScaleFactor, 0.0f, 0.0f); - } + YGRoundToPixelGrid(node, node->config->pointScaleFactor, 0.0f, 0.0f); if (gPrintTree) { YGNodePrint(node, YGPrintOptionsLayout | YGPrintOptionsChildren | YGPrintOptionsStyle);