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
This commit is contained in:
Emil Sjolander
2017-04-27 07:09:24 -07:00
committed by Facebook Github Bot
parent f6b17183c5
commit 3db38f2a80
20 changed files with 48 additions and 216 deletions

View File

@@ -11,7 +11,6 @@ namespace Facebook.Yoga
{
public enum YogaExperimentalFeature
{
Rounding,
WebFlexBasis,
MinFlexFix,
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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):

View File

@@ -1,61 +1,61 @@
<div id="percentage_width_height" experiments="Rounding" style="width: 200px; height: 200px; flex-direction: row;">
<div id="percentage_width_height" style="width: 200px; height: 200px; flex-direction: row;">
<div style="width: 30%; height: 30%;"></div>
</div>
<div id="percentage_position_left_top" experiments="Rounding" style="width: 400px; height: 400px; flex-direction: row;">
<div id="percentage_position_left_top" style="width: 400px; height: 400px; flex-direction: row;">
<div style="width: 45%; height: 55%; left: 10%; top: 20%"></div>
</div>
<div id="percentage_position_bottom_right" experiments="Rounding" style="width: 500px; height: 500px; flex-direction: row;">
<div id="percentage_position_bottom_right" style="width: 500px; height: 500px; flex-direction: row;">
<div style="width: 55%; height: 15%; bottom: 10%; right: 20%"></div>
</div>
<div id="percentage_flex_basis" experiments="Rounding" style="width: 200px; height: 200px; flex-direction: row;">
<div id="percentage_flex_basis" style="width: 200px; height: 200px; flex-direction: row;">
<div style="flex-grow: 1; flex-basis: 50%;"></div>
<div style="flex-grow: 1; flex-basis: 25%;"></div>
</div>
<div id="percentage_flex_basis_cross" experiments="Rounding" style="width: 200px; height: 200px; flex-direction: column;">
<div id="percentage_flex_basis_cross" style="width: 200px; height: 200px; flex-direction: column;">
<div style="flex-grow: 1; flex-basis: 50%;"></div>
<div style="flex-grow: 1; flex-basis: 25%;"></div>
</div>
<div id="percentage_flex_basis_cross_min_height" experiments="Rounding" style="width: 200px; height: 200px; flex-direction: column;">
<div id="percentage_flex_basis_cross_min_height" style="width: 200px; height: 200px; flex-direction: column;">
<div style="flex-grow: 1; min-height: 60%;"></div>
<div style="flex-grow: 2; min-height: 10%;"></div>
</div>
<div id="percentage_flex_basis_main_max_height" experiments="Rounding" style="width: 200px; height: 200px; flex-direction: row;">
<div id="percentage_flex_basis_main_max_height" style="width: 200px; height: 200px; flex-direction: row;">
<div style="flex-grow: 1; flex-basis: 10%; max-height: 60%;"></div>
<div style="flex-grow: 4; flex-basis: 10%; max-height: 20%;"></div>
</div>
<div id="percentage_flex_basis_cross_max_height" experiments="Rounding" style="width: 200px; height: 200px; flex-direction: column;">
<div id="percentage_flex_basis_cross_max_height" style="width: 200px; height: 200px; flex-direction: column;">
<div style="flex-grow: 1; flex-basis: 10%; max-height: 60%;"></div>
<div style="flex-grow: 4; flex-basis: 10%; max-height: 20%;"></div>
</div>
<div id="percentage_flex_basis_main_max_width" experiments="Rounding" style="width: 200px; height: 200px; flex-direction: row;">
<div id="percentage_flex_basis_main_max_width" style="width: 200px; height: 200px; flex-direction: row;">
<div style="flex-grow: 1; flex-basis: 15%; max-width: 60%;"></div>
<div style="flex-grow: 4; flex-basis: 10%; max-width: 20%;"></div>
</div>
<div id="percentage_flex_basis_cross_max_width" experiments="Rounding" style="width: 200px; height: 200px; flex-direction: column;">
<div id="percentage_flex_basis_cross_max_width" style="width: 200px; height: 200px; flex-direction: column;">
<div style="flex-grow: 1; flex-basis: 10%; max-width: 60%;"></div>
<div style="flex-grow: 4; flex-basis: 15%; max-width: 20%;"></div>
</div>
<div id="percentage_flex_basis_main_min_width" experiments="Rounding" style="width: 200px; height: 200px; flex-direction: row;">
<div id="percentage_flex_basis_main_min_width" style="width: 200px; height: 200px; flex-direction: row;">
<div style="flex-grow: 1; flex-basis: 15%; min-width: 60%;"></div>
<div style="flex-grow: 4; flex-basis: 10%; min-width: 20%;"></div>
</div>
<div id="percentage_flex_basis_cross_min_width" experiments="Rounding" style="width: 200px; height: 200px; flex-direction: column;">
<div id="percentage_flex_basis_cross_min_width" style="width: 200px; height: 200px; flex-direction: column;">
<div style="flex-grow: 1; flex-basis: 10%; min-width: 60%;"></div>
<div style="flex-grow: 4; flex-basis: 15%; min-width: 20%;"></div>
</div>
<div id="percentage_multiple_nested_with_padding_margin_and_percentage_values" experiments="Rounding" style="width: 200px; height: 200px; flex-direction: column;">
<div id="percentage_multiple_nested_with_padding_margin_and_percentage_values" style="width: 200px; height: 200px; flex-direction: column;">
<div style="flex-grow: 1; flex-basis: 10%; min-width: 60%; margin: 5px; padding: 3px;">
<div style="width: 50%; margin: 5px; padding: 3%;">
<div style="width: 45%; margin: 5%; padding: 3px;"></div>
@@ -64,19 +64,19 @@
<div style="flex-grow: 4; flex-basis: 15%; min-width: 20%;"></div>
</div>
<div id="percentage_margin_should_calculate_based_only_on_width" experiments="Rounding" style="width: 200px; height: 100px;">
<div id="percentage_margin_should_calculate_based_only_on_width" style="width: 200px; height: 100px;">
<div style="flex-grow: 1; margin: 10%;">
<div style="width: 10px; height: 10px;"></div>
</div>
</div>
<div id="percentage_padding_should_calculate_based_only_on_width" experiments="Rounding" style="width: 200px; height: 100px;">
<div id="percentage_padding_should_calculate_based_only_on_width" style="width: 200px; height: 100px;">
<div style="flex-grow: 1; padding: 10%;">
<div style="width: 10px; height: 10px;"></div>
</div>
</div>
<div id="percentage_absolute_position" experiments="Rounding" style="width: 200px; height: 100px;">
<div id="percentage_absolute_position" style="width: 200px; height: 100px;">
<div style="position: absolute; top: 10%; left: 30%; width: 10px; height: 10px;"></div>
</div>

View File

@@ -1,10 +1,10 @@
<div id="rounding_flex_basis_flex_grow_row_width_of_100" experiments="Rounding" style="width: 100px; height: 100px; flex-direction: row;">
<div id="rounding_flex_basis_flex_grow_row_width_of_100" style="width: 100px; height: 100px; flex-direction: row;">
<div style="flex-grow: 1;"></div>
<div style="flex-grow: 1;"></div>
<div style="flex-grow: 1;"></div>
</div>
<div id="rounding_flex_basis_flex_grow_row_prime_number_width" experiments="Rounding" style="width: 113px; height: 100px; flex-direction: row;">
<div id="rounding_flex_basis_flex_grow_row_prime_number_width" style="width: 113px; height: 100px; flex-direction: row;">
<div style="flex-grow: 1;"></div>
<div style="flex-grow: 1;"></div>
<div style="flex-grow: 1;"></div>
@@ -12,25 +12,25 @@
<div style="flex-grow: 1;"></div>
</div>
<div id="rounding_flex_basis_flex_shrink_row" experiments="Rounding" style="width: 101px; height: 100px; flex-direction: row;">
<div id="rounding_flex_basis_flex_shrink_row" style="width: 101px; height: 100px; flex-direction: row;">
<div style="flex-basis: 100px; flex-shrink: 1;"></div>
<div style="flex-basis: 25px;"></div>
<div style="flex-basis: 25px;"></div>
</div>
<div id="rounding_flex_basis_overrides_main_size" experiments="Rounding" style="height: 113px; width: 100px;">
<div id="rounding_flex_basis_overrides_main_size" style="height: 113px; width: 100px;">
<div style="height: 20px; flex-grow:1; flex-basis:50px;"></div>
<div style="height: 10px; flex-grow:1;"></div>
<div style="height: 10px; flex-grow:1;"></div>
</div>
<div id="rounding_total_fractial" experiments="Rounding" style="height: 113.4px; width: 87.4px;">
<div id="rounding_total_fractial" style="height: 113.4px; width: 87.4px;">
<div style="height: 20.3px; flex-grow:0.7; flex-basis:50.3px;"></div>
<div style="height: 10px; flex-grow:1.6;"></div>
<div style="height: 10.7px; flex-grow:1.1;"></div>
</div>
<div id="rounding_total_fractial_nested" experiments="Rounding" style="height: 113.4px; width: 87.4px;">
<div id="rounding_total_fractial_nested" style="height: 113.4px; width: 87.4px;">
<div style="height: 20.3px; flex-grow:0.7; flex-basis:50.3px;">
<div style="bottom: 13.3px; height: 9.9px; flex-grow:1; flex-basis:0.3px;"></div>
<div style="top: 13.3px; height: 1.1px; flex-grow:4; flex-basis:0.3px;"></div>
@@ -39,31 +39,31 @@
<div style="height: 10.7px; flex-grow:1.1;"></div>
</div>
<div id="rounding_fractial_input_1" experiments="Rounding" style="height: 113.4px; width: 100px;">
<div id="rounding_fractial_input_1" style="height: 113.4px; width: 100px;">
<div style="height: 20px; flex-grow:1; flex-basis:50px;"></div>
<div style="height: 10px; flex-grow:1;"></div>
<div style="height: 10px; flex-grow:1;"></div>
</div>
<div id="rounding_fractial_input_2" experiments="Rounding" style="height: 113.6px; width: 100px;">
<div id="rounding_fractial_input_2" style="height: 113.6px; width: 100px;">
<div style="height: 20px; flex-grow:1; flex-basis:50px;"></div>
<div style="height: 10px; flex-grow:1;"></div>
<div style="height: 10px; flex-grow:1;"></div>
</div>
<div id="rounding_fractial_input_3" experiments="Rounding" style="top: 0.3px; height: 113.4px; width: 100px;">
<div id="rounding_fractial_input_3" style="top: 0.3px; height: 113.4px; width: 100px;">
<div style="height: 20px; flex-grow:1; flex-basis:50px;"></div>
<div style="height: 10px; flex-grow:1;"></div>
<div style="height: 10px; flex-grow:1;"></div>
</div>
<div id="rounding_fractial_input_4" experiments="Rounding" style="top: 0.7px; height: 113.4px; width: 100px;">
<div id="rounding_fractial_input_4" style="top: 0.7px; height: 113.4px; width: 100px;">
<div style="height: 20px; flex-grow:1; flex-basis:50px;"></div>
<div style="height: 10px; flex-grow:1;"></div>
<div style="height: 10px; flex-grow:1;"></div>
</div>
<div id="rounding_inner_node_controversy_horizontal" experiments="Rounding" style="width: 320px; flex-direction: row;">
<div id="rounding_inner_node_controversy_horizontal" style="width: 320px; flex-direction: row;">
<div style="height: 10px; flex-grow:1;"></div>
<div style="height: 10px; flex-grow:1;">
<div style="height: 10px; flex-grow:1;">
@@ -72,7 +72,7 @@
<div style="height: 10px; flex-grow:1;"></div>
</div>
<div id="rounding_inner_node_controversy_vertical" experiments="Rounding" style="height: 320px;">
<div id="rounding_inner_node_controversy_vertical" style="height: 320px;">
<div style="width: 10px; flex-grow:1;"></div>
<div style="width: 10px; flex-grow:1;">
<div style="width: 10px; flex-grow:1;">
@@ -81,7 +81,7 @@
<div style="width: 10px; flex-grow:1;"></div>
</div>
<div id="rounding_inner_node_controversy_combined" experiments="Rounding" style="width: 640px; height: 320px; flex-direction: row;">
<div id="rounding_inner_node_controversy_combined" style="width: 640px; height: 320px; flex-direction: row;">
<div style="height: 100%; flex-grow:1;"></div>
<div style="height: 100%; flex-grow:1; flex-direction: column;">
<div style="width: 100%; flex-grow:1;"></div>

View File

@@ -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);
}

View File

@@ -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);
}
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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,

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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:

View File

@@ -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);

View File

@@ -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);