gentest support for position: static + initial test
Summary: I am about to embark on supporting `position: static` in Yoga. The enum exists already (and is the default position type, lol) but does not actually do anything and just behaves like `position: relative`. My approach here is to write a bunch of tests to test for the various behaviors of static positions and then develop on Yoga afterwards to get those tests passing. To do this, we need to make a few changes to the gentest files as there is not support for adding `position: static` at the moment: * Make it so that the gentest code can physically write `YGPositionTypeStatic` if it encounters `position: static` in the style * Make it so that gentest.js knows that Yoga's default is actually static. This way the code generated in the tests will actually label nodes for non default values * Explicitly label the position type even when it is not declared in the style prop (with the exception of the default) * Regenerate all the tests Additionally I added the first, basic test: making sure insets do nothing on a statically positioned element. Reviewed By: NickGerleman Differential Revision: D50437855 fbshipit-source-id: 0e8bbf1c224d477ea4592b7563d0b70d2ffa79c8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7e91004b90
commit
2ea4c043fd
@@ -33,6 +33,7 @@ test('absolute_layout_width_height_start_top', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
@@ -82,6 +83,7 @@ test('absolute_layout_width_height_end_bottom', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
@@ -131,6 +133,7 @@ test('absolute_layout_start_top_end_bottom', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
@@ -180,6 +183,7 @@ test('absolute_layout_width_height_start_top_end_bottom', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
@@ -232,6 +236,7 @@ test('do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_pare
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setOverflow(Overflow.Hidden);
|
||||
root.setWidth(50);
|
||||
root.setHeight(50);
|
||||
@@ -243,6 +248,7 @@ test('do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_pare
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(100);
|
||||
root_child0_child0.setHeight(100);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
@@ -295,6 +301,7 @@ test('absolute_layout_within_border', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.Left, 10);
|
||||
root.setMargin(Edge.Top, 10);
|
||||
root.setMargin(Edge.Right, 10);
|
||||
@@ -420,6 +427,7 @@ test('absolute_layout_align_items_and_justify_content_center', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexGrow(1);
|
||||
root.setWidth(110);
|
||||
root.setHeight(100);
|
||||
@@ -470,6 +478,7 @@ test('absolute_layout_align_items_and_justify_content_flex_end', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.FlexEnd);
|
||||
root.setAlignItems(Align.FlexEnd);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexGrow(1);
|
||||
root.setWidth(110);
|
||||
root.setHeight(100);
|
||||
@@ -519,6 +528,7 @@ test('absolute_layout_justify_content_center', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexGrow(1);
|
||||
root.setWidth(110);
|
||||
root.setHeight(100);
|
||||
@@ -568,6 +578,7 @@ test('absolute_layout_align_items_center', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexGrow(1);
|
||||
root.setWidth(110);
|
||||
root.setHeight(100);
|
||||
@@ -616,6 +627,7 @@ test('absolute_layout_align_items_center_on_child_only', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexGrow(1);
|
||||
root.setWidth(110);
|
||||
root.setHeight(100);
|
||||
@@ -667,6 +679,7 @@ test('absolute_layout_align_items_and_justify_content_center_and_top_position',
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexGrow(1);
|
||||
root.setWidth(110);
|
||||
root.setHeight(100);
|
||||
@@ -718,6 +731,7 @@ test('absolute_layout_align_items_and_justify_content_center_and_bottom_position
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexGrow(1);
|
||||
root.setWidth(110);
|
||||
root.setHeight(100);
|
||||
@@ -769,6 +783,7 @@ test('absolute_layout_align_items_and_justify_content_center_and_left_position',
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexGrow(1);
|
||||
root.setWidth(110);
|
||||
root.setHeight(100);
|
||||
@@ -820,6 +835,7 @@ test('absolute_layout_align_items_and_justify_content_center_and_right_position'
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexGrow(1);
|
||||
root.setWidth(110);
|
||||
root.setHeight(100);
|
||||
@@ -869,6 +885,7 @@ test('position_root_with_rtl_should_position_withoutdirection', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPosition(Edge.Left, 72);
|
||||
root.setWidth(52);
|
||||
root.setHeight(52);
|
||||
@@ -901,6 +918,7 @@ test('absolute_layout_percentage_bottom_based_on_parent_height', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(200);
|
||||
|
||||
@@ -983,6 +1001,7 @@ test('absolute_layout_in_wrap_reverse_column_container', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.WrapReverse);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
@@ -1032,6 +1051,7 @@ test('absolute_layout_in_wrap_reverse_row_container', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.WrapReverse);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
@@ -1080,6 +1100,7 @@ test('absolute_layout_in_wrap_reverse_column_container_flex_end', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.WrapReverse);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
@@ -1130,6 +1151,7 @@ test('absolute_layout_in_wrap_reverse_row_container_flex_end', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.WrapReverse);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
@@ -1179,9 +1201,11 @@ test('percent_absolute_position_infinite_height', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(300);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(300);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
@@ -1241,6 +1265,7 @@ test('absolute_layout_percentage_height_based_on_padded_parent', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPadding(Edge.Top, 10);
|
||||
root.setBorder(Edge.Top, 10);
|
||||
root.setWidth(100);
|
||||
@@ -1292,6 +1317,7 @@ test('absolute_layout_percentage_height_based_on_padded_parent_and_align_items_c
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Relative);
|
||||
root.setPadding(Edge.Top, 20);
|
||||
root.setPadding(Edge.Bottom, 20);
|
||||
root.setWidth(100);
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -33,10 +33,12 @@ test('align_items_stretch', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -79,10 +81,12 @@ test('align_items_center', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -126,10 +130,12 @@ test('align_items_flex_start', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.FlexStart);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -173,10 +179,12 @@ test('align_items_flex_end', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.FlexEnd);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -221,15 +229,18 @@ test('align_baseline', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -284,20 +295,24 @@ test('align_baseline_child', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -362,37 +377,44 @@ test('align_baseline_child_multiline', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexDirection(FlexDirection.Row);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexWrap(Wrap.Wrap);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(25);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(25);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child1_child1 = Yoga.Node.create(config);
|
||||
root_child1_child1.setPositionType(PositionType.Relative);
|
||||
root_child1_child1.setWidth(25);
|
||||
root_child1_child1.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child1, 1);
|
||||
|
||||
const root_child1_child2 = Yoga.Node.create(config);
|
||||
root_child1_child2.setPositionType(PositionType.Relative);
|
||||
root_child1_child2.setWidth(25);
|
||||
root_child1_child2.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child2, 2);
|
||||
|
||||
const root_child1_child3 = Yoga.Node.create(config);
|
||||
root_child1_child3.setPositionType(PositionType.Relative);
|
||||
root_child1_child3.setWidth(25);
|
||||
root_child1_child3.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child3, 3);
|
||||
@@ -487,39 +509,46 @@ test('align_baseline_child_multiline_override', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexDirection(FlexDirection.Row);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexWrap(Wrap.Wrap);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(25);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(25);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child1_child1 = Yoga.Node.create(config);
|
||||
root_child1_child1.setAlignSelf(Align.Baseline);
|
||||
root_child1_child1.setPositionType(PositionType.Relative);
|
||||
root_child1_child1.setWidth(25);
|
||||
root_child1_child1.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child1, 1);
|
||||
|
||||
const root_child1_child2 = Yoga.Node.create(config);
|
||||
root_child1_child2.setPositionType(PositionType.Relative);
|
||||
root_child1_child2.setWidth(25);
|
||||
root_child1_child2.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child2, 2);
|
||||
|
||||
const root_child1_child3 = Yoga.Node.create(config);
|
||||
root_child1_child3.setAlignSelf(Align.Baseline);
|
||||
root_child1_child3.setPositionType(PositionType.Relative);
|
||||
root_child1_child3.setWidth(25);
|
||||
root_child1_child3.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child3, 3);
|
||||
@@ -614,38 +643,45 @@ test('align_baseline_child_multiline_no_override_on_secondline', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexDirection(FlexDirection.Row);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexWrap(Wrap.Wrap);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(25);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(25);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child1_child1 = Yoga.Node.create(config);
|
||||
root_child1_child1.setPositionType(PositionType.Relative);
|
||||
root_child1_child1.setWidth(25);
|
||||
root_child1_child1.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child1, 1);
|
||||
|
||||
const root_child1_child2 = Yoga.Node.create(config);
|
||||
root_child1_child2.setPositionType(PositionType.Relative);
|
||||
root_child1_child2.setWidth(25);
|
||||
root_child1_child2.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child2, 2);
|
||||
|
||||
const root_child1_child3 = Yoga.Node.create(config);
|
||||
root_child1_child3.setAlignSelf(Align.Baseline);
|
||||
root_child1_child3.setPositionType(PositionType.Relative);
|
||||
root_child1_child3.setWidth(25);
|
||||
root_child1_child3.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child3, 3);
|
||||
@@ -740,21 +776,25 @@ test('align_baseline_child_top', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setPosition(Edge.Top, 10);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -819,21 +859,25 @@ test('align_baseline_child_top2', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setPosition(Edge.Top, 5);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -898,25 +942,30 @@ test('align_baseline_double_nested_child', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(50);
|
||||
root_child0_child0.setHeight(20);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(15);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -990,15 +1039,18 @@ test('align_baseline_column', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -1053,10 +1105,12 @@ test('align_baseline_child_margin', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Left, 5);
|
||||
root_child0.setMargin(Edge.Top, 5);
|
||||
root_child0.setMargin(Edge.Right, 5);
|
||||
@@ -1066,11 +1120,13 @@ test('align_baseline_child_margin', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setMargin(Edge.Left, 1);
|
||||
root_child1_child0.setMargin(Edge.Top, 1);
|
||||
root_child1_child0.setMargin(Edge.Right, 1);
|
||||
@@ -1139,6 +1195,7 @@ test('align_baseline_child_padding', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPadding(Edge.Left, 5);
|
||||
root.setPadding(Edge.Top, 5);
|
||||
root.setPadding(Edge.Right, 5);
|
||||
@@ -1147,11 +1204,13 @@ test('align_baseline_child_padding', () => {
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setPadding(Edge.Left, 5);
|
||||
root_child1.setPadding(Edge.Top, 5);
|
||||
root_child1.setPadding(Edge.Right, 5);
|
||||
@@ -1161,6 +1220,7 @@ test('align_baseline_child_padding', () => {
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -1225,36 +1285,43 @@ test('align_baseline_multiline', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child2_child0 = Yoga.Node.create(config);
|
||||
root_child2_child0.setPositionType(PositionType.Relative);
|
||||
root_child2_child0.setWidth(50);
|
||||
root_child2_child0.setHeight(10);
|
||||
root_child2.insertChild(root_child2_child0, 0);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -1348,36 +1415,43 @@ test.skip('align_baseline_multiline_column', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(20);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(40);
|
||||
root_child2.setHeight(70);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child2_child0 = Yoga.Node.create(config);
|
||||
root_child2_child0.setPositionType(PositionType.Relative);
|
||||
root_child2_child0.setWidth(10);
|
||||
root_child2_child0.setHeight(10);
|
||||
root_child2.insertChild(root_child2_child0, 0);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -1471,36 +1545,43 @@ test.skip('align_baseline_multiline_column2', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(20);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(40);
|
||||
root_child2.setHeight(70);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child2_child0 = Yoga.Node.create(config);
|
||||
root_child2_child0.setPositionType(PositionType.Relative);
|
||||
root_child2_child0.setWidth(10);
|
||||
root_child2_child0.setHeight(10);
|
||||
root_child2.insertChild(root_child2_child0, 0);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -1595,36 +1676,43 @@ test('align_baseline_multiline_row_and_column', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child2_child0 = Yoga.Node.create(config);
|
||||
root_child2_child0.setPositionType(PositionType.Relative);
|
||||
root_child2_child0.setWidth(50);
|
||||
root_child2_child0.setHeight(10);
|
||||
root_child2.insertChild(root_child2_child0, 0);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -1719,14 +1807,17 @@ test('align_items_center_child_with_margin_bigger_than_parent', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(52);
|
||||
root.setHeight(52);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignItems(Align.Center);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setMargin(Edge.Left, 10);
|
||||
root_child0_child0.setMargin(Edge.Right, 10);
|
||||
root_child0_child0.setWidth(52);
|
||||
@@ -1783,14 +1874,17 @@ test('align_items_flex_end_child_with_margin_bigger_than_parent', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(52);
|
||||
root.setHeight(52);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignItems(Align.FlexEnd);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setMargin(Edge.Left, 10);
|
||||
root_child0_child0.setMargin(Edge.Right, 10);
|
||||
root_child0_child0.setWidth(52);
|
||||
@@ -1847,14 +1941,17 @@ test('align_items_center_child_without_margin_bigger_than_parent', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(52);
|
||||
root.setHeight(52);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignItems(Align.Center);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(72);
|
||||
root_child0_child0.setHeight(72);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
@@ -1909,14 +2006,17 @@ test('align_items_flex_end_child_without_margin_bigger_than_parent', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(52);
|
||||
root.setHeight(52);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignItems(Align.FlexEnd);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(72);
|
||||
root_child0_child0.setHeight(72);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
@@ -1970,21 +2070,25 @@ test('align_center_should_size_based_on_content', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.Top, 20);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setJustifyContent(Justify.Center);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexShrink(1);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setWidth(20);
|
||||
root_child0_child0_child0.setHeight(20);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
@@ -2047,21 +2151,25 @@ test('align_stretch_should_size_based_on_parent', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.Top, 20);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setJustifyContent(Justify.Center);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexShrink(1);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setWidth(20);
|
||||
root_child0_child0_child0.setHeight(20);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
@@ -2124,19 +2232,23 @@ test('align_flex_start_with_shrinking_children', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(500);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignItems(Align.FlexStart);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0_child0.setFlexShrink(1);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
@@ -2199,18 +2311,22 @@ test('align_flex_start_with_stretching_children', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(500);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0_child0.setFlexShrink(1);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
@@ -2273,19 +2389,23 @@ test('align_flex_start_with_shrinking_children_with_stretch', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(500);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignItems(Align.FlexStart);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0_child0.setFlexShrink(1);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
|
@@ -33,11 +33,13 @@ test('align_self_center', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignSelf(Align.Center);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -80,11 +82,13 @@ test('align_self_flex_end', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignSelf(Align.FlexEnd);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -127,11 +131,13 @@ test('align_self_flex_start', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignSelf(Align.FlexStart);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -175,11 +181,13 @@ test('align_self_flex_end_override_flex_start', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.FlexStart);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignSelf(Align.FlexEnd);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -223,22 +231,26 @@ test('align_self_baseline', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignSelf(Align.Baseline);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setAlignSelf(Align.Baseline);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
@@ -34,23 +34,28 @@ test('android_news_feed', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignContent(Align.Stretch);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(1080);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setAlignContent(Align.Stretch);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0_child0_child0_child0.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child0_child0.setAlignItems(Align.FlexStart);
|
||||
root_child0_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0_child0.setMargin(Edge.Start, 36);
|
||||
root_child0_child0_child0_child0.setMargin(Edge.Top, 24);
|
||||
root_child0_child0_child0.insertChild(root_child0_child0_child0_child0, 0);
|
||||
@@ -58,16 +63,19 @@ test('android_news_feed', () => {
|
||||
const root_child0_child0_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0_child0_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0_child0_child0_child0_child0.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0_child0_child0_child0.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child0_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0_child0_child0_child0.setWidth(120);
|
||||
root_child0_child0_child0_child0_child0_child0.setHeight(120);
|
||||
root_child0_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0_child0_child1.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child0_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0_child0_child1.setFlexShrink(1);
|
||||
root_child0_child0_child0_child0_child1.setMargin(Edge.Right, 36);
|
||||
root_child0_child0_child0_child0_child1.setPadding(Edge.Left, 36);
|
||||
@@ -79,22 +87,26 @@ test('android_news_feed', () => {
|
||||
const root_child0_child0_child0_child0_child1_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0_child0_child1_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0_child0_child0_child0_child1_child0.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child0_child0_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0_child0_child1_child0.setFlexShrink(1);
|
||||
root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child0, 0);
|
||||
|
||||
const root_child0_child0_child0_child0_child1_child1 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0_child0_child1_child1.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child0_child0_child1_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0_child0_child1_child1.setFlexShrink(1);
|
||||
root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child1, 1);
|
||||
|
||||
const root_child0_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.insertChild(root_child0_child0_child1, 1);
|
||||
|
||||
const root_child0_child0_child1_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0_child0_child1_child0.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child1_child0.setAlignItems(Align.FlexStart);
|
||||
root_child0_child0_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child1_child0.setMargin(Edge.Start, 174);
|
||||
root_child0_child0_child1_child0.setMargin(Edge.Top, 24);
|
||||
root_child0_child0_child1.insertChild(root_child0_child0_child1_child0, 0);
|
||||
@@ -102,16 +114,19 @@ test('android_news_feed', () => {
|
||||
const root_child0_child0_child1_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1_child0_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0_child0_child1_child0_child0.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child1_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child1_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1_child0_child0_child0.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child1_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child1_child0_child0_child0.setWidth(72);
|
||||
root_child0_child0_child1_child0_child0_child0.setHeight(72);
|
||||
root_child0_child0_child1_child0_child0.insertChild(root_child0_child0_child1_child0_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child1_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1_child0_child1.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child1_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child1_child0_child1.setFlexShrink(1);
|
||||
root_child0_child0_child1_child0_child1.setMargin(Edge.Right, 36);
|
||||
root_child0_child0_child1_child0_child1.setPadding(Edge.Left, 36);
|
||||
@@ -123,11 +138,13 @@ test('android_news_feed', () => {
|
||||
const root_child0_child0_child1_child0_child1_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1_child0_child1_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0_child0_child1_child0_child1_child0.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child1_child0_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child1_child0_child1_child0.setFlexShrink(1);
|
||||
root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child0, 0);
|
||||
|
||||
const root_child0_child0_child1_child0_child1_child1 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1_child0_child1_child1.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child1_child0_child1_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child1_child0_child1_child1.setFlexShrink(1);
|
||||
root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
|
@@ -33,10 +33,12 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(300);
|
||||
root.setHeight(300);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setOverflow(Overflow.Scroll);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexShrink(1);
|
||||
@@ -45,9 +47,11 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setFlexGrow(2);
|
||||
root_child0_child0_child0.setFlexShrink(1);
|
||||
root_child0_child0_child0.setFlexBasis("0%");
|
||||
@@ -55,16 +59,19 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child1.setWidth(5);
|
||||
root_child0_child0.insertChild(root_child0_child0_child1, 1);
|
||||
|
||||
const root_child0_child0_child2 = Yoga.Node.create(config);
|
||||
root_child0_child0_child2.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child2.setFlexGrow(1);
|
||||
root_child0_child0_child2.setFlexShrink(1);
|
||||
root_child0_child0_child2.setFlexBasis("0%");
|
||||
root_child0_child0.insertChild(root_child0_child0_child2, 2);
|
||||
|
||||
const root_child0_child0_child2_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child2_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child2_child0.setFlexGrow(1);
|
||||
root_child0_child0_child2_child0.setFlexShrink(1);
|
||||
root_child0_child0_child2_child0.setFlexBasis("0%");
|
||||
@@ -72,10 +79,12 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {
|
||||
root_child0_child0_child2.insertChild(root_child0_child0_child2_child0, 0);
|
||||
|
||||
const root_child0_child0_child2_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child2_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child2_child0_child0.setWidth(5);
|
||||
root_child0_child0_child2_child0.insertChild(root_child0_child0_child2_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child2_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child0_child2_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child2_child0_child1.setFlexGrow(1);
|
||||
root_child0_child0_child2_child0_child1.setFlexShrink(1);
|
||||
root_child0_child0_child2_child0_child1.setFlexBasis("0%");
|
||||
@@ -95,28 +104,28 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {
|
||||
|
||||
expect(root_child0_child0.getComputedLeft()).toBe(0);
|
||||
expect(root_child0_child0.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0.getComputedWidth()).toBe(285);
|
||||
expect(root_child0_child0.getComputedHeight()).toBe(187);
|
||||
expect(root_child0_child0.getComputedWidth()).toBe(300);
|
||||
expect(root_child0_child0.getComputedHeight()).toBe(197);
|
||||
|
||||
expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
|
||||
expect(root_child0_child0_child0.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child0.getComputedWidth()).toBe(187);
|
||||
expect(root_child0_child0_child0.getComputedHeight()).toBe(187);
|
||||
expect(root_child0_child0_child0.getComputedWidth()).toBe(197);
|
||||
expect(root_child0_child0_child0.getComputedHeight()).toBe(197);
|
||||
|
||||
expect(root_child0_child0_child1.getComputedLeft()).toBe(187);
|
||||
expect(root_child0_child0_child1.getComputedLeft()).toBe(197);
|
||||
expect(root_child0_child0_child1.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child1.getComputedWidth()).toBe(5);
|
||||
expect(root_child0_child0_child1.getComputedHeight()).toBe(187);
|
||||
expect(root_child0_child0_child1.getComputedHeight()).toBe(197);
|
||||
|
||||
expect(root_child0_child0_child2.getComputedLeft()).toBe(192);
|
||||
expect(root_child0_child0_child2.getComputedLeft()).toBe(202);
|
||||
expect(root_child0_child0_child2.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child2.getComputedWidth()).toBe(93);
|
||||
expect(root_child0_child0_child2.getComputedHeight()).toBe(187);
|
||||
expect(root_child0_child0_child2.getComputedWidth()).toBe(98);
|
||||
expect(root_child0_child0_child2.getComputedHeight()).toBe(197);
|
||||
|
||||
expect(root_child0_child0_child2_child0.getComputedLeft()).toBe(0);
|
||||
expect(root_child0_child0_child2_child0.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(93);
|
||||
expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(187);
|
||||
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(98);
|
||||
expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(197);
|
||||
|
||||
expect(root_child0_child0_child2_child0_child0.getComputedLeft()).toBe(0);
|
||||
expect(root_child0_child0_child2_child0_child0.getComputedTop()).toBe(0);
|
||||
@@ -125,8 +134,8 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {
|
||||
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedLeft()).toBe(0);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(93);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(187);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(98);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(197);
|
||||
|
||||
root.calculateLayout(undefined, undefined, Direction.RTL);
|
||||
|
||||
@@ -140,40 +149,40 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {
|
||||
expect(root_child0.getComputedWidth()).toBe(300);
|
||||
expect(root_child0.getComputedHeight()).toBe(300);
|
||||
|
||||
expect(root_child0_child0.getComputedLeft()).toBe(30);
|
||||
expect(root_child0_child0.getComputedLeft()).toBe(0);
|
||||
expect(root_child0_child0.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0.getComputedWidth()).toBe(285);
|
||||
expect(root_child0_child0.getComputedHeight()).toBe(187);
|
||||
expect(root_child0_child0.getComputedWidth()).toBe(300);
|
||||
expect(root_child0_child0.getComputedHeight()).toBe(197);
|
||||
|
||||
expect(root_child0_child0_child0.getComputedLeft()).toBe(98);
|
||||
expect(root_child0_child0_child0.getComputedLeft()).toBe(103);
|
||||
expect(root_child0_child0_child0.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child0.getComputedWidth()).toBe(187);
|
||||
expect(root_child0_child0_child0.getComputedHeight()).toBe(187);
|
||||
expect(root_child0_child0_child0.getComputedWidth()).toBe(197);
|
||||
expect(root_child0_child0_child0.getComputedHeight()).toBe(197);
|
||||
|
||||
expect(root_child0_child0_child1.getComputedLeft()).toBe(93);
|
||||
expect(root_child0_child0_child1.getComputedLeft()).toBe(98);
|
||||
expect(root_child0_child0_child1.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child1.getComputedWidth()).toBe(5);
|
||||
expect(root_child0_child0_child1.getComputedHeight()).toBe(187);
|
||||
expect(root_child0_child0_child1.getComputedHeight()).toBe(197);
|
||||
|
||||
expect(root_child0_child0_child2.getComputedLeft()).toBe(0);
|
||||
expect(root_child0_child0_child2.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child2.getComputedWidth()).toBe(93);
|
||||
expect(root_child0_child0_child2.getComputedHeight()).toBe(187);
|
||||
expect(root_child0_child0_child2.getComputedWidth()).toBe(98);
|
||||
expect(root_child0_child0_child2.getComputedHeight()).toBe(197);
|
||||
|
||||
expect(root_child0_child0_child2_child0.getComputedLeft()).toBe(0);
|
||||
expect(root_child0_child0_child2_child0.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(93);
|
||||
expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(187);
|
||||
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(98);
|
||||
expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(197);
|
||||
|
||||
expect(root_child0_child0_child2_child0_child0.getComputedLeft()).toBe(88);
|
||||
expect(root_child0_child0_child2_child0_child0.getComputedLeft()).toBe(93);
|
||||
expect(root_child0_child0_child2_child0_child0.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child2_child0_child0.getComputedWidth()).toBe(5);
|
||||
expect(root_child0_child0_child2_child0_child0.getComputedHeight()).toBe(0);
|
||||
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedLeft()).toBe(0);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedTop()).toBe(0);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(93);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(187);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(98);
|
||||
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(197);
|
||||
} finally {
|
||||
if (typeof root !== 'undefined') {
|
||||
root.freeRecursive();
|
||||
|
@@ -33,6 +33,7 @@ test('border_no_size', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setBorder(Edge.Left, 10);
|
||||
root.setBorder(Edge.Top, 10);
|
||||
root.setBorder(Edge.Right, 10);
|
||||
@@ -66,12 +67,14 @@ test('border_container_match_child', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setBorder(Edge.Left, 10);
|
||||
root.setBorder(Edge.Top, 10);
|
||||
root.setBorder(Edge.Right, 10);
|
||||
root.setBorder(Edge.Bottom, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -114,6 +117,7 @@ test('border_flex_child', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setBorder(Edge.Left, 10);
|
||||
root.setBorder(Edge.Top, 10);
|
||||
root.setBorder(Edge.Right, 10);
|
||||
@@ -122,6 +126,7 @@ test('border_flex_child', () => {
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -164,6 +169,7 @@ test('border_stretch_child', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setBorder(Edge.Left, 10);
|
||||
root.setBorder(Edge.Top, 10);
|
||||
root.setBorder(Edge.Right, 10);
|
||||
@@ -172,6 +178,7 @@ test('border_stretch_child', () => {
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -215,6 +222,7 @@ test('border_center_child', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setBorder(Edge.Start, 10);
|
||||
root.setBorder(Edge.End, 20);
|
||||
root.setBorder(Edge.Bottom, 20);
|
||||
@@ -222,6 +230,7 @@ test('border_center_child', () => {
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
@@ -33,8 +33,10 @@ test('wrap_child', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(100);
|
||||
root_child0.setHeight(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -77,11 +79,14 @@ test('wrap_grandchild', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(100);
|
||||
root_child0_child0.setHeight(100);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
@@ -34,14 +34,17 @@ test('display_none', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setDisplay(Display.None);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -95,14 +98,17 @@ test('display_none_fixed_size', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root_child1.setHeight(20);
|
||||
root_child1.setDisplay(Display.None);
|
||||
@@ -157,10 +163,12 @@ test('display_none_with_margin', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Left, 10);
|
||||
root_child0.setMargin(Edge.Top, 10);
|
||||
root_child0.setMargin(Edge.Right, 10);
|
||||
@@ -171,6 +179,7 @@ test('display_none_with_margin', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -223,16 +232,19 @@ test('display_none_with_child', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexShrink(1);
|
||||
root_child0.setFlexBasis("0%");
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setFlexShrink(1);
|
||||
root_child1.setFlexBasis("0%");
|
||||
@@ -240,6 +252,7 @@ test('display_none_with_child', () => {
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setFlexGrow(1);
|
||||
root_child1_child0.setFlexShrink(1);
|
||||
root_child1_child0.setFlexBasis("0%");
|
||||
@@ -247,6 +260,7 @@ test('display_none_with_child', () => {
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root_child2.setFlexShrink(1);
|
||||
root_child2.setFlexBasis("0%");
|
||||
@@ -321,14 +335,17 @@ test('display_none_with_position', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setPosition(Edge.Top, 10);
|
||||
root_child1.setDisplay(Display.None);
|
||||
@@ -382,6 +399,7 @@ test('display_none_with_position_absolute', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
|
@@ -33,17 +33,21 @@ test('flex_direction_column_no_height', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -106,17 +110,21 @@ test('flex_direction_row_no_width', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -178,18 +186,22 @@ test('flex_direction_column', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -252,18 +264,22 @@ test('flex_direction_row', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -326,18 +342,22 @@ test('flex_direction_column_reverse', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.ColumnReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -400,18 +420,22 @@ test('flex_direction_row_reverse', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.RowReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -474,19 +498,23 @@ test('flex_direction_row_reverse_margin_left', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.RowReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.Left, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -549,19 +577,23 @@ test('flex_direction_row_reverse_margin_start', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.RowReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.Start, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -624,19 +656,23 @@ test('flex_direction_row_reverse_margin_right', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.RowReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.Right, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -699,19 +735,23 @@ test('flex_direction_row_reverse_margin_end', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.RowReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.End, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -774,19 +814,23 @@ test('flex_direction_column_reverse_margin_top', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.ColumnReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.Top, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -849,19 +893,23 @@ test('flex_direction_column_reverse_margin_bottom', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.ColumnReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.Bottom, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -924,19 +972,23 @@ test('flex_direction_row_reverse_padding_left', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.RowReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPadding(Edge.Left, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -999,19 +1051,23 @@ test('flex_direction_row_reverse_padding_start', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.RowReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPadding(Edge.Start, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1074,19 +1130,23 @@ test('flex_direction_row_reverse_padding_right', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.RowReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPadding(Edge.Right, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1149,19 +1209,23 @@ test('flex_direction_row_reverse_padding_end', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.RowReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPadding(Edge.End, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1224,19 +1288,23 @@ test('flex_direction_column_reverse_padding_top', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.ColumnReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPadding(Edge.Top, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1299,19 +1367,23 @@ test('flex_direction_column_reverse_padding_bottom', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.ColumnReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPadding(Edge.Bottom, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1374,19 +1446,23 @@ test('flex_direction_row_reverse_border_left', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.RowReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setBorder(Edge.Left, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1449,19 +1525,23 @@ test('flex_direction_row_reverse_border_start', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.RowReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setBorder(Edge.Start, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1524,19 +1604,23 @@ test('flex_direction_row_reverse_border_right', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.RowReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setBorder(Edge.Right, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1599,19 +1683,23 @@ test('flex_direction_row_reverse_border_end', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.RowReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setBorder(Edge.End, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1674,19 +1762,23 @@ test('flex_direction_column_reverse_border_top', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.ColumnReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setBorder(Edge.Top, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1749,19 +1841,23 @@ test('flex_direction_column_reverse_border_bottom', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.ColumnReverse);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setBorder(Edge.Bottom, 100);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1823,25 +1919,30 @@ test('flex_direction_row_reverse_pos_left', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.RowReverse);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setPosition(Edge.Left, 100);
|
||||
root_child0.setWidth(100);
|
||||
root_child0.setHeight(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
|
||||
const root_child0_child2 = Yoga.Node.create(config);
|
||||
root_child0_child2.setPositionType(PositionType.Relative);
|
||||
root_child0_child2.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1913,25 +2014,30 @@ test('flex_direction_row_reverse_pos_start', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.RowReverse);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setPosition(Edge.Start, 100);
|
||||
root_child0.setWidth(100);
|
||||
root_child0.setHeight(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
|
||||
const root_child0_child2 = Yoga.Node.create(config);
|
||||
root_child0_child2.setPositionType(PositionType.Relative);
|
||||
root_child0_child2.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -2003,25 +2109,30 @@ test('flex_direction_row_reverse_pos_right', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.RowReverse);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setPosition(Edge.Right, 100);
|
||||
root_child0.setWidth(100);
|
||||
root_child0.setHeight(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
|
||||
const root_child0_child2 = Yoga.Node.create(config);
|
||||
root_child0_child2.setPositionType(PositionType.Relative);
|
||||
root_child0_child2.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -2093,25 +2204,30 @@ test('flex_direction_row_reverse_pos_end', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.RowReverse);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setPosition(Edge.End, 100);
|
||||
root_child0.setWidth(100);
|
||||
root_child0.setHeight(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
|
||||
const root_child0_child2 = Yoga.Node.create(config);
|
||||
root_child0_child2.setPositionType(PositionType.Relative);
|
||||
root_child0_child2.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -2183,25 +2299,30 @@ test('flex_direction_column_reverse_pos_top', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.ColumnReverse);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setPosition(Edge.Top, 100);
|
||||
root_child0.setWidth(100);
|
||||
root_child0.setHeight(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
|
||||
const root_child0_child2 = Yoga.Node.create(config);
|
||||
root_child0_child2.setPositionType(PositionType.Relative);
|
||||
root_child0_child2.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -2273,25 +2394,30 @@ test('flex_direction_column_reverse_pos_bottom', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.ColumnReverse);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setPosition(Edge.Bottom, 100);
|
||||
root_child0.setWidth(100);
|
||||
root_child0.setHeight(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
|
||||
const root_child0_child2 = Yoga.Node.create(config);
|
||||
root_child0_child2.setPositionType(PositionType.Relative);
|
||||
root_child0_child2.setWidth(10);
|
||||
root_child0.insertChild(root_child0_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
|
@@ -33,15 +33,18 @@ test('flex_basis_flex_grow_column', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -94,16 +97,19 @@ test('flex_shrink_flex_grow_row', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(500);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexShrink(1);
|
||||
root_child0.setWidth(500);
|
||||
root_child0.setHeight(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexShrink(1);
|
||||
root_child1.setWidth(500);
|
||||
root_child1.setHeight(100);
|
||||
@@ -158,16 +164,19 @@ test('flex_shrink_flex_grow_child_flex_shrink_other_child', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(500);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexShrink(1);
|
||||
root_child0.setWidth(500);
|
||||
root_child0.setHeight(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setFlexShrink(1);
|
||||
root_child1.setWidth(500);
|
||||
@@ -223,15 +232,18 @@ test('flex_basis_flex_grow_row', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -283,15 +295,18 @@ test('flex_basis_flex_shrink_column', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexShrink(1);
|
||||
root_child0.setFlexBasis(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexBasis(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -344,15 +359,18 @@ test('flex_basis_flex_shrink_row', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexShrink(1);
|
||||
root_child0.setFlexBasis(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexBasis(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -404,20 +422,24 @@ test('flex_shrink_to_zero', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setHeight(75);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexShrink(1);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -480,21 +502,25 @@ test('flex_basis_overrides_main_size', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis(50);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -557,13 +583,16 @@ test('flex_grow_shrink_at_most', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
@@ -616,19 +645,23 @@ test('flex_grow_less_than_factor_one', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(0.2);
|
||||
root_child0.setFlexBasis(40);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(0.2);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(0.4);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
|
@@ -33,25 +33,30 @@ test('wrap_column', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(30);
|
||||
root_child0.setHeight(30);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(30);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(30);
|
||||
root_child2.setHeight(30);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(30);
|
||||
root_child3.setHeight(30);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -125,25 +130,30 @@ test('wrap_row', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(30);
|
||||
root_child0.setHeight(30);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(30);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(30);
|
||||
root_child2.setHeight(30);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(30);
|
||||
root_child3.setHeight(30);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -218,25 +228,30 @@ test('wrap_row_align_items_flex_end', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.FlexEnd);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(30);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(30);
|
||||
root_child2.setHeight(30);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(30);
|
||||
root_child3.setHeight(30);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -311,25 +326,30 @@ test('wrap_row_align_items_center', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(30);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(30);
|
||||
root_child2.setHeight(30);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(30);
|
||||
root_child3.setHeight(30);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -403,16 +423,19 @@ test('flex_wrap_children_with_min_main_overriding_flex_basis', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexBasis(50);
|
||||
root_child0.setMinWidth(55);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexBasis(50);
|
||||
root_child1.setMinWidth(55);
|
||||
root_child1.setHeight(50);
|
||||
@@ -466,23 +489,28 @@ test('flex_wrap_wrap_to_child_height', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0.setAlignItems(Align.FlexStart);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexWrap(Wrap.Wrap);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(100);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setWidth(100);
|
||||
root_child0_child0_child0.setHeight(100);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(100);
|
||||
root_child1.setHeight(100);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -556,15 +584,18 @@ test('flex_wrap_align_stretch_fits_one_row', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(150);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -617,30 +648,36 @@ test('wrap_reverse_row_align_content_flex_start', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.WrapReverse);
|
||||
root.setWidth(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(30);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(30);
|
||||
root_child2.setHeight(30);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(30);
|
||||
root_child3.setHeight(40);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setWidth(30);
|
||||
root_child4.setHeight(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
@@ -725,30 +762,36 @@ test('wrap_reverse_row_align_content_center', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignContent(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.WrapReverse);
|
||||
root.setWidth(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(30);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(30);
|
||||
root_child2.setHeight(30);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(30);
|
||||
root_child3.setHeight(40);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setWidth(30);
|
||||
root_child4.setHeight(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
@@ -832,30 +875,36 @@ test('wrap_reverse_row_single_line_different_size', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.WrapReverse);
|
||||
root.setWidth(300);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(30);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(30);
|
||||
root_child2.setHeight(30);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(30);
|
||||
root_child3.setHeight(40);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setWidth(30);
|
||||
root_child4.setHeight(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
@@ -940,30 +989,36 @@ test('wrap_reverse_row_align_content_stretch', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignContent(Align.Stretch);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.WrapReverse);
|
||||
root.setWidth(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(30);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(30);
|
||||
root_child2.setHeight(30);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(30);
|
||||
root_child3.setHeight(40);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setWidth(30);
|
||||
root_child4.setHeight(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
@@ -1048,30 +1103,36 @@ test('wrap_reverse_row_align_content_space_around', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignContent(Align.SpaceAround);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.WrapReverse);
|
||||
root.setWidth(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(30);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(30);
|
||||
root_child2.setHeight(30);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(30);
|
||||
root_child3.setHeight(40);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setWidth(30);
|
||||
root_child4.setHeight(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
@@ -1155,31 +1216,37 @@ test('wrap_reverse_column_fixed_size', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.WrapReverse);
|
||||
root.setWidth(200);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(30);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(30);
|
||||
root_child2.setHeight(30);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(30);
|
||||
root_child3.setHeight(40);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setWidth(30);
|
||||
root_child4.setHeight(50);
|
||||
root.insertChild(root_child4, 4);
|
||||
@@ -1263,20 +1330,24 @@ test('wrapped_row_within_align_items_center', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexWrap(Wrap.Wrap);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(150);
|
||||
root_child0_child0.setHeight(80);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setWidth(80);
|
||||
root_child0_child1.setHeight(80);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
@@ -1340,20 +1411,24 @@ test('wrapped_row_within_align_items_flex_start', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.FlexStart);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexWrap(Wrap.Wrap);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(150);
|
||||
root_child0_child0.setHeight(80);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setWidth(80);
|
||||
root_child0_child1.setHeight(80);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
@@ -1417,20 +1492,24 @@ test('wrapped_row_within_align_items_flex_end', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.FlexEnd);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexWrap(Wrap.Wrap);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(150);
|
||||
root_child0_child0.setHeight(80);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setWidth(80);
|
||||
root_child0_child1.setHeight(80);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
@@ -1496,17 +1575,20 @@ test('wrapped_column_max_height', () => {
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignContent(Align.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(700);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(100);
|
||||
root_child0.setHeight(500);
|
||||
root_child0.setMaxHeight(200);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setMargin(Edge.Left, 20);
|
||||
root_child1.setMargin(Edge.Top, 20);
|
||||
root_child1.setMargin(Edge.Right, 20);
|
||||
@@ -1516,6 +1598,7 @@ test('wrapped_column_max_height', () => {
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(100);
|
||||
root_child2.setHeight(100);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -1581,11 +1664,13 @@ test('wrapped_column_max_height_flex', () => {
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignContent(Align.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(700);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexShrink(1);
|
||||
root_child0.setFlexBasis("0%");
|
||||
@@ -1595,6 +1680,7 @@ test('wrapped_column_max_height_flex', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setFlexShrink(1);
|
||||
root_child1.setFlexBasis("0%");
|
||||
@@ -1607,6 +1693,7 @@ test('wrapped_column_max_height_flex', () => {
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(100);
|
||||
root_child2.setHeight(100);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -1669,28 +1756,34 @@ test('wrap_nodes_with_content_sizing_overflowing_margin', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(500);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexWrap(Wrap.Wrap);
|
||||
root_child0.setWidth(85);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setWidth(40);
|
||||
root_child0_child0_child0.setHeight(40);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setMargin(Edge.Right, 10);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
|
||||
const root_child0_child1_child0 = Yoga.Node.create(config);
|
||||
root_child0_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child1_child0.setWidth(40);
|
||||
root_child0_child1_child0.setHeight(40);
|
||||
root_child0_child1.insertChild(root_child0_child1_child0, 0);
|
||||
@@ -1773,28 +1866,34 @@ test('wrap_nodes_with_content_sizing_margin_cross', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(500);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexWrap(Wrap.Wrap);
|
||||
root_child0.setWidth(70);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setWidth(40);
|
||||
root_child0_child0_child0.setHeight(40);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setMargin(Edge.Top, 10);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
|
||||
const root_child0_child1_child0 = Yoga.Node.create(config);
|
||||
root_child0_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child1_child0.setWidth(40);
|
||||
root_child0_child1_child0.setHeight(40);
|
||||
root_child0_child1.insertChild(root_child0_child1_child0, 0);
|
||||
|
@@ -34,24 +34,28 @@ test('column_gap_flexible', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(80);
|
||||
root.setHeight(100);
|
||||
root.setGap(Gutter.Column, 10);
|
||||
root.setGap(Gutter.Row, 20);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexShrink(1);
|
||||
root_child0.setFlexBasis("0%");
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setFlexShrink(1);
|
||||
root_child1.setFlexBasis("0%");
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root_child2.setFlexShrink(1);
|
||||
root_child2.setFlexBasis("0%");
|
||||
@@ -116,19 +120,23 @@ test('column_gap_inflexible', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(80);
|
||||
root.setHeight(100);
|
||||
root.setGap(Gutter.Column, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -191,21 +199,25 @@ test('column_gap_mixed_flexible', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(80);
|
||||
root.setHeight(100);
|
||||
root.setGap(Gutter.Column, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setFlexShrink(1);
|
||||
root_child1.setFlexBasis("0%");
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -268,11 +280,13 @@ test('column_gap_child_margins', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(80);
|
||||
root.setHeight(100);
|
||||
root.setGap(Gutter.Column, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexShrink(1);
|
||||
root_child0.setFlexBasis("0%");
|
||||
@@ -281,6 +295,7 @@ test('column_gap_child_margins', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setFlexShrink(1);
|
||||
root_child1.setFlexBasis("0%");
|
||||
@@ -289,6 +304,7 @@ test('column_gap_child_margins', () => {
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root_child2.setFlexShrink(1);
|
||||
root_child2.setFlexBasis("0%");
|
||||
@@ -355,52 +371,62 @@ test('column_row_gap_wrapping', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(80);
|
||||
root.setGap(Gutter.Column, 10);
|
||||
root.setGap(Gutter.Row, 20);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root_child2.setHeight(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(20);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setWidth(20);
|
||||
root_child4.setHeight(20);
|
||||
root.insertChild(root_child4, 4);
|
||||
|
||||
const root_child5 = Yoga.Node.create(config);
|
||||
root_child5.setPositionType(PositionType.Relative);
|
||||
root_child5.setWidth(20);
|
||||
root_child5.setHeight(20);
|
||||
root.insertChild(root_child5, 5);
|
||||
|
||||
const root_child6 = Yoga.Node.create(config);
|
||||
root_child6.setPositionType(PositionType.Relative);
|
||||
root_child6.setWidth(20);
|
||||
root_child6.setHeight(20);
|
||||
root.insertChild(root_child6, 6);
|
||||
|
||||
const root_child7 = Yoga.Node.create(config);
|
||||
root_child7.setPositionType(PositionType.Relative);
|
||||
root_child7.setWidth(20);
|
||||
root_child7.setHeight(20);
|
||||
root.insertChild(root_child7, 7);
|
||||
|
||||
const root_child8 = Yoga.Node.create(config);
|
||||
root_child8.setPositionType(PositionType.Relative);
|
||||
root_child8.setWidth(20);
|
||||
root_child8.setHeight(20);
|
||||
root.insertChild(root_child8, 8);
|
||||
@@ -524,6 +550,7 @@ test('column_gap_start_index', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(80);
|
||||
root.setGap(Gutter.Column, 10);
|
||||
@@ -536,16 +563,19 @@ test('column_gap_start_index', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root_child2.setHeight(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(20);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -619,19 +649,23 @@ test('column_gap_justify_flex_start', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
root.setGap(Gutter.Column, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -695,19 +729,23 @@ test('column_gap_justify_center', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
root.setGap(Gutter.Column, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -771,19 +809,23 @@ test('column_gap_justify_flex_end', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setJustifyContent(Justify.FlexEnd);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
root.setGap(Gutter.Column, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -847,19 +889,23 @@ test('column_gap_justify_space_between', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setJustifyContent(Justify.SpaceBetween);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
root.setGap(Gutter.Column, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -923,19 +969,23 @@ test('column_gap_justify_space_around', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setJustifyContent(Justify.SpaceAround);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
root.setGap(Gutter.Column, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -999,19 +1049,23 @@ test('column_gap_justify_space_evenly', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setJustifyContent(Justify.SpaceEvenly);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
root.setGap(Gutter.Column, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1074,6 +1128,7 @@ test('column_gap_wrap_align_flex_start', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
@@ -1081,31 +1136,37 @@ test('column_gap_wrap_align_flex_start', () => {
|
||||
root.setGap(Gutter.Row, 20);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root_child2.setHeight(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(20);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setWidth(20);
|
||||
root_child4.setHeight(20);
|
||||
root.insertChild(root_child4, 4);
|
||||
|
||||
const root_child5 = Yoga.Node.create(config);
|
||||
root_child5.setPositionType(PositionType.Relative);
|
||||
root_child5.setWidth(20);
|
||||
root_child5.setHeight(20);
|
||||
root.insertChild(root_child5, 5);
|
||||
@@ -1200,6 +1261,7 @@ test('column_gap_wrap_align_center', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignContent(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
@@ -1207,31 +1269,37 @@ test('column_gap_wrap_align_center', () => {
|
||||
root.setGap(Gutter.Row, 20);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root_child2.setHeight(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(20);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setWidth(20);
|
||||
root_child4.setHeight(20);
|
||||
root.insertChild(root_child4, 4);
|
||||
|
||||
const root_child5 = Yoga.Node.create(config);
|
||||
root_child5.setPositionType(PositionType.Relative);
|
||||
root_child5.setWidth(20);
|
||||
root_child5.setHeight(20);
|
||||
root.insertChild(root_child5, 5);
|
||||
@@ -1326,6 +1394,7 @@ test('column_gap_wrap_align_flex_end', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignContent(Align.FlexEnd);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
@@ -1333,31 +1402,37 @@ test('column_gap_wrap_align_flex_end', () => {
|
||||
root.setGap(Gutter.Row, 20);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root_child2.setHeight(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(20);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setWidth(20);
|
||||
root_child4.setHeight(20);
|
||||
root.insertChild(root_child4, 4);
|
||||
|
||||
const root_child5 = Yoga.Node.create(config);
|
||||
root_child5.setPositionType(PositionType.Relative);
|
||||
root_child5.setWidth(20);
|
||||
root_child5.setHeight(20);
|
||||
root.insertChild(root_child5, 5);
|
||||
@@ -1452,6 +1527,7 @@ test('column_gap_wrap_align_space_between', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignContent(Align.SpaceBetween);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
@@ -1459,31 +1535,37 @@ test('column_gap_wrap_align_space_between', () => {
|
||||
root.setGap(Gutter.Row, 20);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root_child2.setHeight(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(20);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setWidth(20);
|
||||
root_child4.setHeight(20);
|
||||
root.insertChild(root_child4, 4);
|
||||
|
||||
const root_child5 = Yoga.Node.create(config);
|
||||
root_child5.setPositionType(PositionType.Relative);
|
||||
root_child5.setWidth(20);
|
||||
root_child5.setHeight(20);
|
||||
root.insertChild(root_child5, 5);
|
||||
@@ -1578,6 +1660,7 @@ test('column_gap_wrap_align_space_around', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignContent(Align.SpaceAround);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
@@ -1585,31 +1668,37 @@ test('column_gap_wrap_align_space_around', () => {
|
||||
root.setGap(Gutter.Row, 20);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root_child2.setHeight(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(20);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setWidth(20);
|
||||
root_child4.setHeight(20);
|
||||
root.insertChild(root_child4, 4);
|
||||
|
||||
const root_child5 = Yoga.Node.create(config);
|
||||
root_child5.setPositionType(PositionType.Relative);
|
||||
root_child5.setWidth(20);
|
||||
root_child5.setHeight(20);
|
||||
root.insertChild(root_child5, 5);
|
||||
@@ -1704,32 +1793,38 @@ test('column_gap_wrap_align_stretch', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignContent(Align.Stretch);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(300);
|
||||
root.setHeight(300);
|
||||
root.setGap(Gutter.Column, 5);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setMinWidth(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setMinWidth(60);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root_child2.setMinWidth(60);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setFlexGrow(1);
|
||||
root_child3.setMinWidth(60);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setFlexGrow(1);
|
||||
root_child4.setMinWidth(60);
|
||||
root.insertChild(root_child4, 4);
|
||||
@@ -1813,18 +1908,22 @@ test('column_gap_determines_parent_width', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setHeight(100);
|
||||
root.setGap(Gutter.Column, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(30);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1888,6 +1987,7 @@ test('row_gap_align_items_stretch', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignContent(Align.Stretch);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(200);
|
||||
@@ -1895,26 +1995,32 @@ test('row_gap_align_items_stretch', () => {
|
||||
root.setGap(Gutter.Row, 20);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setWidth(20);
|
||||
root.insertChild(root_child4, 4);
|
||||
|
||||
const root_child5 = Yoga.Node.create(config);
|
||||
root_child5.setPositionType(PositionType.Relative);
|
||||
root_child5.setWidth(20);
|
||||
root.insertChild(root_child5, 5);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -2008,6 +2114,7 @@ test('row_gap_align_items_end', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.FlexEnd);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(200);
|
||||
@@ -2015,26 +2122,32 @@ test('row_gap_align_items_end', () => {
|
||||
root.setGap(Gutter.Row, 20);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setWidth(20);
|
||||
root.insertChild(root_child4, 4);
|
||||
|
||||
const root_child5 = Yoga.Node.create(config);
|
||||
root_child5.setPositionType(PositionType.Relative);
|
||||
root_child5.setWidth(20);
|
||||
root.insertChild(root_child5, 5);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -2126,11 +2239,13 @@ test('row_gap_column_child_margins', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(200);
|
||||
root.setGap(Gutter.Row, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexShrink(1);
|
||||
root_child0.setFlexBasis("0%");
|
||||
@@ -2139,6 +2254,7 @@ test('row_gap_column_child_margins', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setFlexShrink(1);
|
||||
root_child1.setFlexBasis("0%");
|
||||
@@ -2147,6 +2263,7 @@ test('row_gap_column_child_margins', () => {
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root_child2.setFlexShrink(1);
|
||||
root_child2.setFlexBasis("0%");
|
||||
@@ -2213,24 +2330,28 @@ test('row_gap_row_wrap_child_margins', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(200);
|
||||
root.setGap(Gutter.Row, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Top, 2);
|
||||
root_child0.setMargin(Edge.Bottom, 2);
|
||||
root_child0.setWidth(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setMargin(Edge.Top, 10);
|
||||
root_child1.setMargin(Edge.Bottom, 10);
|
||||
root_child1.setWidth(60);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setMargin(Edge.Top, 15);
|
||||
root_child2.setMargin(Edge.Bottom, 15);
|
||||
root_child2.setWidth(60);
|
||||
@@ -2294,18 +2415,22 @@ test('row_gap_determines_parent_height', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setGap(Gutter.Row, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setHeight(30);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
|
@@ -34,18 +34,22 @@ test('justify_content_row_flex_start', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(102);
|
||||
root.setHeight(102);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -109,18 +113,22 @@ test('justify_content_row_flex_end', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setJustifyContent(Justify.FlexEnd);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(102);
|
||||
root.setHeight(102);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -184,18 +192,22 @@ test('justify_content_row_center', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(102);
|
||||
root.setHeight(102);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -259,18 +271,22 @@ test('justify_content_row_space_between', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setJustifyContent(Justify.SpaceBetween);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(102);
|
||||
root.setHeight(102);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -334,18 +350,22 @@ test('justify_content_row_space_around', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setJustifyContent(Justify.SpaceAround);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(102);
|
||||
root.setHeight(102);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -407,18 +427,22 @@ test('justify_content_column_flex_start', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(102);
|
||||
root.setHeight(102);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -481,18 +505,22 @@ test('justify_content_column_flex_end', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.FlexEnd);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(102);
|
||||
root.setHeight(102);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -555,18 +583,22 @@ test('justify_content_column_center', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(102);
|
||||
root.setHeight(102);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -629,18 +661,22 @@ test('justify_content_column_space_between', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.SpaceBetween);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(102);
|
||||
root.setHeight(102);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -703,18 +739,22 @@ test('justify_content_column_space_around', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.SpaceAround);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(102);
|
||||
root.setHeight(102);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -778,10 +818,12 @@ test('justify_content_row_min_width_and_margin', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.Left, 100);
|
||||
root.setMinWidth(50);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -826,11 +868,13 @@ test('justify_content_row_max_width_and_margin', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.Left, 100);
|
||||
root.setWidth(100);
|
||||
root.setMaxWidth(80);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -874,10 +918,12 @@ test('justify_content_column_min_height_and_margin', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.Top, 100);
|
||||
root.setMinHeight(50);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -921,11 +967,13 @@ test('justify_content_colunn_max_height_and_margin', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.Top, 100);
|
||||
root.setHeight(100);
|
||||
root.setMaxHeight(80);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(20);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -969,18 +1017,22 @@ test('justify_content_column_space_evenly', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.SpaceEvenly);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(102);
|
||||
root.setHeight(102);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1044,18 +1096,22 @@ test('justify_content_row_space_evenly', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setJustifyContent(Justify.SpaceEvenly);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(102);
|
||||
root.setHeight(102);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1118,18 +1174,21 @@ test('justify_content_min_width_with_padding_child_width_greater_than_parent', (
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignContent(Align.Stretch);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(1000);
|
||||
root.setHeight(1584);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0.setAlignContent(Align.Stretch);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0_child0.setJustifyContent(Justify.Center);
|
||||
root_child0_child0.setAlignContent(Align.Stretch);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setPadding(Edge.Left, 100);
|
||||
root_child0_child0.setPadding(Edge.Right, 100);
|
||||
root_child0_child0.setMinWidth(400);
|
||||
@@ -1138,6 +1197,7 @@ test('justify_content_min_width_with_padding_child_width_greater_than_parent', (
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0_child0_child0.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setWidth(300);
|
||||
root_child0_child0_child0.setHeight(100);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
@@ -1201,18 +1261,21 @@ test('justify_content_min_width_with_padding_child_width_lower_than_parent', ()
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignContent(Align.Stretch);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(1080);
|
||||
root.setHeight(1584);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0.setAlignContent(Align.Stretch);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0_child0.setJustifyContent(Justify.Center);
|
||||
root_child0_child0.setAlignContent(Align.Stretch);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setPadding(Edge.Left, 100);
|
||||
root_child0_child0.setPadding(Edge.Right, 100);
|
||||
root_child0_child0.setMinWidth(400);
|
||||
@@ -1221,6 +1284,7 @@ test('justify_content_min_width_with_padding_child_width_lower_than_parent', ()
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0_child0_child0.setAlignContent(Align.Stretch);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setWidth(199);
|
||||
root_child0_child0_child0.setHeight(100);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
@@ -1284,20 +1348,24 @@ test('justify_content_space_between_indefinite_container_dim_with_free_space', (
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(300);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0.setJustifyContent(Justify.SpaceBetween);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMinWidth(200);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(50);
|
||||
root_child0_child0.setHeight(50);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setWidth(50);
|
||||
root_child0_child1.setHeight(50);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
|
@@ -34,10 +34,12 @@ test('margin_start', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Start, 10);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -80,10 +82,12 @@ test('margin_top', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Top, 10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -128,10 +132,12 @@ test('margin_end', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setJustifyContent(Justify.FlexEnd);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.End, 10);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -175,10 +181,12 @@ test('margin_bottom', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.FlexEnd);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Bottom, 10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -222,10 +230,12 @@ test('margin_and_flex_row', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setMargin(Edge.Start, 10);
|
||||
root_child0.setMargin(Edge.End, 10);
|
||||
@@ -269,10 +279,12 @@ test('margin_and_flex_column', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setMargin(Edge.Top, 10);
|
||||
root_child0.setMargin(Edge.Bottom, 10);
|
||||
@@ -317,10 +329,12 @@ test('margin_and_stretch_row', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setMargin(Edge.Top, 10);
|
||||
root_child0.setMargin(Edge.Bottom, 10);
|
||||
@@ -364,10 +378,12 @@ test('margin_and_stretch_column', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setMargin(Edge.Start, 10);
|
||||
root_child0.setMargin(Edge.End, 10);
|
||||
@@ -412,15 +428,18 @@ test('margin_with_sibling_row', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setMargin(Edge.End, 10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -472,15 +491,18 @@ test('margin_with_sibling_column', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setMargin(Edge.Bottom, 10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -533,16 +555,19 @@ test('margin_auto_bottom', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Bottom, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -596,16 +621,19 @@ test('margin_auto_top', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Top, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -659,10 +687,12 @@ test('margin_auto_bottom_and_top', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Top, 'auto');
|
||||
root_child0.setMargin(Edge.Bottom, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
@@ -670,6 +700,7 @@ test('margin_auto_bottom_and_top', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -723,10 +754,12 @@ test('margin_auto_bottom_and_top_justify_center', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Top, 'auto');
|
||||
root_child0.setMargin(Edge.Bottom, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
@@ -734,6 +767,7 @@ test('margin_auto_bottom_and_top_justify_center', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -787,22 +821,26 @@ test('margin_auto_mutiple_children_column', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Top, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setMargin(Edge.Top, 'auto');
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -867,22 +905,26 @@ test('margin_auto_mutiple_children_row', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Right, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setMargin(Edge.Right, 'auto');
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -947,10 +989,12 @@ test('margin_auto_left_and_right_column', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Left, 'auto');
|
||||
root_child0.setMargin(Edge.Right, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
@@ -958,6 +1002,7 @@ test('margin_auto_left_and_right_column', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -1010,10 +1055,12 @@ test('margin_auto_left_and_right', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Left, 'auto');
|
||||
root_child0.setMargin(Edge.Right, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
@@ -1021,6 +1068,7 @@ test('margin_auto_left_and_right', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -1075,10 +1123,12 @@ test('margin_auto_start_and_end_column', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Start, 'auto');
|
||||
root_child0.setMargin(Edge.End, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
@@ -1086,6 +1136,7 @@ test('margin_auto_start_and_end_column', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -1138,10 +1189,12 @@ test('margin_auto_start_and_end', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Start, 'auto');
|
||||
root_child0.setMargin(Edge.End, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
@@ -1149,6 +1202,7 @@ test('margin_auto_start_and_end', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -1202,10 +1256,12 @@ test('margin_auto_left_and_right_column_and_center', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Left, 'auto');
|
||||
root_child0.setMargin(Edge.Right, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
@@ -1213,6 +1269,7 @@ test('margin_auto_left_and_right_column_and_center', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -1266,16 +1323,19 @@ test('margin_auto_left', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Left, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -1329,16 +1389,19 @@ test('margin_auto_right', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Right, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -1392,10 +1455,12 @@ test('margin_auto_left_and_right_stretch', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Left, 'auto');
|
||||
root_child0.setMargin(Edge.Right, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
@@ -1403,6 +1468,7 @@ test('margin_auto_left_and_right_stretch', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -1455,10 +1521,12 @@ test('margin_auto_top_and_bottom_stretch', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Top, 'auto');
|
||||
root_child0.setMargin(Edge.Bottom, 'auto');
|
||||
root_child0.setWidth(50);
|
||||
@@ -1466,6 +1534,7 @@ test('margin_auto_top_and_bottom_stretch', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -1518,10 +1587,12 @@ test('margin_should_not_be_part_of_max_height', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(250);
|
||||
root.setHeight(250);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Top, 20);
|
||||
root_child0.setWidth(100);
|
||||
root_child0.setHeight(100);
|
||||
@@ -1566,10 +1637,12 @@ test('margin_should_not_be_part_of_max_width', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(250);
|
||||
root.setHeight(250);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Left, 20);
|
||||
root_child0.setWidth(100);
|
||||
root_child0.setMaxWidth(100);
|
||||
@@ -1615,10 +1688,12 @@ test('margin_auto_left_right_child_bigger_than_parent', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(52);
|
||||
root.setHeight(52);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Left, 'auto');
|
||||
root_child0.setMargin(Edge.Right, 'auto');
|
||||
root_child0.setWidth(72);
|
||||
@@ -1664,10 +1739,12 @@ test('margin_auto_left_child_bigger_than_parent', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(52);
|
||||
root.setHeight(52);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Left, 'auto');
|
||||
root_child0.setWidth(72);
|
||||
root_child0.setHeight(72);
|
||||
@@ -1712,10 +1789,12 @@ test('margin_fix_left_auto_right_child_bigger_than_parent', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(52);
|
||||
root.setHeight(52);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Left, 10);
|
||||
root_child0.setMargin(Edge.Right, 'auto');
|
||||
root_child0.setWidth(72);
|
||||
@@ -1761,10 +1840,12 @@ test('margin_auto_left_fix_right_child_bigger_than_parent', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(52);
|
||||
root.setHeight(52);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Left, 'auto');
|
||||
root_child0.setMargin(Edge.Right, 10);
|
||||
root_child0.setWidth(72);
|
||||
@@ -1810,10 +1891,12 @@ test('margin_auto_top_stretching_child', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexShrink(1);
|
||||
root_child0.setFlexBasis("0%");
|
||||
@@ -1821,6 +1904,7 @@ test('margin_auto_top_stretching_child', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -1874,10 +1958,12 @@ test('margin_auto_left_stretching_child', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexShrink(1);
|
||||
root_child0.setFlexBasis("0%");
|
||||
@@ -1885,6 +1971,7 @@ test('margin_auto_left_stretching_child', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
@@ -33,10 +33,12 @@ test('max_width', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMaxWidth(50);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -80,10 +82,12 @@ test('max_height', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setMaxHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -126,15 +130,18 @@ test.skip('min_height', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setMinHeight(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -187,15 +194,18 @@ test.skip('min_width', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setMinWidth(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -248,11 +258,13 @@ test('justify_content_min_max', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setMinHeight(100);
|
||||
root.setMaxHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(60);
|
||||
root_child0.setHeight(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -296,11 +308,13 @@ test('align_items_min_max', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMinWidth(100);
|
||||
root.setMaxWidth(200);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(60);
|
||||
root_child0.setHeight(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -344,20 +358,24 @@ test('justify_content_overflow_min_max', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMinHeight(100);
|
||||
root.setMaxHeight(110);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(50);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -420,16 +438,19 @@ test('flex_grow_to_min', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setMinHeight(100);
|
||||
root.setMaxHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexShrink(1);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -483,14 +504,17 @@ test('flex_grow_in_at_most_container', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.FlexStart);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexBasis(0);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
@@ -544,8 +568,10 @@ test('flex_grow_child', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis(0);
|
||||
root_child0.setHeight(100);
|
||||
@@ -589,14 +615,17 @@ test('flex_grow_within_constrained_min_max_column', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMinHeight(100);
|
||||
root.setMaxHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -648,15 +677,18 @@ test('flex_grow_within_max_width', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMaxWidth(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setHeight(20);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
@@ -709,15 +741,18 @@ test('flex_grow_within_constrained_max_width', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMaxWidth(300);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setHeight(20);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
@@ -770,17 +805,20 @@ test('flex_root_ignored', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexGrow(1);
|
||||
root.setWidth(100);
|
||||
root.setMinHeight(100);
|
||||
root.setMaxHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis(200);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(100);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -832,22 +870,26 @@ test('flex_grow_root_minimized', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setMinHeight(100);
|
||||
root.setMaxHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setMinHeight(100);
|
||||
root_child0.setMaxHeight(500);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexBasis(200);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setHeight(100);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -909,21 +951,25 @@ test('flex_grow_height_maximized', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setMinHeight(100);
|
||||
root_child0.setMaxHeight(500);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexBasis(200);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setHeight(100);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -986,14 +1032,17 @@ test('flex_grow_within_constrained_min_row', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMinWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1045,13 +1094,16 @@ test('flex_grow_within_constrained_min_column', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMinHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1103,20 +1155,24 @@ test('flex_grow_within_constrained_max_row', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMaxWidth(100);
|
||||
root_child0.setHeight(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
root_child0_child0.setFlexBasis(100);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setWidth(50);
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1178,15 +1234,18 @@ test('flex_grow_within_constrained_max_column', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setMaxHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexShrink(1);
|
||||
root_child0.setFlexBasis(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1239,16 +1298,19 @@ test('child_min_max_width_flexing', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(120);
|
||||
root.setHeight(50);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis(0);
|
||||
root_child0.setMinWidth(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setFlexBasis("50%");
|
||||
root_child1.setMaxWidth(20);
|
||||
@@ -1302,6 +1364,7 @@ test('min_width_overrides_width', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(50);
|
||||
root.setMinWidth(100);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1333,6 +1396,7 @@ test('max_width_overrides_width', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setMaxWidth(100);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1364,6 +1428,7 @@ test('min_height_overrides_height', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setHeight(50);
|
||||
root.setMinHeight(100);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1395,6 +1460,7 @@ test('max_height_overrides_height', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setHeight(200);
|
||||
root.setMaxHeight(100);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1427,10 +1493,12 @@ test('min_max_percent_no_width_height', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.FlexStart);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMinWidth("10%");
|
||||
root_child0.setMaxWidth("10%");
|
||||
root_child0.setMinHeight("10%");
|
||||
|
@@ -33,6 +33,7 @@ test('padding_no_size', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPadding(Edge.Left, 10);
|
||||
root.setPadding(Edge.Top, 10);
|
||||
root.setPadding(Edge.Right, 10);
|
||||
@@ -66,12 +67,14 @@ test('padding_container_match_child', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPadding(Edge.Left, 10);
|
||||
root.setPadding(Edge.Top, 10);
|
||||
root.setPadding(Edge.Right, 10);
|
||||
root.setPadding(Edge.Bottom, 10);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -114,6 +117,7 @@ test('padding_flex_child', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPadding(Edge.Left, 10);
|
||||
root.setPadding(Edge.Top, 10);
|
||||
root.setPadding(Edge.Right, 10);
|
||||
@@ -122,6 +126,7 @@ test('padding_flex_child', () => {
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -164,6 +169,7 @@ test('padding_stretch_child', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPadding(Edge.Left, 10);
|
||||
root.setPadding(Edge.Top, 10);
|
||||
root.setPadding(Edge.Right, 10);
|
||||
@@ -172,6 +178,7 @@ test('padding_stretch_child', () => {
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -215,6 +222,7 @@ test('padding_center_child', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPadding(Edge.Start, 10);
|
||||
root.setPadding(Edge.End, 20);
|
||||
root.setPadding(Edge.Bottom, 20);
|
||||
@@ -222,6 +230,7 @@ test('padding_center_child', () => {
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -266,10 +275,12 @@ test('child_with_padding_align_end', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.FlexEnd);
|
||||
root.setAlignItems(Align.FlexEnd);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setPadding(Edge.Left, 20);
|
||||
root_child0.setPadding(Edge.Top, 20);
|
||||
root_child0.setPadding(Edge.Right, 20);
|
||||
|
@@ -34,10 +34,12 @@ test('percentage_width_height', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth("30%");
|
||||
root_child0.setHeight("30%");
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -81,10 +83,12 @@ test('percentage_position_left_top', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(400);
|
||||
root.setHeight(400);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setPosition(Edge.Left, "10%");
|
||||
root_child0.setPosition(Edge.Top, "20%");
|
||||
root_child0.setWidth("45%");
|
||||
@@ -130,10 +134,12 @@ test('percentage_position_bottom_right', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(500);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setPosition(Edge.Right, "20%");
|
||||
root_child0.setPosition(Edge.Bottom, "10%");
|
||||
root_child0.setWidth("55%");
|
||||
@@ -179,15 +185,18 @@ test('percentage_flex_basis', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis("50%");
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setFlexBasis("25%");
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -240,15 +249,18 @@ test('percentage_flex_basis_cross', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis("50%");
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setFlexBasis("25%");
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -301,15 +313,18 @@ test.skip('percentage_flex_basis_cross_min_height', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setMinHeight("60%");
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(2);
|
||||
root_child1.setMinHeight("10%");
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -363,16 +378,19 @@ test('percentage_flex_basis_main_max_height', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis("10%");
|
||||
root_child0.setMaxHeight("60%");
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(4);
|
||||
root_child1.setFlexBasis("10%");
|
||||
root_child1.setMaxHeight("20%");
|
||||
@@ -426,16 +444,19 @@ test('percentage_flex_basis_cross_max_height', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis("10%");
|
||||
root_child0.setMaxHeight("60%");
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(4);
|
||||
root_child1.setFlexBasis("10%");
|
||||
root_child1.setMaxHeight("20%");
|
||||
@@ -490,16 +511,19 @@ test('percentage_flex_basis_main_max_width', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis("15%");
|
||||
root_child0.setMaxWidth("60%");
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(4);
|
||||
root_child1.setFlexBasis("10%");
|
||||
root_child1.setMaxWidth("20%");
|
||||
@@ -553,16 +577,19 @@ test('percentage_flex_basis_cross_max_width', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis("10%");
|
||||
root_child0.setMaxWidth("60%");
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(4);
|
||||
root_child1.setFlexBasis("15%");
|
||||
root_child1.setMaxWidth("20%");
|
||||
@@ -617,16 +644,19 @@ test('percentage_flex_basis_main_min_width', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis("15%");
|
||||
root_child0.setMinWidth("60%");
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(4);
|
||||
root_child1.setFlexBasis("10%");
|
||||
root_child1.setMinWidth("20%");
|
||||
@@ -680,16 +710,19 @@ test('percentage_flex_basis_cross_min_width', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis("10%");
|
||||
root_child0.setMinWidth("60%");
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(4);
|
||||
root_child1.setFlexBasis("15%");
|
||||
root_child1.setMinWidth("20%");
|
||||
@@ -743,10 +776,12 @@ test('percentage_multiple_nested_with_padding_margin_and_percentage_values', ()
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis("10%");
|
||||
root_child0.setMargin(Edge.Left, 5);
|
||||
@@ -761,6 +796,7 @@ test('percentage_multiple_nested_with_padding_margin_and_percentage_values', ()
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setMargin(Edge.Left, 5);
|
||||
root_child0_child0.setMargin(Edge.Top, 5);
|
||||
root_child0_child0.setMargin(Edge.Right, 5);
|
||||
@@ -773,6 +809,7 @@ test('percentage_multiple_nested_with_padding_margin_and_percentage_values', ()
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setMargin(Edge.Left, "5%");
|
||||
root_child0_child0_child0.setMargin(Edge.Top, "5%");
|
||||
root_child0_child0_child0.setMargin(Edge.Right, "5%");
|
||||
@@ -785,6 +822,7 @@ test('percentage_multiple_nested_with_padding_margin_and_percentage_values', ()
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(4);
|
||||
root_child1.setFlexBasis("15%");
|
||||
root_child1.setMinWidth("20%");
|
||||
@@ -858,10 +896,12 @@ test('percentage_margin_should_calculate_based_only_on_width', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setMargin(Edge.Left, "10%");
|
||||
root_child0.setMargin(Edge.Top, "10%");
|
||||
@@ -870,6 +910,7 @@ test('percentage_margin_should_calculate_based_only_on_width', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(10);
|
||||
root_child0_child0.setHeight(10);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
@@ -922,10 +963,12 @@ test('percentage_padding_should_calculate_based_only_on_width', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setPadding(Edge.Left, "10%");
|
||||
root_child0.setPadding(Edge.Top, "10%");
|
||||
@@ -934,6 +977,7 @@ test('percentage_padding_should_calculate_based_only_on_width', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(10);
|
||||
root_child0_child0.setHeight(10);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
@@ -986,6 +1030,7 @@ test('percentage_absolute_position', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(100);
|
||||
|
||||
@@ -1035,8 +1080,10 @@ test('percentage_width_height_undefined_parent_size', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth("50%");
|
||||
root_child0.setHeight("50%");
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -1080,22 +1127,27 @@ test('percent_within_flex_grow', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(350);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth("100%");
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(100);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -1169,24 +1221,29 @@ test('percentage_container_in_wrapping_container', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(200);
|
||||
root.setHeight(200);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setFlexDirection(FlexDirection.Row);
|
||||
root_child0_child0.setJustifyContent(Justify.Center);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth("100%");
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setWidth(50);
|
||||
root_child0_child0_child0.setHeight(50);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child1.setWidth(50);
|
||||
root_child0_child0_child1.setHeight(50);
|
||||
root_child0_child0.insertChild(root_child0_child0_child1, 1);
|
||||
@@ -1259,6 +1316,7 @@ test('percent_absolute_position', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(60);
|
||||
root.setHeight(50);
|
||||
|
||||
@@ -1271,10 +1329,12 @@ test('percent_absolute_position', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth("100%");
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setWidth("100%");
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
|
@@ -34,18 +34,22 @@ test('rounding_flex_basis_flex_grow_row_width_of_100', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -108,26 +112,32 @@ test('rounding_flex_basis_flex_grow_row_prime_number_width', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(113);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setFlexGrow(1);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
||||
const root_child4 = Yoga.Node.create(config);
|
||||
root_child4.setPositionType(PositionType.Relative);
|
||||
root_child4.setFlexGrow(1);
|
||||
root.insertChild(root_child4, 4);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -210,19 +220,23 @@ test('rounding_flex_basis_flex_shrink_row', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(101);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexShrink(1);
|
||||
root_child0.setFlexBasis(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexBasis(25);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexBasis(25);
|
||||
root.insertChild(root_child2, 2);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -284,21 +298,25 @@ test('rounding_flex_basis_overrides_main_size', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(113);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis(50);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -361,21 +379,25 @@ test('rounding_total_fractial', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(87.4);
|
||||
root.setHeight(113.4);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(0.7);
|
||||
root_child0.setFlexBasis(50.3);
|
||||
root_child0.setHeight(20.3);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1.6);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1.1);
|
||||
root_child2.setHeight(10.7);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -438,16 +460,19 @@ test('rounding_total_fractial_nested', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(87.4);
|
||||
root.setHeight(113.4);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(0.7);
|
||||
root_child0.setFlexBasis(50.3);
|
||||
root_child0.setHeight(20.3);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexBasis(0.3);
|
||||
root_child0_child0.setPosition(Edge.Bottom, 13.3);
|
||||
@@ -455,6 +480,7 @@ test('rounding_total_fractial_nested', () => {
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child1.setPositionType(PositionType.Relative);
|
||||
root_child0_child1.setFlexGrow(4);
|
||||
root_child0_child1.setFlexBasis(0.3);
|
||||
root_child0_child1.setPosition(Edge.Top, 13.3);
|
||||
@@ -462,11 +488,13 @@ test('rounding_total_fractial_nested', () => {
|
||||
root_child0.insertChild(root_child0_child1, 1);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1.6);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1.1);
|
||||
root_child2.setHeight(10.7);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -549,21 +577,25 @@ test('rounding_fractial_input_1', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(113.4);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis(50);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -626,21 +658,25 @@ test('rounding_fractial_input_2', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(113.6);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis(50);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -703,22 +739,26 @@ test('rounding_fractial_input_3', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPosition(Edge.Top, 0.3);
|
||||
root.setWidth(100);
|
||||
root.setHeight(113.4);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis(50);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -781,22 +821,26 @@ test('rounding_fractial_input_4', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPosition(Edge.Top, 0.7);
|
||||
root.setWidth(100);
|
||||
root.setHeight(113.4);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setFlexBasis(50);
|
||||
root_child0.setHeight(20);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -860,24 +904,29 @@ test('rounding_inner_node_controversy_horizontal', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(320);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setHeight(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setFlexGrow(1);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root_child2.setHeight(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -950,24 +999,29 @@ test('rounding_inner_node_controversy_vertical', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setHeight(320);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setWidth(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setWidth(10);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setFlexGrow(1);
|
||||
root_child1_child0.setWidth(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root_child2.setWidth(10);
|
||||
root.insertChild(root_child2, 2);
|
||||
@@ -1041,40 +1095,48 @@ test('rounding_inner_node_controversy_combined', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(640);
|
||||
root.setHeight(320);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexGrow(1);
|
||||
root_child0.setHeight("100%");
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexGrow(1);
|
||||
root_child1.setHeight("100%");
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setFlexGrow(1);
|
||||
root_child1_child0.setWidth("100%");
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child1_child1 = Yoga.Node.create(config);
|
||||
root_child1_child1.setPositionType(PositionType.Relative);
|
||||
root_child1_child1.setFlexGrow(1);
|
||||
root_child1_child1.setWidth("100%");
|
||||
root_child1.insertChild(root_child1_child1, 1);
|
||||
|
||||
const root_child1_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child1_child0.setFlexGrow(1);
|
||||
root_child1_child1_child0.setWidth("100%");
|
||||
root_child1_child1.insertChild(root_child1_child1_child0, 0);
|
||||
|
||||
const root_child1_child2 = Yoga.Node.create(config);
|
||||
root_child1_child2.setPositionType(PositionType.Relative);
|
||||
root_child1_child2.setFlexGrow(1);
|
||||
root_child1_child2.setWidth("100%");
|
||||
root_child1.insertChild(root_child1_child2, 2);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setFlexGrow(1);
|
||||
root_child2.setHeight("100%");
|
||||
root.insertChild(root_child2, 2);
|
||||
|
@@ -33,13 +33,16 @@ test('nested_overflowing_child', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(200);
|
||||
root_child0_child0.setHeight(200);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
@@ -92,15 +95,18 @@ test('nested_overflowing_child_in_constraint_parent', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(100);
|
||||
root_child0.setHeight(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(200);
|
||||
root_child0_child0.setHeight(200);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
@@ -153,14 +159,17 @@ test('parent_wrap_child_size_overflowing_parent', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(100);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(100);
|
||||
root_child0_child0.setHeight(200);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
60
javascript/tests/generated/YGStaticPositionTest.test.ts
Normal file
60
javascript/tests/generated/YGStaticPositionTest.test.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// @generated by gentest/gentest.rb from gentest/fixtures/YGStaticPositionTest.html
|
||||
|
||||
import {Yoga} from "../tools/globals";
|
||||
import {
|
||||
Align,
|
||||
Direction,
|
||||
Display,
|
||||
Edge,
|
||||
Errata,
|
||||
ExperimentalFeature,
|
||||
FlexDirection,
|
||||
Gutter,
|
||||
Justify,
|
||||
MeasureMode,
|
||||
Overflow,
|
||||
PositionType,
|
||||
Unit,
|
||||
Wrap,
|
||||
} from 'yoga-layout';
|
||||
|
||||
test.skip('static_position_insets_have_no_effect', () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true);
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPosition(Edge.Left, 50);
|
||||
root.setPosition(Edge.Top, 50);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
|
||||
expect(root.getComputedLeft()).toBe(0);
|
||||
expect(root.getComputedTop()).toBe(0);
|
||||
expect(root.getComputedWidth()).toBe(100);
|
||||
expect(root.getComputedHeight()).toBe(100);
|
||||
|
||||
root.calculateLayout(undefined, undefined, Direction.RTL);
|
||||
|
||||
expect(root.getComputedLeft()).toBe(0);
|
||||
expect(root.getComputedTop()).toBe(0);
|
||||
expect(root.getComputedWidth()).toBe(100);
|
||||
expect(root.getComputedHeight()).toBe(100);
|
||||
} finally {
|
||||
if (typeof root !== 'undefined') {
|
||||
root.freeRecursive();
|
||||
}
|
||||
|
||||
config.free();
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user