Files
yoga/tests/java/com/facebook/csslayout/LayoutEngineTest.java

9907 lines
333 KiB
Java
Raw Normal View History

/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
2014-09-18 15:15:21 -07:00
package com.facebook.csslayout;
import org.junit.Assert;
import org.junit.Test;
import static com.facebook.csslayout.CSSLayout.POSITION_LEFT;
import static com.facebook.csslayout.CSSLayout.POSITION_TOP;
import static com.facebook.csslayout.CSSLayout.POSITION_RIGHT;
import static com.facebook.csslayout.CSSLayout.POSITION_BOTTOM;
import static com.facebook.csslayout.CSSLayout.DIMENSION_WIDTH;
import static com.facebook.csslayout.CSSLayout.DIMENSION_HEIGHT;
2014-09-18 15:15:21 -07:00
/**
* Tests for {@link LayoutEngine}
*/
public class LayoutEngineTest {
private static final CSSNode.MeasureFunction sTestMeasureFunction =
new CSSNode.MeasureFunction() {
2014-09-18 15:15:21 -07:00
@Override
2016-01-06 16:56:56 +00:00
public void measure(CSSNode node, float width, CSSMeasureMode widthMode, float height, CSSMeasureMode heightMode, MeasureOutput measureOutput) {
2014-09-18 15:15:21 -07:00
TestCSSNode testNode = (TestCSSNode) node;
if (testNode.context.equals(TestConstants.SMALL_TEXT)) {
2016-01-06 16:56:56 +00:00
if (widthMode == CSSMeasureMode.UNDEFINED) {
width = 10000000;
}
2014-09-18 15:15:21 -07:00
measureOutput.width = Math.min(width, TestConstants.SMALL_WIDTH);
measureOutput.height = TestConstants.SMALL_WIDTH > width ? TestConstants.BIG_HEIGHT : TestConstants.SMALL_HEIGHT;
2014-09-18 15:15:21 -07:00
} else if (testNode.context.equals(TestConstants.LONG_TEXT)) {
2016-01-06 16:56:56 +00:00
if (widthMode == CSSMeasureMode.UNDEFINED) {
width = 10000000;
}
measureOutput.width = Math.min(width, TestConstants.BIG_WIDTH);
measureOutput.height = TestConstants.BIG_WIDTH > width ? TestConstants.BIG_HEIGHT : TestConstants.SMALL_HEIGHT;
} else if (testNode.context.equals(TestConstants.MEASURE_WITH_RATIO_2)) {
if (widthMode == CSSMeasureMode.EXACTLY) {
measureOutput.width = width;
measureOutput.height = width * 2;
} else if (heightMode == CSSMeasureMode.EXACTLY) {
measureOutput.width = height * 2;
measureOutput.height = height;
} else if (widthMode == CSSMeasureMode.AT_MOST) {
measureOutput.width = width;
measureOutput.height = width * 2;
} else if (heightMode == CSSMeasureMode.AT_MOST) {
measureOutput.width = height * 2;
measureOutput.height = height;
} else {
measureOutput.width = 99999;
measureOutput.height = 99999;
}
} else if (testNode.context.equals(TestConstants.MEASURE_WITH_MATCH_PARENT)) {
2016-01-06 16:56:56 +00:00
if (widthMode == CSSMeasureMode.UNDEFINED) {
width = 99999;
}
if (heightMode == CSSMeasureMode.UNDEFINED) {
height = 99999;
}
measureOutput.width = width;
measureOutput.height = height;
2014-09-18 15:15:21 -07:00
} else {
throw new RuntimeException("Got unknown test: " + testNode.context);
}
}
};
private static class TestCSSNode extends CSSNode {
public String context = null;
public TestCSSNode getChildAt(int i) {
return (TestCSSNode) super.getChildAt(i);
}
}
private static void test(String message, CSSNode style, CSSNode expectedLayout) {
2015-03-23 17:49:47 +00:00
CSSLayoutContext layoutContext = new CSSLayoutContext();
style.calculateLayout(layoutContext);
2014-09-18 15:15:21 -07:00
assertLayoutsEqual(message, style, expectedLayout);
}
private static void addChildren(TestCSSNode node, int numChildren) {
for (int i = 0; i < numChildren; i++) {
node.addChildAt(new TestCSSNode(), i);
}
}
private static void assertLayoutsEqual(String message, CSSNode actual, CSSNode expected) {
Assert.assertTrue(
message + "\nActual:\n" + actual.toString() + "\nExpected:\n" + expected.toString(),
areLayoutsEqual(actual, expected));
}
private static boolean areLayoutsEqual(CSSNode a, CSSNode b) {
boolean doNodesHaveSameLayout =
areFloatsEqual(a.layout.position[POSITION_LEFT], b.layout.position[POSITION_LEFT]) &&
areFloatsEqual(a.layout.position[POSITION_TOP], b.layout.position[POSITION_TOP]) &&
areFloatsEqual(a.layout.dimensions[DIMENSION_WIDTH], b.layout.dimensions[DIMENSION_WIDTH]) &&
areFloatsEqual(a.layout.dimensions[DIMENSION_HEIGHT], b.layout.dimensions[DIMENSION_HEIGHT]);
2014-09-18 15:15:21 -07:00
if (!doNodesHaveSameLayout) {
return false;
}
for (int i = 0; i < a.getChildCount(); i++) {
if (!areLayoutsEqual(a.getChildAt(i), b.getChildAt(i))) {
return false;
}
}
return true;
}
private static boolean areFloatsEqual(float a, float b) {
return Math.abs(a - b) < .00001f;
}
/** START_GENERATED **/
@Test
public void testCase0()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
}
test("should layout a single node with width and height", root_node, root_layout);
}
@Test
public void testCase1()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 500;
node_1.style.dimensions[DIMENSION_HEIGHT] = 500;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 250;
node_1.style.dimensions[DIMENSION_HEIGHT] = 250;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 125;
node_1.style.dimensions[DIMENSION_HEIGHT] = 125;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 500;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 500;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 500;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 250;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 250;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 750;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 125;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 125;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with children", root_node, root_layout);
}
@Test
public void testCase2()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 500;
node_1.style.dimensions[DIMENSION_HEIGHT] = 500;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 250;
node_1.style.dimensions[DIMENSION_HEIGHT] = 250;
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 125;
node_1.style.dimensions[DIMENSION_HEIGHT] = 125;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 500;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 500;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 500;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 250;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 250;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 250;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 125;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 125;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 125;
}
}
test("should layout node with children in reverse", root_node, root_layout);
}
@Test
public void testCase3()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 500;
node_1.style.dimensions[DIMENSION_HEIGHT] = 500;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 500;
node_1.style.dimensions[DIMENSION_HEIGHT] = 500;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 2);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 250;
node_2.style.dimensions[DIMENSION_HEIGHT] = 250;
2014-09-18 15:15:21 -07:00
node_2 = node_1.getChildAt(1);
node_2.style.dimensions[DIMENSION_WIDTH] = 250;
node_2.style.dimensions[DIMENSION_HEIGHT] = 250;
2014-09-18 15:15:21 -07:00
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 500;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 500;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 500;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 500;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 500;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 2);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 250;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 250;
2014-09-18 15:15:21 -07:00
node_2 = node_1.getChildAt(1);
node_2.layout.position[POSITION_TOP] = 250;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 250;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 250;
2014-09-18 15:15:21 -07:00
}
}
}
test("should layout node with nested children", root_node, root_layout);
}
@Test
public void testCase4()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 500;
node_1.style.dimensions[DIMENSION_HEIGHT] = 500;
node_1 = node_0.getChildAt(1);
node_1.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_1.style.dimensions[DIMENSION_WIDTH] = 500;
node_1.style.dimensions[DIMENSION_HEIGHT] = 500;
addChildren(node_1, 2);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 250;
node_2.style.dimensions[DIMENSION_HEIGHT] = 250;
node_2 = node_1.getChildAt(1);
node_2.style.dimensions[DIMENSION_WIDTH] = 250;
node_2.style.dimensions[DIMENSION_HEIGHT] = 250;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 500;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 500;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 500;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 500;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 500;
addChildren(node_1, 2);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 250;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 250;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 250;
node_2 = node_1.getChildAt(1);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 250;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 250;
}
}
}
test("should layout node with nested children in reverse", root_node, root_layout);
}
@Test
public void testCase5()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
node_0.setMargin(Spacing.LEFT, 10);
node_0.setMargin(Spacing.TOP, 10);
node_0.setMargin(Spacing.RIGHT, 10);
node_0.setMargin(Spacing.BOTTOM, 10);
node_0.setMargin(Spacing.START, 10);
node_0.setMargin(Spacing.END, 10);
2014-09-18 15:15:21 -07:00
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 10;
node_0.layout.position[POSITION_LEFT] = 10;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
}
test("should layout node with margin", root_node, root_layout);
}
@Test
public void testCase6()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
node_0.setMargin(Spacing.LEFT, 10);
node_0.setMargin(Spacing.TOP, 10);
node_0.setMargin(Spacing.RIGHT, 10);
node_0.setMargin(Spacing.BOTTOM, 10);
node_0.setMargin(Spacing.START, 10);
node_0.setMargin(Spacing.END, 10);
2014-09-18 15:15:21 -07:00
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.setMargin(Spacing.LEFT, 50);
node_1.setMargin(Spacing.TOP, 50);
node_1.setMargin(Spacing.RIGHT, 50);
node_1.setMargin(Spacing.BOTTOM, 50);
node_1.setMargin(Spacing.START, 50);
node_1.setMargin(Spacing.END, 50);
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.setMargin(Spacing.LEFT, 25);
node_1.setMargin(Spacing.TOP, 25);
node_1.setMargin(Spacing.RIGHT, 25);
node_1.setMargin(Spacing.BOTTOM, 25);
node_1.setMargin(Spacing.START, 25);
node_1.setMargin(Spacing.END, 25);
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 10;
node_0.layout.position[POSITION_LEFT] = 10;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 50;
node_1.layout.position[POSITION_LEFT] = 50;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 225;
node_1.layout.position[POSITION_LEFT] = 25;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 360;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with several children", root_node, root_layout);
}
@Test
public void testCase7()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
node_0.setMargin(Spacing.LEFT, 10);
node_0.setMargin(Spacing.TOP, 10);
node_0.setMargin(Spacing.RIGHT, 10);
node_0.setMargin(Spacing.BOTTOM, 10);
node_0.setMargin(Spacing.START, 10);
node_0.setMargin(Spacing.END, 10);
addChildren(node_0, 3);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.setMargin(Spacing.LEFT, 50);
node_1.setMargin(Spacing.TOP, 50);
node_1.setMargin(Spacing.RIGHT, 50);
node_1.setMargin(Spacing.BOTTOM, 50);
node_1.setMargin(Spacing.START, 50);
node_1.setMargin(Spacing.END, 50);
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.setMargin(Spacing.LEFT, 25);
node_1.setMargin(Spacing.TOP, 25);
node_1.setMargin(Spacing.RIGHT, 25);
node_1.setMargin(Spacing.BOTTOM, 25);
node_1.setMargin(Spacing.START, 25);
node_1.setMargin(Spacing.END, 25);
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 10;
node_0.layout.position[POSITION_LEFT] = 10;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 3);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 850;
node_1.layout.position[POSITION_LEFT] = 50;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 675;
node_1.layout.position[POSITION_LEFT] = 25;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 540;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with several children in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase8()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.flexDirection = CSSFlexDirection.ROW_REVERSE;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 300;
node_1.style.dimensions[DIMENSION_HEIGHT] = 150;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 100;
node_1.layout.dimensions[DIMENSION_WIDTH] = 300;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 150;
2014-09-18 15:15:21 -07:00
}
}
test("should layout rtl with reverse correctly", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase9()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 300;
node_1.style.dimensions[DIMENSION_HEIGHT] = 150;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 100;
node_1.layout.dimensions[DIMENSION_WIDTH] = 300;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 150;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with row flex direction", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase10()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 300;
node_1.style.dimensions[DIMENSION_HEIGHT] = 150;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 900;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 600;
node_1.layout.dimensions[DIMENSION_WIDTH] = 300;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 150;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with row flex direction in rtl", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase11()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 300;
node_1.style.dimensions[DIMENSION_HEIGHT] = 150;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 350;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 200;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 300;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 150;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node based on children main dimensions", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase12()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 300;
node_1.style.dimensions[DIMENSION_HEIGHT] = 150;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 350;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 150;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 300;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 150;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node based on children main dimensions in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase13()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 200;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 800;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with just flex", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase14()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 800;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 800;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with just flex in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase15()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 1);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1.style.dimensions[DIMENSION_WIDTH] = 1000;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.flex = 1;
node_2.style.dimensions[DIMENSION_WIDTH] = 1000;
addChildren(node_2, 1);
{
TestCSSNode node_3;
node_3 = node_2.getChildAt(0);
node_3.style.flex = 1;
node_3.style.dimensions[DIMENSION_WIDTH] = 1000;
}
}
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 1);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_2, 1);
{
TestCSSNode node_3;
node_3 = node_2.getChildAt(0);
node_3.layout.position[POSITION_TOP] = 0;
node_3.layout.position[POSITION_LEFT] = 0;
node_3.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_3.layout.dimensions[DIMENSION_HEIGHT] = 1000;
}
}
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with flex recursively", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase16()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 1);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_1.style.flex = 1;
node_1.style.dimensions[DIMENSION_WIDTH] = 1000;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_2.style.flex = 1;
node_2.style.dimensions[DIMENSION_WIDTH] = 1000;
addChildren(node_2, 1);
{
TestCSSNode node_3;
node_3 = node_2.getChildAt(0);
node_3.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_3.style.flex = 1;
node_3.style.dimensions[DIMENSION_WIDTH] = 1000;
}
}
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 1);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_2, 1);
{
TestCSSNode node_3;
node_3 = node_2.getChildAt(0);
node_3.layout.position[POSITION_TOP] = 0;
node_3.layout.position[POSITION_LEFT] = 0;
node_3.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_3.layout.dimensions[DIMENSION_HEIGHT] = 1000;
}
}
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with flex recursively in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase17()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
node_0.setMargin(Spacing.LEFT, 5);
node_0.setMargin(Spacing.TOP, 10);
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.setMargin(Spacing.LEFT, 15);
node_1.setMargin(Spacing.TOP, 50);
node_1.setMargin(Spacing.BOTTOM, 20);
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.setMargin(Spacing.LEFT, 30);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 10;
node_0.layout.position[POSITION_LEFT] = 5;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 50;
node_1.layout.position[POSITION_LEFT] = 15;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 170;
node_1.layout.position[POSITION_LEFT] = 30;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with targeted margin", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase18()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
node_0.setMargin(Spacing.LEFT, 5);
node_0.setMargin(Spacing.TOP, 10);
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.setMargin(Spacing.LEFT, 15);
node_1.setMargin(Spacing.TOP, 50);
node_1.setMargin(Spacing.BOTTOM, 20);
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.setMargin(Spacing.LEFT, 30);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 10;
node_0.layout.position[POSITION_LEFT] = 5;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 880;
node_1.layout.position[POSITION_LEFT] = 15;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 730;
node_1.layout.position[POSITION_LEFT] = 30;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with targeted margin in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase19()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.justifyContent = CSSJustify.FLEX_START;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with justifyContent: flex-start", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase20()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.justifyContent = CSSJustify.FLEX_START;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 900;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 800;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with justifyContent: flex-start in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase21()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.justifyContent = CSSJustify.FLEX_END;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 800;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 900;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with justifyContent: flex-end", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase22()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.justifyContent = CSSJustify.FLEX_END;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with justifyContent: flex-end in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase23()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.justifyContent = CSSJustify.SPACE_BETWEEN;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 900;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with justifyContent: space-between", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase24()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.justifyContent = CSSJustify.SPACE_BETWEEN;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 900;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with justifyContent: space-between in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase25()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.justifyContent = CSSJustify.SPACE_AROUND;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 200;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 700;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with justifyContent: space-around", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase26()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.justifyContent = CSSJustify.SPACE_AROUND;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 700;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 200;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with justifyContent: space-around in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase27()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.justifyContent = CSSJustify.CENTER;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 400;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 500;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with justifyContent: center", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase28()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.justifyContent = CSSJustify.CENTER;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 500;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 400;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with justifyContent: center in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase29()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with flex override height", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase30()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.alignItems = CSSAlign.FLEX_START;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with alignItems: flex-start", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase31()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.alignItems = CSSAlign.FLEX_START;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 900;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 800;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with alignItems: flex-start in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase32()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.alignItems = CSSAlign.CENTER;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 400;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 450;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with alignItems: center", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase33()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.alignItems = CSSAlign.CENTER;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 900;
node_1.layout.position[POSITION_LEFT] = 400;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 800;
node_1.layout.position[POSITION_LEFT] = 450;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with alignItems: center in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase34()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.alignItems = CSSAlign.FLEX_END;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 800;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 900;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with alignItems: flex-end", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase35()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.alignItems = CSSAlign.FLEX_END;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 900;
node_1.layout.position[POSITION_LEFT] = 800;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 800;
node_1.layout.position[POSITION_LEFT] = 900;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with alignItems: flex-end in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase36()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.alignItems = CSSAlign.FLEX_END;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.alignSelf = CSSAlign.CENTER;
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 800;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 450;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with alignSelf overrides alignItems", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase37()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.alignItems = CSSAlign.FLEX_END;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.alignSelf = CSSAlign.CENTER;
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 900;
node_1.layout.position[POSITION_LEFT] = 800;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 800;
node_1.layout.position[POSITION_LEFT] = 450;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with alignSelf overrides alignItems in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase38()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.alignItems = CSSAlign.STRETCH;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 1);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 1);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with alignItem: stretch", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase39()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.alignItems = CSSAlign.STRETCH;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 1);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 1);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 900;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with alignItem: stretch in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase40()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout empty node", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase41()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout empty node in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase42()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.setMargin(Spacing.LEFT, 5);
node_1.setMargin(Spacing.TOP, 5);
node_1.setMargin(Spacing.RIGHT, 5);
node_1.setMargin(Spacing.BOTTOM, 5);
node_1.setMargin(Spacing.START, 5);
node_1.setMargin(Spacing.END, 5);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 10;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 10;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 5;
node_1.layout.position[POSITION_LEFT] = 5;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout child with margin", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase43()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.setMargin(Spacing.LEFT, 5);
node_1.setMargin(Spacing.TOP, 5);
node_1.setMargin(Spacing.RIGHT, 5);
node_1.setMargin(Spacing.BOTTOM, 5);
node_1.setMargin(Spacing.START, 5);
node_1.setMargin(Spacing.END, 5);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 10;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 10;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 5;
node_1.layout.position[POSITION_LEFT] = 5;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout child with margin in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase44()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
}
}
test("should not shrink children if not enough space", root_node, root_layout);
}
@Test
public void testCase45()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = -200;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
}
}
test("should not shrink children if not enough space in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase46()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.justifyContent = CSSJustify.CENTER;
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
test("should layout for center", root_node, root_layout);
}
@Test
public void testCase47()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.justifyContent = CSSJustify.FLEX_END;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.setMargin(Spacing.TOP, 10);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout flex-end taking into account margin", root_node, root_layout);
}
@Test
public void testCase48()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.justifyContent = CSSJustify.FLEX_END;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.setMargin(Spacing.TOP, 10);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 10;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout flex-end taking into account margin in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase49()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.alignItems = CSSAlign.FLEX_END;
addChildren(node_1, 2);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.setMargin(Spacing.LEFT, 10);
node_2.setMargin(Spacing.TOP, 10);
node_2.setMargin(Spacing.RIGHT, 10);
node_2.setMargin(Spacing.BOTTOM, 10);
node_2.setMargin(Spacing.START, 10);
node_2.setMargin(Spacing.END, 10);
2014-09-18 15:15:21 -07:00
node_2 = node_1.getChildAt(1);
node_2.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 20;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 120;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 20;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 120;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 2);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 10;
node_2.layout.position[POSITION_LEFT] = 10;
node_2.layout.dimensions[DIMENSION_WIDTH] = 0;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
node_2 = node_1.getChildAt(1);
node_2.layout.position[POSITION_TOP] = 20;
node_2.layout.position[POSITION_LEFT] = 20;
node_2.layout.dimensions[DIMENSION_WIDTH] = 0;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
}
test("should layout alignItems with margin", root_node, root_layout);
}
@Test
public void testCase50()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_1.style.alignItems = CSSAlign.FLEX_END;
addChildren(node_1, 2);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.setMargin(Spacing.LEFT, 10);
node_2.setMargin(Spacing.TOP, 10);
node_2.setMargin(Spacing.RIGHT, 10);
node_2.setMargin(Spacing.BOTTOM, 10);
node_2.setMargin(Spacing.START, 10);
node_2.setMargin(Spacing.END, 10);
node_2 = node_1.getChildAt(1);
node_2.style.dimensions[DIMENSION_HEIGHT] = 100;
}
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 20;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 120;
addChildren(node_0, 1);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 20;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 120;
addChildren(node_1, 2);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 110;
node_2.layout.position[POSITION_LEFT] = 10;
node_2.layout.dimensions[DIMENSION_WIDTH] = 0;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 0;
node_2 = node_1.getChildAt(1);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 20;
node_2.layout.dimensions[DIMENSION_WIDTH] = 0;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
2014-09-18 15:15:21 -07:00
}
}
test("should layout alignItems with margin in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase51()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout flex inside of an empty element", root_node, root_layout);
}
@Test
public void testCase52()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.alignItems = CSSAlign.STRETCH;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.setMargin(Spacing.LEFT, 10);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 10;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout alignItems stretch and margin", root_node, root_layout);
}
@Test
public void testCase53()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.alignItems = CSSAlign.STRETCH;
addChildren(node_0, 1);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.setMargin(Spacing.LEFT, 10);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 10;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
addChildren(node_0, 1);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout alignItems stretch and margin in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase54()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.setPadding(Spacing.LEFT, 5);
node_0.setPadding(Spacing.TOP, 5);
node_0.setPadding(Spacing.RIGHT, 5);
node_0.setPadding(Spacing.BOTTOM, 5);
node_0.setPadding(Spacing.START, 5);
node_0.setPadding(Spacing.END, 5);
2014-09-18 15:15:21 -07:00
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 10;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 10;
2014-09-18 15:15:21 -07:00
}
test("should layout node with padding", root_node, root_layout);
}
@Test
public void testCase55()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.setPadding(Spacing.LEFT, 5);
node_0.setPadding(Spacing.TOP, 5);
node_0.setPadding(Spacing.RIGHT, 5);
node_0.setPadding(Spacing.BOTTOM, 5);
node_0.setPadding(Spacing.START, 5);
node_0.setPadding(Spacing.END, 5);
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 10;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 10;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 5;
node_1.layout.position[POSITION_LEFT] = 5;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with padding and a child", root_node, root_layout);
}
@Test
public void testCase56()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.setPadding(Spacing.LEFT, 5);
node_0.setPadding(Spacing.TOP, 5);
node_0.setPadding(Spacing.RIGHT, 5);
node_0.setPadding(Spacing.BOTTOM, 5);
node_0.setPadding(Spacing.START, 5);
node_0.setPadding(Spacing.END, 5);
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.setMargin(Spacing.LEFT, 5);
node_1.setMargin(Spacing.TOP, 5);
node_1.setMargin(Spacing.RIGHT, 5);
node_1.setMargin(Spacing.BOTTOM, 5);
node_1.setMargin(Spacing.START, 5);
node_1.setMargin(Spacing.END, 5);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 20;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 20;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 10;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with padding and a child with margin", root_node, root_layout);
}
@Test
public void testCase57()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.alignSelf = CSSAlign.STRETCH;
node_1.setPadding(Spacing.LEFT, 10);
node_1.setPadding(Spacing.TOP, 10);
node_1.setPadding(Spacing.RIGHT, 10);
node_1.setPadding(Spacing.BOTTOM, 10);
node_1.setPadding(Spacing.START, 10);
node_1.setPadding(Spacing.END, 10);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 20;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 20;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 20;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 20;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with padding and stretch", root_node, root_layout);
}
@Test
public void testCase58()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.setPadding(Spacing.LEFT, 50);
node_0.setPadding(Spacing.TOP, 50);
node_0.setPadding(Spacing.RIGHT, 50);
node_0.setPadding(Spacing.BOTTOM, 50);
node_0.setPadding(Spacing.START, 50);
node_0.setPadding(Spacing.END, 50);
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.alignSelf = CSSAlign.STRETCH;
node_1.setPadding(Spacing.LEFT, 10);
node_1.setPadding(Spacing.TOP, 10);
node_1.setPadding(Spacing.RIGHT, 10);
node_1.setPadding(Spacing.BOTTOM, 10);
node_1.setPadding(Spacing.START, 10);
node_1.setPadding(Spacing.END, 10);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 120;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 120;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 50;
node_1.layout.position[POSITION_LEFT] = 50;
node_1.layout.dimensions[DIMENSION_WIDTH] = 20;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 20;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with inner & outer padding and stretch", root_node, root_layout);
}
@Test
public void testCase59()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.alignSelf = CSSAlign.STRETCH;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.setMargin(Spacing.LEFT, 16);
node_2.setMargin(Spacing.TOP, 16);
node_2.setMargin(Spacing.RIGHT, 16);
node_2.setMargin(Spacing.BOTTOM, 16);
node_2.setMargin(Spacing.START, 16);
node_2.setMargin(Spacing.END, 16);
2014-09-18 15:15:21 -07:00
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 32;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 32;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 32;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 32;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 16;
node_2.layout.position[POSITION_LEFT] = 16;
node_2.layout.dimensions[DIMENSION_WIDTH] = 0;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
}
test("should layout node with stretch and child with margin", root_node, root_layout);
}
@Test
public void testCase60()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.position[POSITION_LEFT] = 5;
node_0.style.position[POSITION_TOP] = 5;
2014-09-18 15:15:21 -07:00
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 5;
node_0.layout.position[POSITION_LEFT] = 5;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
test("should layout node with top and left", root_node, root_layout);
}
@Test
public void testCase61()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.justifyContent = CSSJustify.SPACE_AROUND;
node_0.style.dimensions[DIMENSION_HEIGHT] = 10;
node_0.setPadding(Spacing.TOP, 5);
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 10;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 7.5f;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with height, padding and space-around", root_node, root_layout);
}
@Test
public void testCase62()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.position[POSITION_BOTTOM] = 5;
2014-09-18 15:15:21 -07:00
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = -5;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
test("should layout node with bottom", root_node, root_layout);
}
@Test
public void testCase63()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.position[POSITION_TOP] = 10;
node_0.style.position[POSITION_BOTTOM] = 5;
2014-09-18 15:15:21 -07:00
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 10;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
test("should layout node with both top and bottom", root_node, root_layout);
}
@Test
public void testCase64()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 500;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1 = node_0.getChildAt(1);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(2);
node_1.style.flex = 1;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 500;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 250;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 250;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 250;
node_1.layout.dimensions[DIMENSION_WIDTH] = 250;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with position: absolute", root_node, root_layout);
}
@Test
public void testCase65()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.setMargin(Spacing.RIGHT, 15);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with child with position: absolute and margin", root_node, root_layout);
}
@Test
public void testCase66()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.alignSelf = CSSAlign.CENTER;
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.setPadding(Spacing.RIGHT, 12);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 12;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with position: absolute, padding and alignSelf: center", root_node, root_layout);
}
@Test
public void testCase67()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_HEIGHT] = 5;
node_0.setPadding(Spacing.BOTTOM, 20);
2014-09-18 15:15:21 -07:00
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 20;
2014-09-18 15:15:21 -07:00
}
test("should work with height smaller than paddingBottom", root_node, root_layout);
}
@Test
public void testCase68()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 5;
node_0.setPadding(Spacing.LEFT, 20);
2014-09-18 15:15:21 -07:00
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 20;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
test("should work with width smaller than paddingLeft", root_node, root_layout);
}
@Test
public void testCase69()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 400;
2014-09-18 15:15:21 -07:00
}
node_1 = node_0.getChildAt(1);
node_1.style.alignSelf = CSSAlign.STRETCH;
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 400;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 400;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 400;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with specified width and stretch", root_node, root_layout);
}
@Test
public void testCase70()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.setPadding(Spacing.LEFT, 5);
node_0.setPadding(Spacing.TOP, 5);
node_0.setPadding(Spacing.RIGHT, 5);
node_0.setPadding(Spacing.BOTTOM, 5);
node_0.setPadding(Spacing.START, 5);
node_0.setPadding(Spacing.END, 5);
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 10;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 10;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 5;
node_1.layout.position[POSITION_LEFT] = 5;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with padding and child with position absolute", root_node, root_layout);
}
@Test
public void testCase71()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.position[POSITION_LEFT] = 10;
node_1.style.position[POSITION_TOP] = 10;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 10;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with position absolute, top and left", root_node, root_layout);
}
@Test
public void testCase72()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.setPadding(Spacing.LEFT, 20);
node_0.setPadding(Spacing.TOP, 20);
node_0.setPadding(Spacing.RIGHT, 20);
node_0.setPadding(Spacing.BOTTOM, 20);
node_0.setPadding(Spacing.START, 20);
node_0.setPadding(Spacing.END, 20);
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.position[POSITION_LEFT] = 5;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 40;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 40;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 20;
node_1.layout.position[POSITION_LEFT] = 5;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with padding and child position absolute, left", root_node, root_layout);
}
@Test
public void testCase73()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.setMargin(Spacing.TOP, 5);
node_1.style.position[POSITION_TOP] = 5;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 10;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with position: absolute, top and marginTop", root_node, root_layout);
}
@Test
public void testCase74()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.setMargin(Spacing.LEFT, 5);
node_1.style.position[POSITION_LEFT] = 5;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with position: absolute, left and marginLeft", root_node, root_layout);
}
@Test
public void testCase75()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.justifyContent = CSSJustify.SPACE_AROUND;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1 = node_0.getChildAt(1);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with space-around and child position absolute", root_node, root_layout);
}
@Test
public void testCase76()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.justifyContent = CSSJustify.SPACE_AROUND;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1 = node_0.getChildAt(1);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with space-around and child position absolute in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase77()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 700;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1.setMargin(Spacing.LEFT, 5);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 700;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 5;
node_1.layout.dimensions[DIMENSION_WIDTH] = 695;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with flex and main margin", root_node, root_layout);
}
@Test
public void testCase78()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 700;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1.setMargin(Spacing.RIGHT, 5);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 700;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 695;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with flex and main margin in rtl", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase79()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 700;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.setPadding(Spacing.RIGHT, 5);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 700;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 347.5f;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 347.5f;
node_1.layout.dimensions[DIMENSION_WIDTH] = 352.5f;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with multiple flex and padding", root_node, root_layout);
}
@Test
public void testCase80()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 700;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.setPadding(Spacing.LEFT, 5);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 700;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 352.5f;
node_1.layout.dimensions[DIMENSION_WIDTH] = 347.5f;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 352.5f;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with multiple flex and padding in rtl", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase81()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 700;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.setMargin(Spacing.LEFT, 5);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 700;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 347.5f;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 352.5f;
node_1.layout.dimensions[DIMENSION_WIDTH] = 347.5f;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with multiple flex and margin", root_node, root_layout);
}
@Test
public void testCase82()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 700;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.setMargin(Spacing.RIGHT, 5);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 700;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 352.5f;
node_1.layout.dimensions[DIMENSION_WIDTH] = 347.5f;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 347.5f;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with multiple flex and margin in rtl", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase83()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_HEIGHT] = 300;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 600;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 300;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 600;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 600;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with flex and overflow", root_node, root_layout);
}
@Test
public void testCase84()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 600;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.flex = 1;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 600;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with flex and position absolute", root_node, root_layout);
}
@Test
public void testCase85()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 600;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.flex = 1;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 600;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 600;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with flex and position absolute in rtl", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase86()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_HEIGHT] = 500;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1 = node_0.getChildAt(1);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.flex = 1;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 500;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 500;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 500;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with double flex and position absolute", root_node, root_layout);
}
@Test
public void testCase87()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.setBorder(Spacing.LEFT, 5);
node_0.setBorder(Spacing.TOP, 5);
node_0.setBorder(Spacing.RIGHT, 5);
node_0.setBorder(Spacing.BOTTOM, 5);
node_0.setBorder(Spacing.START, 5);
node_0.setBorder(Spacing.END, 5);
2014-09-18 15:15:21 -07:00
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 10;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 10;
2014-09-18 15:15:21 -07:00
}
test("should layout node with borderWidth", root_node, root_layout);
}
@Test
public void testCase88()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.setBorder(Spacing.TOP, 1);
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.position[POSITION_TOP] = -1;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with borderWidth and position: absolute, top", root_node, root_layout);
}
@Test
public void testCase89()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.setBorder(Spacing.LEFT, 1);
node_0.setBorder(Spacing.TOP, 1);
node_0.setBorder(Spacing.RIGHT, 1);
node_0.setBorder(Spacing.BOTTOM, 1);
node_0.setBorder(Spacing.START, 1);
node_0.setBorder(Spacing.END, 1);
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.position[POSITION_LEFT] = 5;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 2;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 2;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 1;
node_1.layout.position[POSITION_LEFT] = 6;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with borderWidth and position: absolute, top. cross axis", root_node, root_layout);
}
@Test
public void testCase90()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 50;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.alignSelf = CSSAlign.STRETCH;
node_1.setMargin(Spacing.LEFT, 20);
node_1.setPadding(Spacing.LEFT, 20);
node_1.setPadding(Spacing.TOP, 20);
node_1.setPadding(Spacing.RIGHT, 20);
node_1.setPadding(Spacing.BOTTOM, 20);
node_1.setPadding(Spacing.START, 20);
node_1.setPadding(Spacing.END, 20);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 50;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 40;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 20;
node_1.layout.dimensions[DIMENSION_WIDTH] = 40;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 40;
2014-09-18 15:15:21 -07:00
}
}
test("should correctly take into account min padding for stretch", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase91()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = -31;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.setBorder(Spacing.RIGHT, 5);
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 5;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 5;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with negative width", root_node, root_layout);
}
@Test
public void testCase92()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.setBorder(Spacing.RIGHT, 1);
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.setMargin(Spacing.RIGHT, -8);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
}
}
test("should handle negative margin and min padding correctly", root_node, root_layout);
}
@Test
public void testCase93()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
2014-09-18 15:15:21 -07:00
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.setBorder(Spacing.LEFT, 1);
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.setMargin(Spacing.LEFT, -8);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 1;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
}
}
test("should handle negative margin and min padding correctly in rtl", root_node, root_layout);
}
@Test
public void testCase94()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
2014-09-18 15:15:21 -07:00
node_0.setMeasureFunction(sTestMeasureFunction);
node_0.context = TestConstants.SMALL_TEXT;
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = TestConstants.SMALL_WIDTH;
node_0.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.SMALL_HEIGHT;
}
2014-09-18 15:15:21 -07:00
test("should layout node with just text", root_node, root_layout);
}
@Test
public void testCase95()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.setMeasureFunction(sTestMeasureFunction);
node_0.context = TestConstants.MEASURE_WITH_RATIO_2;
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
test("should layout node with fixed width and custom measure function", root_node, root_layout);
}
@Test
public void testCase96()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
node_0.setMeasureFunction(sTestMeasureFunction);
node_0.context = TestConstants.MEASURE_WITH_RATIO_2;
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
test("should layout node with fixed height and custom measure function", root_node, root_layout);
}
@Test
public void testCase97()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
node_0.setMeasureFunction(sTestMeasureFunction);
node_0.context = TestConstants.MEASURE_WITH_RATIO_2;
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
test("should layout node with fixed height and fixed width, ignoring custom measure function", root_node, root_layout);
}
@Test
public void testCase98()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.setMeasureFunction(sTestMeasureFunction);
node_0.context = TestConstants.MEASURE_WITH_RATIO_2;
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 99999;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 99999;
}
test("should layout node with no fixed dimension and custom measure function", root_node, root_layout);
}
@Test
public void testCase99()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN;
node_0.style.dimensions[DIMENSION_WIDTH] = 320;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.setMeasureFunction(sTestMeasureFunction);
node_1.context = TestConstants.MEASURE_WITH_RATIO_2;
node_1 = node_0.getChildAt(1);
node_1.style.flexDirection = CSSFlexDirection.ROW;
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
node_1.style.overflow = CSSOverflow.HIDDEN;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 2);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.setMeasureFunction(sTestMeasureFunction);
node_2.context = TestConstants.MEASURE_WITH_RATIO_2;
node_2 = node_1.getChildAt(1);
node_2.setMeasureFunction(sTestMeasureFunction);
node_2.context = TestConstants.MEASURE_WITH_RATIO_2;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 320;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 740;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 320;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 640;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 640;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 320;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 2);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 200;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_2 = node_1.getChildAt(1);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 200;
node_2.layout.dimensions[DIMENSION_WIDTH] = 200;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
}
test("should layout node with nested stacks and custom measure function", root_node, root_layout);
}
@Test
public void testCase100()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 10;
2014-09-18 15:15:21 -07:00
node_0.setMeasureFunction(sTestMeasureFunction);
node_0.context = TestConstants.SMALL_TEXT;
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 10;
node_0.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.BIG_HEIGHT;
}
2014-09-18 15:15:21 -07:00
test("should layout node with text and width", root_node, root_layout);
}
@Test
public void testCase101()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
2014-09-18 15:15:21 -07:00
node_0.setMeasureFunction(sTestMeasureFunction);
node_0.context = TestConstants.LONG_TEXT;
2014-09-18 15:15:21 -07:00
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = TestConstants.BIG_WIDTH;
node_0.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.SMALL_HEIGHT;
2014-09-18 15:15:21 -07:00
}
test("should layout node with text, padding and margin", root_node, root_layout);
}
@Test
public void testCase102()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
2014-09-18 15:15:21 -07:00
node_1.style.alignSelf = CSSAlign.STRETCH;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
2014-09-18 15:15:21 -07:00
node_2.style.alignSelf = CSSAlign.STRETCH;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 300;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 300;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 0;
}
}
}
2014-09-18 15:15:21 -07:00
test("should layout node with nested alignSelf: stretch", root_node, root_layout);
}
2014-12-12 12:03:31 +00:00
@Test
public void testCase103()
2014-12-12 12:03:31 +00:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
2014-12-12 12:03:31 +00:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
2014-09-18 15:15:21 -07:00
node_1.style.flexDirection = CSSFlexDirection.ROW;
node_1.style.dimensions[DIMENSION_WIDTH] = 500;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.flex = 1;
node_2.setMeasureFunction(sTestMeasureFunction);
node_2.context = TestConstants.LONG_TEXT;
2014-09-18 15:15:21 -07:00
}
2014-12-12 12:03:31 +00:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 500;
node_0.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.SMALL_HEIGHT;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
2014-12-12 12:03:31 +00:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 500;
node_1.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.SMALL_HEIGHT;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 500;
node_2.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.SMALL_HEIGHT;
2014-09-18 15:15:21 -07:00
}
2014-12-12 12:03:31 +00:00
}
}
2014-09-18 15:15:21 -07:00
test("should layout node with text and flex", root_node, root_layout);
2014-12-12 12:03:31 +00:00
}
@Test
public void testCase104()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.direction = CSSDirection.RTL;
node_1.style.flexDirection = CSSFlexDirection.ROW;
node_1.style.dimensions[DIMENSION_WIDTH] = 500;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.flex = 1;
node_2.setMeasureFunction(sTestMeasureFunction);
node_2.context = TestConstants.LONG_TEXT;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 500;
node_0.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.SMALL_HEIGHT;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 500;
node_1.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.SMALL_HEIGHT;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 500;
node_2.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.SMALL_HEIGHT;
}
}
}
test("should layout node with text and flex in rtl", root_node, root_layout);
}
@Test
public void testCase105()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 130;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.alignItems = CSSAlign.STRETCH;
node_1.style.alignSelf = CSSAlign.STRETCH;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.setMeasureFunction(sTestMeasureFunction);
node_2.context = TestConstants.LONG_TEXT;
2014-09-18 15:15:21 -07:00
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 130;
node_0.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.BIG_HEIGHT;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 130;
node_1.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.BIG_HEIGHT;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 130;
node_2.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.BIG_HEIGHT;
2014-09-18 15:15:21 -07:00
}
}
}
2014-09-18 15:15:21 -07:00
test("should layout node with text and stretch", root_node, root_layout);
}
@Test
public void testCase106()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.alignItems = CSSAlign.STRETCH;
node_1.style.alignSelf = CSSAlign.STRETCH;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 130;
2014-09-18 15:15:21 -07:00
node_2.setMeasureFunction(sTestMeasureFunction);
node_2.context = TestConstants.LONG_TEXT;
2014-09-18 15:15:21 -07:00
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.BIG_HEIGHT;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.BIG_HEIGHT;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 130;
node_2.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.BIG_HEIGHT;
2014-09-18 15:15:21 -07:00
}
}
}
2014-09-18 15:15:21 -07:00
test("should layout node with text stretch and width", root_node, root_layout);
}
@Test
public void testCase107()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
2014-10-08 09:35:44 -07:00
node_0.style.alignSelf = CSSAlign.FLEX_START;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
2014-10-08 09:35:44 -07:00
node_1.style.alignSelf = CSSAlign.FLEX_START;
2014-09-18 15:15:21 -07:00
node_1.setMeasureFunction(sTestMeasureFunction);
node_1.context = TestConstants.LONG_TEXT;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.BIG_HEIGHT;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.BIG_HEIGHT;
2014-09-18 15:15:21 -07:00
}
}
test("should layout node with text bounded by parent", root_node, root_layout);
}
@Test
public void testCase108()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
2014-10-08 09:35:44 -07:00
node_0.style.alignSelf = CSSAlign.FLEX_START;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.setPadding(Spacing.LEFT, 10);
node_0.setPadding(Spacing.TOP, 10);
node_0.setPadding(Spacing.RIGHT, 10);
node_0.setPadding(Spacing.BOTTOM, 10);
node_0.setPadding(Spacing.START, 10);
node_0.setPadding(Spacing.END, 10);
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
2014-10-08 09:35:44 -07:00
node_1.style.alignSelf = CSSAlign.FLEX_START;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
2014-09-18 15:15:21 -07:00
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.setMeasureFunction(sTestMeasureFunction);
node_2.context = TestConstants.LONG_TEXT;
2014-09-18 15:15:21 -07:00
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 76;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 20;
node_1.layout.position[POSITION_LEFT] = 20;
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
node_1.layout.dimensions[DIMENSION_WIDTH] = 60;
node_1.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.BIG_HEIGHT;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 60;
node_2.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.BIG_HEIGHT;
2014-09-18 15:15:21 -07:00
}
}
}
test("should layout node with text bounded by grand-parent", root_node, root_layout);
}
@Test
public void testCase109()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.justifyContent = CSSJustify.SPACE_BETWEEN;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 900;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 900;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 900;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout space-between when remaining space is negative", root_node, root_layout);
}
@Test
public void testCase110()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
node_0.style.justifyContent = CSSJustify.SPACE_BETWEEN;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 900;
node_1 = node_0.getChildAt(1);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = -800;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 900;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = -800;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
}
}
test("should layout space-between when remaining space is negative in reverse", root_node, root_layout);
}
@Test
public void testCase111()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.justifyContent = CSSJustify.FLEX_END;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 900;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = -700;
node_1.layout.dimensions[DIMENSION_WIDTH] = 900;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout flex-end when remaining space is negative", root_node, root_layout);
}
@Test
public void testCase112()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.justifyContent = CSSJustify.FLEX_END;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 900;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 900;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
}
}
test("should layout flex-end when remaining space is negative in rtl", root_node, root_layout);
}
@Test
public void testCase113()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flexDirection = CSSFlexDirection.ROW;
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.setMargin(Spacing.LEFT, 20);
node_2.setMargin(Spacing.TOP, 20);
node_2.setMargin(Spacing.RIGHT, 20);
node_2.setMargin(Spacing.BOTTOM, 20);
node_2.setMargin(Spacing.START, 20);
node_2.setMargin(Spacing.END, 20);
2014-09-18 15:15:21 -07:00
node_2.setMeasureFunction(sTestMeasureFunction);
node_2.context = TestConstants.SMALL_TEXT;
2014-09-18 15:15:21 -07:00
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 58;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 58;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 20;
node_2.layout.position[POSITION_LEFT] = 20;
node_2.layout.dimensions[DIMENSION_WIDTH] = TestConstants.SMALL_WIDTH;
node_2.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.SMALL_HEIGHT;
2014-09-18 15:15:21 -07:00
}
}
}
test("should layout text with flexDirection row", root_node, root_layout);
}
@Test
public void testCase114()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flexDirection = CSSFlexDirection.ROW;
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.setMargin(Spacing.LEFT, 20);
node_2.setMargin(Spacing.TOP, 20);
node_2.setMargin(Spacing.RIGHT, 20);
node_2.setMargin(Spacing.BOTTOM, 20);
node_2.setMargin(Spacing.START, 20);
node_2.setMargin(Spacing.END, 20);
node_2.setMeasureFunction(sTestMeasureFunction);
node_2.context = TestConstants.SMALL_TEXT;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 58;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 58;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 20;
node_2.layout.position[POSITION_LEFT] = 145;
node_2.layout.dimensions[DIMENSION_WIDTH] = TestConstants.SMALL_WIDTH;
node_2.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.SMALL_HEIGHT;
}
}
}
test("should layout text with flexDirection row in rtl", root_node, root_layout);
}
@Test
public void testCase115()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.setMargin(Spacing.LEFT, 20);
node_2.setMargin(Spacing.TOP, 20);
node_2.setMargin(Spacing.RIGHT, 20);
node_2.setMargin(Spacing.BOTTOM, 20);
node_2.setMargin(Spacing.START, 20);
node_2.setMargin(Spacing.END, 20);
2014-09-18 15:15:21 -07:00
node_2.setMeasureFunction(sTestMeasureFunction);
node_2.context = TestConstants.LONG_TEXT;
2014-09-18 15:15:21 -07:00
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 76;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 76;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 20;
node_2.layout.position[POSITION_LEFT] = 20;
node_2.layout.dimensions[DIMENSION_WIDTH] = 160;
node_2.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.BIG_HEIGHT;
2014-09-18 15:15:21 -07:00
}
}
}
test("should layout with text and margin", root_node, root_layout);
}
@Test
public void testCase116()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.position[POSITION_LEFT] = 0;
node_1.style.position[POSITION_TOP] = 0;
node_1.style.position[POSITION_RIGHT] = 0;
node_1.style.position[POSITION_BOTTOM] = 0;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
test("should layout with position absolute, top, left, bottom, right", root_node, root_layout);
}
@Test
public void testCase117()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.alignSelf = CSSAlign.FLEX_START;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.alignSelf = CSSAlign.FLEX_START;
node_1.style.flex = 2.5f;
node_1 = node_0.getChildAt(1);
node_1.style.alignSelf = CSSAlign.FLEX_START;
node_1.style.flex = 7.5f;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 2);
2014-09-18 15:15:21 -07:00
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 25;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 25;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 75;
2014-09-18 15:15:21 -07:00
}
}
test("should layout with arbitrary flex", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase118()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
2014-10-08 09:35:44 -07:00
node_0.style.alignSelf = CSSAlign.FLEX_START;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
2014-10-08 09:35:44 -07:00
node_1.style.alignSelf = CSSAlign.FLEX_START;
2014-09-18 15:15:21 -07:00
node_1.style.flex = 2.5f;
node_1 = node_0.getChildAt(1);
2014-10-08 09:35:44 -07:00
node_1.style.alignSelf = CSSAlign.FLEX_START;
2014-09-18 15:15:21 -07:00
node_1.style.flex = 7.5f;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 75;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 25;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 75;
2014-09-18 15:15:21 -07:00
}
}
test("should layout with arbitrary flex in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase119()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE;
2014-10-08 09:35:44 -07:00
node_0.style.alignSelf = CSSAlign.FLEX_START;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
2014-10-08 09:35:44 -07:00
node_1.style.alignSelf = CSSAlign.FLEX_START;
node_1.style.flex = -2.5f;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
2014-10-08 09:35:44 -07:00
node_1.style.alignSelf = CSSAlign.FLEX_START;
2014-09-18 15:15:21 -07:00
node_1.style.flex = 0;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout with negative flex in reverse", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase120()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.position[POSITION_LEFT] = 0;
node_1.style.position[POSITION_RIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 50;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should layout with position: absolute and another sibling", root_node, root_layout);
}
@Test
public void testCase121()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.position[POSITION_TOP] = 0;
node_1.style.position[POSITION_BOTTOM] = 20;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 80;
2014-09-18 15:15:21 -07:00
}
}
test("should calculate height properly with position: absolute top and bottom", root_node, root_layout);
}
@Test
public void testCase122()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.justifyContent = CSSJustify.CENTER;
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.position[POSITION_LEFT] = 0;
node_1.style.position[POSITION_TOP] = 0;
node_1.style.position[POSITION_RIGHT] = 0;
node_1.style.position[POSITION_BOTTOM] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 100;
node_2.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
2014-09-18 15:15:21 -07:00
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 50;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 100;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
}
}
}
test("should layout with complicated position: absolute and justifyContent: center combo", root_node, root_layout);
}
@Test
public void testCase123()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.position[POSITION_BOTTOM] = 0;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should calculate top properly with position: absolute bottom", root_node, root_layout);
}
@Test
public void testCase124()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.position[POSITION_RIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 100;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should calculate left properly with position: absolute right", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase125()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.dimensions[DIMENSION_HEIGHT] = 10;
node_1.style.position[POSITION_BOTTOM] = 0;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 90;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 10;
2014-09-18 15:15:21 -07:00
}
}
test("should calculate top properly with position: absolute bottom and height", root_node, root_layout);
}
@Test
public void testCase126()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.dimensions[DIMENSION_WIDTH] = 10;
node_1.style.position[POSITION_RIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 90;
node_1.layout.dimensions[DIMENSION_WIDTH] = 10;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should calculate left properly with position: absolute right and width", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase127()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.dimensions[DIMENSION_HEIGHT] = 10;
node_1.style.position[POSITION_BOTTOM] = 0;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = -10;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 10;
2014-09-18 15:15:21 -07:00
}
}
test("should calculate top properly with position: absolute right, width, and no parent dimensions", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
@Test
public void testCase128()
2014-09-18 15:15:21 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.dimensions[DIMENSION_WIDTH] = 10;
node_1.style.position[POSITION_RIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = -10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 10;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
2014-09-18 15:15:21 -07:00
}
}
test("should calculate left properly with position: absolute right, width, and no parent dimensions", root_node, root_layout);
}
@Test
public void testCase129()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.justifyContent = CSSJustify.SPACE_BETWEEN;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.setBorder(Spacing.BOTTOM, 1);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 1;
}
}
test("should layout border bottom inside of justify content space between container", root_node, root_layout);
}
@Test
public void testCase130()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.justifyContent = CSSJustify.CENTER;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.setMargin(Spacing.TOP, -6);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = -3;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
}
}
test("should layout negative margin top inside of justify content center container", root_node, root_layout);
}
@Test
public void testCase131()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.justifyContent = CSSJustify.CENTER;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.setMargin(Spacing.TOP, 20);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 20;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 20;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
}
}
test("should layout positive margin top inside of justify content center container", root_node, root_layout);
}
@Test
public void testCase132()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.justifyContent = CSSJustify.FLEX_END;
node_0.setBorder(Spacing.BOTTOM, 5);
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 5;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
}
}
test("should layout border bottom and flex end with an empty child", root_node, root_layout);
}
@Test
public void testCase133()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 800;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.position[POSITION_LEFT] = 5;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 800;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 5;
node_1.layout.dimensions[DIMENSION_WIDTH] = 800;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 800;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 0;
}
}
}
test("should layout with children of a contain with left", root_node, root_layout);
2014-09-18 15:15:21 -07:00
}
2014-12-12 12:03:31 +00:00
@Test
public void testCase134()
2014-12-12 12:03:31 +00:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.flexWrap = CSSWrap.WRAP;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
2014-12-12 12:03:31 +00:00
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 40;
node_1.style.dimensions[DIMENSION_HEIGHT] = 10;
2014-12-12 12:03:31 +00:00
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 40;
node_1.style.dimensions[DIMENSION_HEIGHT] = 10;
2014-12-12 12:03:31 +00:00
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 40;
node_1.style.dimensions[DIMENSION_HEIGHT] = 10;
2014-12-12 12:03:31 +00:00
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 20;
2014-12-12 12:03:31 +00:00
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 40;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 10;
2014-12-12 12:03:31 +00:00
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 40;
node_1.layout.dimensions[DIMENSION_WIDTH] = 40;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 10;
2014-12-12 12:03:31 +00:00
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 10;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 40;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 10;
2014-12-12 12:03:31 +00:00
}
}
test("should layout flex-wrap", root_node, root_layout);
}
@Test
public void testCase135()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.flexWrap = CSSWrap.WRAP;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 40;
node_1.style.dimensions[DIMENSION_HEIGHT] = 10;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 40;
node_1.style.dimensions[DIMENSION_HEIGHT] = 10;
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 40;
node_1.style.dimensions[DIMENSION_HEIGHT] = 10;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 20;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 60;
node_1.layout.dimensions[DIMENSION_WIDTH] = 40;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 10;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 20;
node_1.layout.dimensions[DIMENSION_WIDTH] = 40;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 10;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 10;
node_1.layout.position[POSITION_LEFT] = 60;
node_1.layout.dimensions[DIMENSION_WIDTH] = 40;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 10;
}
}
test("should layout flex-wrap in rtl", root_node, root_layout);
}
@Test
public void testCase136()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexWrap = CSSWrap.WRAP;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_HEIGHT] = 200;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 0;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
test("should layout flex wrap with a line bigger than container", root_node, root_layout);
}
@Test
public void testCase137()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
node_0.style.maxWidth = 90;
node_0.style.maxHeight = 190;
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 90;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 190;
}
test("should use max bounds", root_node, root_layout);
}
@Test
public void testCase138()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
node_0.style.minWidth = 110;
node_0.style.minHeight = 210;
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 110;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 210;
}
test("should use min bounds", root_node, root_layout);
}
@Test
public void testCase139()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
node_0.style.maxWidth = 90;
node_0.style.maxHeight = 190;
node_0.style.minWidth = 110;
node_0.style.minHeight = 210;
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 110;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 210;
}
test("should use min bounds over max bounds", root_node, root_layout);
}
@Test
public void testCase140()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
node_0.style.maxWidth = 80;
node_0.style.maxHeight = 180;
node_0.style.minWidth = 90;
node_0.style.minHeight = 190;
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 90;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 190;
}
test("should use min bounds over max bounds and natural width", root_node, root_layout);
}
@Test
public void testCase141()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
node_0.style.minWidth = -10;
node_0.style.minHeight = -20;
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
test("should ignore negative min bounds", root_node, root_layout);
}
@Test
public void testCase142()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
node_0.style.maxWidth = -10;
node_0.style.maxHeight = -20;
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
test("should ignore negative max bounds", root_node, root_layout);
}
@Test
public void testCase143()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.maxWidth = 30;
node_0.style.maxHeight = 10;
node_0.setPadding(Spacing.LEFT, 20);
node_0.setPadding(Spacing.TOP, 15);
node_0.setPadding(Spacing.RIGHT, 20);
node_0.setPadding(Spacing.BOTTOM, 15);
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 40;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 30;
}
test("should use padded size over max bounds", root_node, root_layout);
}
@Test
public void testCase144()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.minWidth = 50;
node_0.style.minHeight = 40;
node_0.setPadding(Spacing.LEFT, 20);
node_0.setPadding(Spacing.TOP, 15);
node_0.setPadding(Spacing.RIGHT, 20);
node_0.setPadding(Spacing.BOTTOM, 15);
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 50;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 40;
}
test("should use min size over padded size", root_node, root_layout);
}
@Test
public void testCase145()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.style.minWidth = 200;
node_1 = node_0.getChildAt(2);
node_1.style.flex = 1;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 50;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 250;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
test("should override flex direction size with min bounds", root_node, root_layout);
}
@Test
public void testCase146()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.style.minWidth = 200;
node_1 = node_0.getChildAt(2);
node_1.style.flex = 1;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 250;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 50;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
test("should override flex direction size with min bounds in rtl", root_node, root_layout);
}
@Test
public void testCase147()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.style.maxWidth = 110;
node_1.style.minWidth = 90;
node_1 = node_0.getChildAt(2);
node_1.style.flex = 1;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 100;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 200;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
test("should not override flex direction size within bounds", root_node, root_layout);
}
@Test
public void testCase148()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.style.maxWidth = 110;
node_1.style.minWidth = 90;
node_1 = node_0.getChildAt(2);
node_1.style.flex = 1;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 200;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 100;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
test("should not override flex direction size within bounds in rtl", root_node, root_layout);
}
@Test
public void testCase149()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.style.maxWidth = 60;
node_1 = node_0.getChildAt(2);
node_1.style.flex = 1;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 120;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 120;
node_1.layout.dimensions[DIMENSION_WIDTH] = 60;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 180;
node_1.layout.dimensions[DIMENSION_WIDTH] = 120;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
test("should override flex direction size with max bounds", root_node, root_layout);
}
@Test
public void testCase150()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.style.maxWidth = 60;
node_1 = node_0.getChildAt(2);
node_1.style.flex = 1;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 180;
node_1.layout.dimensions[DIMENSION_WIDTH] = 120;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 120;
node_1.layout.dimensions[DIMENSION_WIDTH] = 60;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 120;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
test("should override flex direction size with max bounds in rtl", root_node, root_layout);
}
@Test
public void testCase151()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1.style.maxWidth = 60;
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.style.maxWidth = 60;
node_1 = node_0.getChildAt(2);
node_1.style.flex = 1;
node_1.style.maxWidth = 60;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 60;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 60;
node_1.layout.dimensions[DIMENSION_WIDTH] = 60;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 120;
node_1.layout.dimensions[DIMENSION_WIDTH] = 60;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
test("should ignore flex size if fully max bound", root_node, root_layout);
}
@Test
public void testCase152()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1.style.maxWidth = 60;
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.style.maxWidth = 60;
node_1 = node_0.getChildAt(2);
node_1.style.flex = 1;
node_1.style.maxWidth = 60;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 240;
node_1.layout.dimensions[DIMENSION_WIDTH] = 60;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 180;
node_1.layout.dimensions[DIMENSION_WIDTH] = 60;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 120;
node_1.layout.dimensions[DIMENSION_WIDTH] = 60;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
test("should ignore flex size if fully max bound in rtl", root_node, root_layout);
}
@Test
public void testCase153()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1.style.minWidth = 120;
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.style.minWidth = 120;
node_1 = node_0.getChildAt(2);
node_1.style.flex = 1;
node_1.style.minWidth = 120;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 120;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 120;
node_1.layout.dimensions[DIMENSION_WIDTH] = 120;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 240;
node_1.layout.dimensions[DIMENSION_WIDTH] = 120;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
test("should ignore flex size if fully min bound", root_node, root_layout);
}
@Test
public void testCase154()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1.style.minWidth = 120;
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.style.minWidth = 120;
node_1 = node_0.getChildAt(2);
node_1.style.flex = 1;
node_1.style.minWidth = 120;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 180;
node_1.layout.dimensions[DIMENSION_WIDTH] = 120;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 60;
node_1.layout.dimensions[DIMENSION_WIDTH] = 120;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = -60;
node_1.layout.dimensions[DIMENSION_WIDTH] = 120;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
test("should ignore flex size if fully min bound in rtl", root_node, root_layout);
}
@Test
public void testCase155()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1.style.maxWidth = 310;
node_1.style.minWidth = 290;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 300;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
test("should pre-fill child size within bounds", root_node, root_layout);
}
@Test
public void testCase156()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1.style.maxWidth = 290;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 290;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
test("should pre-fill child size within max bound", root_node, root_layout);
}
@Test
public void testCase157()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1.style.minWidth = 310;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 310;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
test("should pre-fill child size within min bounds", root_node, root_layout);
}
@Test
public void testCase158()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.maxWidth = 300;
node_0.style.maxHeight = 700;
node_0.style.minWidth = 100;
node_0.style.minHeight = 500;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
node_1.style.dimensions[DIMENSION_HEIGHT] = 300;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
node_1.style.dimensions[DIMENSION_HEIGHT] = 300;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 600;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 300;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 300;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 300;
}
}
test("should set parents size based on bounded children", root_node, root_layout);
}
@Test
public void testCase159()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.maxWidth = 100;
node_0.style.maxHeight = 500;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
node_1.style.dimensions[DIMENSION_HEIGHT] = 300;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
node_1.style.dimensions[DIMENSION_HEIGHT] = 300;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 500;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 300;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 300;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 300;
}
}
test("should set parents size based on max bounded children", root_node, root_layout);
}
@Test
public void testCase160()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.minWidth = 300;
node_0.style.minHeight = 700;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
node_1.style.dimensions[DIMENSION_HEIGHT] = 300;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 200;
node_1.style.dimensions[DIMENSION_HEIGHT] = 300;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 700;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 300;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 300;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 300;
}
}
test("should set parents size based on min bounded children", root_node, root_layout);
}
@Test
public void testCase161()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.alignItems = CSSAlign.STRETCH;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.style.maxWidth = 1100;
node_1.style.maxHeight = 110;
node_1.style.minWidth = 900;
node_1.style.minHeight = 90;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
test("should keep stretched size within bounds", root_node, root_layout);
}
@Test
public void testCase162()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.alignItems = CSSAlign.STRETCH;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.style.maxWidth = 900;
node_1.style.maxHeight = 90;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 90;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 900;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 90;
}
}
test("should keep stretched size within max bounds", root_node, root_layout);
}
@Test
public void testCase163()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.alignItems = CSSAlign.STRETCH;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.style.minWidth = 1100;
node_1.style.minHeight = 110;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 110;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 1100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 110;
}
}
test("should keep stretched size within min bounds", root_node, root_layout);
}
@Test
public void testCase164()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.style.minWidth = 100;
node_1.style.minHeight = 110;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 110;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 110;
}
}
test("should keep cross axis size within min bounds", root_node, root_layout);
}
@Test
public void testCase165()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.style.minWidth = 100;
node_1.style.minHeight = 110;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 110;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 900;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 110;
}
}
test("should keep cross axis size within min bounds in rtl", root_node, root_layout);
}
@Test
public void testCase166()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.maxWidth = 500;
node_1.style.maxHeight = 600;
node_1.style.position[POSITION_LEFT] = 100;
node_1.style.position[POSITION_TOP] = 100;
node_1.style.position[POSITION_RIGHT] = 100;
node_1.style.position[POSITION_BOTTOM] = 100;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 100;
node_1.layout.dimensions[DIMENSION_WIDTH] = 500;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 600;
}
}
test("should layout node with position absolute, top and left and max bounds", root_node, root_layout);
}
@Test
public void testCase167()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.style.minWidth = 900;
node_1.style.minHeight = 1000;
node_1.style.position[POSITION_LEFT] = 100;
node_1.style.position[POSITION_TOP] = 100;
node_1.style.position[POSITION_RIGHT] = 100;
node_1.style.position[POSITION_BOTTOM] = 100;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 100;
node_1.layout.dimensions[DIMENSION_WIDTH] = 900;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000;
}
}
test("should layout node with position absolute, top and left and min bounds", root_node, root_layout);
}
@Test
public void testCase168()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.justifyContent = CSSJustify.CENTER;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1.style.dimensions[DIMENSION_HEIGHT] = 1000;
node_1.style.maxWidth = 600;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 200;
node_1.layout.dimensions[DIMENSION_WIDTH] = 600;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000;
}
}
test("should center flexible item with max size", root_node, root_layout);
}
@Test
public void testCase169()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 1000;
node_0.style.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 1000;
node_1 = node_0.getChildAt(1);
node_1.style.flex = 1;
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 1000;
node_1.style.maxWidth = 200;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 1000;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 800;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 800;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000;
}
}
test("should correctly size flexible items with flex basis and a max width", root_node, root_layout);
}
@Test
public void testCase170()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 400;
node_0.style.dimensions[DIMENSION_HEIGHT] = 400;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.setPadding(Spacing.LEFT, 10);
node_1.setPadding(Spacing.TOP, 10);
node_1.setPadding(Spacing.RIGHT, 10);
node_1.setPadding(Spacing.BOTTOM, 10);
node_1.setPadding(Spacing.START, 10);
node_1.setPadding(Spacing.END, 10);
node_1.style.position[POSITION_LEFT] = 100;
node_1.style.position[POSITION_TOP] = 100;
node_1.style.position[POSITION_RIGHT] = 100;
node_1.style.position[POSITION_BOTTOM] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.positionType = CSSPositionType.ABSOLUTE;
node_2.style.position[POSITION_LEFT] = 10;
node_2.style.position[POSITION_TOP] = 10;
node_2.style.position[POSITION_RIGHT] = 10;
node_2.style.position[POSITION_BOTTOM] = 10;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 400;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 400;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 100;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 10;
node_2.layout.position[POSITION_LEFT] = 10;
node_2.layout.dimensions[DIMENSION_WIDTH] = 180;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 180;
}
}
}
test("should layout absolutely positioned node with absolutely positioned padded parent", root_node, root_layout);
}
@Test
public void testCase171()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 400;
node_0.style.dimensions[DIMENSION_HEIGHT] = 400;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.positionType = CSSPositionType.ABSOLUTE;
node_1.setPadding(Spacing.LEFT, 10);
node_1.setPadding(Spacing.TOP, 10);
node_1.setPadding(Spacing.RIGHT, 10);
node_1.setPadding(Spacing.BOTTOM, 10);
node_1.setPadding(Spacing.START, 10);
node_1.setPadding(Spacing.END, 10);
node_1.setBorder(Spacing.LEFT, 1);
node_1.setBorder(Spacing.TOP, 1);
node_1.setBorder(Spacing.RIGHT, 1);
node_1.setBorder(Spacing.BOTTOM, 1);
node_1.setBorder(Spacing.START, 1);
node_1.setBorder(Spacing.END, 1);
node_1.style.position[POSITION_LEFT] = 100;
node_1.style.position[POSITION_TOP] = 100;
node_1.style.position[POSITION_RIGHT] = 100;
node_1.style.position[POSITION_BOTTOM] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.positionType = CSSPositionType.ABSOLUTE;
node_2.style.position[POSITION_LEFT] = 10;
node_2.style.position[POSITION_TOP] = 10;
node_2.style.position[POSITION_RIGHT] = 10;
node_2.style.position[POSITION_BOTTOM] = 10;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 400;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 400;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 100;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 11;
node_2.layout.position[POSITION_LEFT] = 11;
node_2.layout.dimensions[DIMENSION_WIDTH] = 178;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 178;
}
}
}
test("should layout absolutely positioned node with absolutely positioned padded and bordered parent", root_node, root_layout);
}
@Test
public void testCase172()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 400;
node_0.style.dimensions[DIMENSION_HEIGHT] = 400;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = 1;
node_1.setPadding(Spacing.LEFT, 10);
node_1.setPadding(Spacing.TOP, 10);
node_1.setPadding(Spacing.RIGHT, 10);
node_1.setPadding(Spacing.BOTTOM, 10);
node_1.setPadding(Spacing.START, 10);
node_1.setPadding(Spacing.END, 10);
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.positionType = CSSPositionType.ABSOLUTE;
node_2.style.position[POSITION_LEFT] = 10;
node_2.style.position[POSITION_TOP] = 10;
node_2.style.position[POSITION_RIGHT] = 10;
node_2.style.position[POSITION_BOTTOM] = 10;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 400;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 400;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 400;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 400;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 10;
node_2.layout.position[POSITION_LEFT] = 10;
node_2.layout.dimensions[DIMENSION_WIDTH] = 380;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 380;
}
}
}
test("should layout absolutely positioned node with padded flex 1 parent", root_node, root_layout);
}
@Test
public void testCase173()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flexDirection = CSSFlexDirection.ROW;
addChildren(node_1, 2);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 50;
node_2.style.dimensions[DIMENSION_HEIGHT] = 50;
node_2 = node_1.getChildAt(1);
node_2.style.dimensions[DIMENSION_WIDTH] = 50;
node_2.style.dimensions[DIMENSION_HEIGHT] = 50;
}
node_1 = node_0.getChildAt(1);
node_1.style.direction = CSSDirection.LTR;
node_1.style.flexDirection = CSSFlexDirection.ROW;
addChildren(node_1, 2);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 50;
node_2.style.dimensions[DIMENSION_HEIGHT] = 50;
node_2 = node_1.getChildAt(1);
node_2.style.dimensions[DIMENSION_WIDTH] = 50;
node_2.style.dimensions[DIMENSION_HEIGHT] = 50;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
addChildren(node_1, 2);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 150;
node_2.layout.dimensions[DIMENSION_WIDTH] = 50;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 50;
node_2 = node_1.getChildAt(1);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 100;
node_2.layout.dimensions[DIMENSION_WIDTH] = 50;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 50;
}
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 50;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
addChildren(node_1, 2);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 50;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 50;
node_2 = node_1.getChildAt(1);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 50;
node_2.layout.dimensions[DIMENSION_WIDTH] = 50;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 50;
}
}
}
test("should layout nested nodes with mixed directions", root_node, root_layout);
}
@Test
public void testCase174()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
2015-05-12 09:54:02 +01:00
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.justifyContent = CSSJustify.SPACE_BETWEEN;
node_0.style.flexWrap = CSSWrap.WRAP;
node_0.style.dimensions[DIMENSION_WIDTH] = 320;
node_0.style.dimensions[DIMENSION_HEIGHT] = 200;
2015-05-12 09:54:02 +01:00
addChildren(node_0, 6);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2015-05-12 09:54:02 +01:00
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2015-05-12 09:54:02 +01:00
node_1 = node_0.getChildAt(3);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2015-05-12 09:54:02 +01:00
node_1 = node_0.getChildAt(4);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
2015-05-12 09:54:02 +01:00
node_1 = node_0.getChildAt(5);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 320;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 200;
2015-05-12 09:54:02 +01:00
addChildren(node_0, 6);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 110;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2015-05-12 09:54:02 +01:00
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 220;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2015-05-12 09:54:02 +01:00
node_1 = node_0.getChildAt(3);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2015-05-12 09:54:02 +01:00
node_1 = node_0.getChildAt(4);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 110;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
2015-05-12 09:54:02 +01:00
node_1 = node_0.getChildAt(5);
node_1.layout.position[POSITION_TOP] = 100;
node_1.layout.position[POSITION_LEFT] = 220;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
2015-05-12 09:54:02 +01:00
test("should correctly space wrapped nodes", root_node, root_layout);
}
@Test
public void testCase175()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
node_0.setPadding(Spacing.LEFT, 5);
node_0.setPadding(Spacing.RIGHT, 5);
node_0.setPadding(Spacing.START, 15);
node_0.setPadding(Spacing.END, 15);
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 50;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 15;
node_1.layout.dimensions[DIMENSION_WIDTH] = 170;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
}
}
test("should give start/end padding precedence over left/right padding", root_node, root_layout);
}
@Test
public void testCase176()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.LEFT, 5);
node_1.setMargin(Spacing.RIGHT, 5);
node_1.setMargin(Spacing.START, 15);
node_1.setMargin(Spacing.END, 15);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 50;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 15;
node_1.layout.dimensions[DIMENSION_WIDTH] = 170;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
}
}
test("should give start/end margin precedence over left/right margin", root_node, root_layout);
}
@Test
public void testCase177()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
node_0.setBorder(Spacing.LEFT, 5);
node_0.setBorder(Spacing.RIGHT, 5);
node_0.setBorder(Spacing.START, 15);
node_0.setBorder(Spacing.END, 15);
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 50;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 15;
node_1.layout.dimensions[DIMENSION_WIDTH] = 170;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
}
}
test("should give start/end border precedence over left/right border", root_node, root_layout);
}
@Test
public void testCase178()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
node_0.setPadding(Spacing.START, 15);
node_0.setPadding(Spacing.END, 5);
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 50;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 15;
node_1.layout.dimensions[DIMENSION_WIDTH] = 180;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
}
}
test("should layout node with correct start/end padding", root_node, root_layout);
}
@Test
public void testCase179()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
node_0.setPadding(Spacing.START, 15);
node_0.setPadding(Spacing.END, 5);
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 50;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 5;
node_1.layout.dimensions[DIMENSION_WIDTH] = 180;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
}
}
test("should layout node with correct start/end padding in rtl", root_node, root_layout);
}
@Test
public void testCase180()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.START, 15);
node_1.setMargin(Spacing.END, 5);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 50;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 15;
node_1.layout.dimensions[DIMENSION_WIDTH] = 180;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
}
}
test("should layout node with correct start/end margin", root_node, root_layout);
}
@Test
public void testCase181()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.direction = CSSDirection.RTL;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.START, 15);
node_1.setMargin(Spacing.END, 5);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 50;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 5;
node_1.layout.dimensions[DIMENSION_WIDTH] = 180;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
}
}
test("should layout node with correct start/end margin in rtl", root_node, root_layout);
}
@Test
public void testCase182()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
node_0.setBorder(Spacing.START, 15);
node_0.setBorder(Spacing.END, 5);
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 50;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 15;
node_1.layout.dimensions[DIMENSION_WIDTH] = 180;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
}
}
test("should layout node with correct start/end border", root_node, root_layout);
}
@Test
public void testCase183()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.direction = CSSDirection.RTL;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
node_0.setBorder(Spacing.START, 15);
node_0.setBorder(Spacing.END, 5);
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 50;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 5;
node_1.layout.dimensions[DIMENSION_WIDTH] = 180;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
}
}
test("should layout node with correct start/end border in rtl", root_node, root_layout);
}
@Test
public void testCase184()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 200;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 0;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 0;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
}
}
test("should layout node with a 0 width", root_node, root_layout);
}
@Test
public void testCase185()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.alignItems = CSSAlign.FLEX_START;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 10;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 10;
node_1 = node_0.getChildAt(1);
node_1.style.flexDirection = CSSFlexDirection.COLUMN;
node_1.style.alignItems = CSSAlign.FLEX_START;
node_1.style.flex = 1;
node_1.style.dimensions[DIMENSION_HEIGHT] = 10;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.flex = 1;
node_2.style.dimensions[DIMENSION_HEIGHT] = 10;
node_2.setMeasureFunction(sTestMeasureFunction);
node_2.context = TestConstants.MEASURE_WITH_MATCH_PARENT;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 10;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 10;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 50;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 10;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 50;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 10;
}
}
}
test("should correctly progagate size contraints from flexible parents", root_node, root_layout);
}
@Test
public void testCase186()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.alignItems = CSSAlign.STRETCH;
node_0.style.dimensions[DIMENSION_WIDTH] = 150;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flexDirection = CSSFlexDirection.ROW;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.flexDirection = CSSFlexDirection.ROW;
addChildren(node_2, 1);
{
TestCSSNode node_3;
node_3 = node_2.getChildAt(0);
node_3.style.alignSelf = CSSAlign.CENTER;
}
}
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_HEIGHT] = 150;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 150;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 150;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 10;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 140;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 0;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 140;
addChildren(node_2, 1);
{
TestCSSNode node_3;
node_3 = node_2.getChildAt(0);
node_3.layout.position[POSITION_TOP] = 70;
node_3.layout.position[POSITION_LEFT] = 0;
node_3.layout.dimensions[DIMENSION_WIDTH] = 0;
node_3.layout.dimensions[DIMENSION_HEIGHT] = 0;
}
}
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 150;
}
}
test("should layout content of an item which is stretched late", root_node, root_layout);
}
@Test
public void testCase187()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 200;
node_2.style.dimensions[DIMENSION_HEIGHT] = 200;
}
node_1 = node_0.getChildAt(1);
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 210;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 200;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 200;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 200;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 210;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 190;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 190;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 0;
}
}
}
test("should layout items whose positioning is determined by sibling tree branches", root_node, root_layout);
}
@Test
public void testCase188()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.alignSelf = CSSAlign.FLEX_START;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1 = node_0.getChildAt(1);
node_1.style.alignSelf = CSSAlign.STRETCH;
node_1.style.dimensions[DIMENSION_WIDTH] = 1;
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_HEIGHT] = 150;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 11;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 150;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 10;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 0;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 1;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 150;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 11;
node_1.layout.dimensions[DIMENSION_WIDTH] = 0;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 150;
}
}
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
test("should layout child whose cross axis is null and whose alignSelf is stretch", root_node, root_layout);
}
@Test
public void testCase189()
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 100;
node_2.style.dimensions[DIMENSION_HEIGHT] = 100;
}
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.flexDirection = CSSFlexDirection.COLUMN;
node_2.style.alignItems = CSSAlign.CENTER;
addChildren(node_2, 1);
{
TestCSSNode node_3;
node_3 = node_2.getChildAt(0);
node_3.style.dimensions[DIMENSION_WIDTH] = 50;
node_3.style.dimensions[DIMENSION_HEIGHT] = 50;
}
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 200;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 2);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 100;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 100;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 100;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 50;
addChildren(node_2, 1);
{
TestCSSNode node_3;
node_3 = node_2.getChildAt(0);
node_3.layout.position[POSITION_TOP] = 0;
node_3.layout.position[POSITION_LEFT] = 25;
node_3.layout.dimensions[DIMENSION_WIDTH] = 50;
node_3.layout.dimensions[DIMENSION_HEIGHT] = 50;
}
}
}
}
test("should center items correctly inside a stretched layout", root_node, root_layout);
}
@Test
public void testCase190()
{
TestCSSNode root_node = new TestCSSNode();
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 100;
node_2.style.dimensions[DIMENSION_HEIGHT] = 25;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 25;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 100;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 25;
}
}
}
test("should not shrink column node when there is space left over", root_node, root_layout);
}
@Test
public void testCase191()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 100;
node_2.style.dimensions[DIMENSION_HEIGHT] = 200;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 100;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 200;
}
}
}
test("should shrink column node when there is not any space left over", root_node, root_layout);
}
@Test
public void testCase192()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 25;
node_1 = node_0.getChildAt(1);
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 100;
node_2.style.dimensions[DIMENSION_HEIGHT] = 30;
}
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 15;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 25;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 25;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 30;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 100;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 30;
}
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 55;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 15;
}
}
test("should not shrink column node with siblings when there is space left over", root_node, root_layout);
}
@Test
public void testCase193()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 25;
node_1 = node_0.getChildAt(1);
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 100;
node_2.style.dimensions[DIMENSION_HEIGHT] = 80;
}
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 15;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 25;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 25;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 60;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 100;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 80;
}
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 85;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 15;
}
}
test("should shrink column node with siblings when there is not any space left over", root_node, root_layout);
}
@Test
public void testCase194()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 30;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 40;
node_1 = node_0.getChildAt(2);
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_WIDTH] = 100;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 22.5f;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 22.5f;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 40;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 62.5f;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 37.5f;
}
}
test("should shrink column nodes proportional to their main size when there is not any space left over", root_node, root_layout);
}
@Test
public void testCase195()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 25;
node_2.style.dimensions[DIMENSION_HEIGHT] = 100;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 25;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 25;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
}
test("should not shrink visible row node when there is space left over", root_node, root_layout);
}
@Test
public void testCase196()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 200;
node_2.style.dimensions[DIMENSION_HEIGHT] = 100;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 200;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
}
test("should shrink visible row node when there is not any space left over", root_node, root_layout);
}
@Test
public void testCase197()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 25;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 30;
node_2.style.dimensions[DIMENSION_HEIGHT] = 100;
}
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 15;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 25;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 25;
node_1.layout.dimensions[DIMENSION_WIDTH] = 30;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 30;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 55;
node_1.layout.dimensions[DIMENSION_WIDTH] = 15;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
test("should not shrink visible row node with siblings when there is space left over", root_node, root_layout);
}
@Test
public void testCase198()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 25;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 80;
node_2.style.dimensions[DIMENSION_HEIGHT] = 100;
}
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 15;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 25;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 25;
node_1.layout.dimensions[DIMENSION_WIDTH] = 60;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 80;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 85;
node_1.layout.dimensions[DIMENSION_WIDTH] = 15;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
test("should shrink visible row node with siblings when there is not any space left over", root_node, root_layout);
}
@Test
public void testCase199()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_WIDTH] = 30;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 40;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(2);
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 22.5f;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 22.5f;
node_1.layout.dimensions[DIMENSION_WIDTH] = 40;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 62.5f;
node_1.layout.dimensions[DIMENSION_WIDTH] = 37.5f;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
test("should shrink visible row nodes when there is not any space left over", root_node, root_layout);
}
@Test
public void testCase200()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.overflow = CSSOverflow.HIDDEN;
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 25;
node_2.style.dimensions[DIMENSION_HEIGHT] = 100;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 25;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 25;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
}
test("should not shrink hidden row node when there is space left over", root_node, root_layout);
}
@Test
public void testCase201()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.overflow = CSSOverflow.HIDDEN;
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 200;
node_2.style.dimensions[DIMENSION_HEIGHT] = 100;
}
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 1);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 200;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
}
test("should shrink hidden row node when there is not any space left over", root_node, root_layout);
}
@Test
public void testCase202()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 25;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.overflow = CSSOverflow.HIDDEN;
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 30;
node_2.style.dimensions[DIMENSION_HEIGHT] = 100;
}
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 15;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 25;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 25;
node_1.layout.dimensions[DIMENSION_WIDTH] = 30;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 30;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 55;
node_1.layout.dimensions[DIMENSION_WIDTH] = 15;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
test("should not shrink hidden row node with siblings when there is space left over", root_node, root_layout);
}
@Test
public void testCase203()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 25;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.overflow = CSSOverflow.HIDDEN;
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.dimensions[DIMENSION_WIDTH] = 80;
node_2.style.dimensions[DIMENSION_HEIGHT] = 100;
}
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 15;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 25;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 25;
node_1.layout.dimensions[DIMENSION_WIDTH] = 60;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 80;
node_2.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 85;
node_1.layout.dimensions[DIMENSION_WIDTH] = 15;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
test("should shrink hidden row node with siblings when there is not any space left over", root_node, root_layout);
}
@Test
public void testCase204()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 100;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.overflow = CSSOverflow.HIDDEN;
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_WIDTH] = 30;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 40;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(2);
node_1.style.overflow = CSSOverflow.HIDDEN;
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 100;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 22.5f;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 22.5f;
node_1.layout.dimensions[DIMENSION_WIDTH] = 40;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 62.5f;
node_1.layout.dimensions[DIMENSION_WIDTH] = 37.5f;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
test("should shrink hidden row nodes proportional to their main size when there is not any space left over", root_node, root_layout);
}
@Test
public void testCase205()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 213;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 25;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.flexDirection = CSSFlexDirection.ROW;
node_1.style.alignItems = CSSAlign.FLEX_START;
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.setMeasureFunction(sTestMeasureFunction);
node_2.context = TestConstants.LONG_TEXT;
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
}
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 15;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 213;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 25;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 25;
node_1.layout.dimensions[DIMENSION_WIDTH] = TestConstants.BIG_WIDTH;
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = TestConstants.BIG_WIDTH;
node_2.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.SMALL_HEIGHT;
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
}
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 197;
node_1.layout.dimensions[DIMENSION_WIDTH] = 15;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
test("should not shrink text node with siblings when there is space left over", root_node, root_layout);
}
@Test
public void testCase206()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.dimensions[DIMENSION_WIDTH] = 140;
node_0.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 25;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.style.flexDirection = CSSFlexDirection.ROW;
node_1.style.alignItems = CSSAlign.FLEX_START;
node_1.style.flex = -1;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.style.flex = -1;
node_2.setMeasureFunction(sTestMeasureFunction);
node_2.context = TestConstants.LONG_TEXT;
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
}
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 15;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 140;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_0, 3);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 0;
node_1.layout.dimensions[DIMENSION_WIDTH] = 25;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 25;
node_1.layout.dimensions[DIMENSION_WIDTH] = 100;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
addChildren(node_1, 1);
{
TestCSSNode node_2;
node_2 = node_1.getChildAt(0);
node_2.layout.position[POSITION_TOP] = 0;
node_2.layout.position[POSITION_LEFT] = 0;
node_2.layout.dimensions[DIMENSION_WIDTH] = 100;
node_2.layout.dimensions[DIMENSION_HEIGHT] = TestConstants.BIG_HEIGHT;
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
}
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 0;
node_1.layout.position[POSITION_LEFT] = 125;
node_1.layout.dimensions[DIMENSION_WIDTH] = 15;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
}
}
test("should shrink text node with siblings when there is not any space left over", root_node, root_layout);
}
@Test
public void testCase207()
Alter layout engine to conform closer to W3C spec The primary goals of this change are: - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/) and a clear articulation of the areas where it deviates from the spec. - Support for flex-shrink. - Conformance with layout effects of "overflow: hidden". Specifically, here are the limitations of this implementation as compared to the W3C flexbox standard (this is also documented in Layout.js): - Display property is always assumed to be 'flex' except for Text nodes, which are assumed to be 'inline-flex'. - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are stacked in document order. - The 'order' property is not supported. The order of flex items is always defined by document order. - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse' and 'hidden' are not supported. - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The rarely-used 'wrap-reverse' is not supported. - Rather than allowing arbitrary combinations of flexGrow, flexShrink and flexBasis, this algorithm supports only the three most common combinations: - flex: 0 is equiavlent to flex: 0 0 auto - flex: n (where n is a positive value) is equivalent to flex: n 0 0 - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto - Margins cannot be specified as 'auto'. They must be specified in terms of pixel values, and the default value is 0. - The 'baseline' value is not supported for alignItems and alignSelf properties. - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be specified as pixel values, not as percentages. - There is no support for calculation of dimensions based on intrinsic aspect ratios (e.g. images). - There is no support for forced breaks. - It does not support vertical inline directions (top-to-bottom or bottom-to-top text). And here is how the implementation deviates from the standard (this is also documented in Layout.js): - Section 4.5 of the spec indicates that all flex items have a default minimum main size. For text blocks, for example, this is the width of the widest word. Calculating the minimum width is expensive, so we forego it and assume a default minimum main size of 0. - Min/Max sizes in the main axis are not honored when resolving flexible lengths. - The spec indicates that the default value for 'flexDirection' is 'row', but the algorithm below assumes a default of 'column'.
2016-04-26 16:35:46 -07:00
{
TestCSSNode root_node = new TestCSSNode();
{
TestCSSNode node_0 = root_node;
node_0.style.flexDirection = CSSFlexDirection.ROW;
node_0.style.alignContent = CSSAlign.STRETCH;
node_0.style.alignItems = CSSAlign.FLEX_START;
node_0.style.flexWrap = CSSWrap.WRAP;
node_0.style.dimensions[DIMENSION_WIDTH] = 300;
node_0.style.dimensions[DIMENSION_HEIGHT] = 380;
addChildren(node_0, 15);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
node_1 = node_0.getChildAt(1);
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
node_1 = node_0.getChildAt(2);
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
node_1 = node_0.getChildAt(3);
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
node_1 = node_0.getChildAt(4);
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
node_1 = node_0.getChildAt(5);
node_1.style.alignSelf = CSSAlign.FLEX_START;
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
node_1 = node_0.getChildAt(6);
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
node_1 = node_0.getChildAt(7);
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 100;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
node_1 = node_0.getChildAt(8);
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
node_1 = node_0.getChildAt(9);
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
node_1 = node_0.getChildAt(10);
node_1.style.alignSelf = CSSAlign.FLEX_START;
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
node_1 = node_0.getChildAt(11);
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
node_1 = node_0.getChildAt(12);
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
node_1 = node_0.getChildAt(13);
node_1.style.alignSelf = CSSAlign.FLEX_START;
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
node_1 = node_0.getChildAt(14);
node_1.style.dimensions[DIMENSION_WIDTH] = 50;
node_1.style.dimensions[DIMENSION_HEIGHT] = 50;
node_1.setMargin(Spacing.LEFT, 10);
node_1.setMargin(Spacing.TOP, 10);
node_1.setMargin(Spacing.RIGHT, 10);
node_1.setMargin(Spacing.BOTTOM, 10);
node_1.setMargin(Spacing.START, 10);
node_1.setMargin(Spacing.END, 10);
}
}
TestCSSNode root_layout = new TestCSSNode();
{
TestCSSNode node_0 = root_layout;
node_0.layout.position[POSITION_TOP] = 0;
node_0.layout.position[POSITION_LEFT] = 0;
node_0.layout.dimensions[DIMENSION_WIDTH] = 300;
node_0.layout.dimensions[DIMENSION_HEIGHT] = 380;
addChildren(node_0, 15);
{
TestCSSNode node_1;
node_1 = node_0.getChildAt(0);
node_1.layout.position[POSITION_TOP] = 10;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
node_1 = node_0.getChildAt(1);
node_1.layout.position[POSITION_TOP] = 10;
node_1.layout.position[POSITION_LEFT] = 80;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
node_1 = node_0.getChildAt(2);
node_1.layout.position[POSITION_TOP] = 10;
node_1.layout.position[POSITION_LEFT] = 150;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
node_1 = node_0.getChildAt(3);
node_1.layout.position[POSITION_TOP] = 10;
node_1.layout.position[POSITION_LEFT] = 220;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
node_1 = node_0.getChildAt(4);
node_1.layout.position[POSITION_TOP] = 92.5f;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(5);
node_1.layout.position[POSITION_TOP] = 92.5f;
node_1.layout.position[POSITION_LEFT] = 80;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
node_1 = node_0.getChildAt(6);
node_1.layout.position[POSITION_TOP] = 92.5f;
node_1.layout.position[POSITION_LEFT] = 150;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
node_1 = node_0.getChildAt(7);
node_1.layout.position[POSITION_TOP] = 92.5f;
node_1.layout.position[POSITION_LEFT] = 220;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 100;
node_1 = node_0.getChildAt(8);
node_1.layout.position[POSITION_TOP] = 225;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
node_1 = node_0.getChildAt(9);
node_1.layout.position[POSITION_TOP] = 225;
node_1.layout.position[POSITION_LEFT] = 80;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
node_1 = node_0.getChildAt(10);
node_1.layout.position[POSITION_TOP] = 225;
node_1.layout.position[POSITION_LEFT] = 150;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
node_1 = node_0.getChildAt(11);
node_1.layout.position[POSITION_TOP] = 225;
node_1.layout.position[POSITION_LEFT] = 220;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
node_1 = node_0.getChildAt(12);
node_1.layout.position[POSITION_TOP] = 307.5f;
node_1.layout.position[POSITION_LEFT] = 10;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
node_1 = node_0.getChildAt(13);
node_1.layout.position[POSITION_TOP] = 307.5f;
node_1.layout.position[POSITION_LEFT] = 80;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
node_1 = node_0.getChildAt(14);
node_1.layout.position[POSITION_TOP] = 307.5f;
node_1.layout.position[POSITION_LEFT] = 150;
node_1.layout.dimensions[DIMENSION_WIDTH] = 50;
node_1.layout.dimensions[DIMENSION_HEIGHT] = 50;
}
}
test("should layout with alignContent: stretch, and alignItems: flex-start", root_node, root_layout);
}
2014-09-18 15:15:21 -07:00
/** END_GENERATED **/
}