Files
yoga/tests/Layout-test.c

9383 lines
328 KiB
C
Raw Normal View History

/**
* Copyright (c) 2014, 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.
*/
#include "../Layout.h"
2014-04-28 12:36:36 -07:00
#include "../Layout-test-utils.h"
2014-04-18 17:15:03 -07:00
2014-06-11 21:00:57 -07:00
// @generated by transpile.html
int main()
{
/** START_GENERATED **/
2014-04-18 17:15:03 -07:00
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 200;
2014-04-19 14:26:19 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
2014-04-19 14:26:19 -07:00
}
2014-04-19 14:35:54 -07:00
test("should layout a single node with width and height", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 3);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 500;
node_1->style.dimensions[CSS_HEIGHT] = 500;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 250;
node_1->style.dimensions[CSS_HEIGHT] = 250;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 2);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 125;
node_1->style.dimensions[CSS_HEIGHT] = 125;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 3);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 500;
node_1->layout.dimensions[CSS_HEIGHT] = 500;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 500;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 250;
node_1->layout.dimensions[CSS_HEIGHT] = 250;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 2);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 750;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 125;
node_1->layout.dimensions[CSS_HEIGHT] = 125;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with children", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 500;
node_1->style.dimensions[CSS_HEIGHT] = 500;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 250;
node_1->style.dimensions[CSS_HEIGHT] = 250;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 125;
node_1->style.dimensions[CSS_HEIGHT] = 125;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 500;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 500;
node_1->layout.dimensions[CSS_HEIGHT] = 500;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 250;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 250;
node_1->layout.dimensions[CSS_HEIGHT] = 250;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 125;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 125;
node_1->layout.dimensions[CSS_HEIGHT] = 125;
}
}
test("should layout node with children in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-18 17:15:03 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 500;
node_1->style.dimensions[CSS_HEIGHT] = 500;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 500;
node_1->style.dimensions[CSS_HEIGHT] = 500;
init_css_node_children(node_1, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
2014-05-16 18:04:24 -07:00
node_2->style.dimensions[CSS_WIDTH] = 250;
node_2->style.dimensions[CSS_HEIGHT] = 250;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 1);
2014-05-16 18:04:24 -07:00
node_2->style.dimensions[CSS_WIDTH] = 250;
node_2->style.dimensions[CSS_HEIGHT] = 250;
2014-04-19 14:26:19 -07:00
}
}
2014-04-18 17:15:03 -07:00
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 500;
node_1->layout.dimensions[CSS_HEIGHT] = 500;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 500;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 500;
node_1->layout.dimensions[CSS_HEIGHT] = 500;
init_css_node_children(node_1, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
2014-05-16 18:04:24 -07:00
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 250;
node_2->layout.dimensions[CSS_HEIGHT] = 250;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 1);
2014-05-16 18:04:24 -07:00
node_2->layout.position[CSS_TOP] = 250;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 250;
node_2->layout.dimensions[CSS_HEIGHT] = 250;
2014-04-19 14:26:19 -07:00
}
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with nested children", root_node, root_layout);
2014-04-18 17:15:03 -07:00
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 500;
node_1->style.dimensions[CSS_HEIGHT] = 500;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_1->style.dimensions[CSS_WIDTH] = 500;
node_1->style.dimensions[CSS_HEIGHT] = 500;
init_css_node_children(node_1, 2);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 250;
node_2->style.dimensions[CSS_HEIGHT] = 250;
node_2 = node_1->get_child(node_1->context, 1);
node_2->style.dimensions[CSS_WIDTH] = 250;
node_2->style.dimensions[CSS_HEIGHT] = 250;
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 500;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 500;
node_1->layout.dimensions[CSS_HEIGHT] = 500;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 500;
node_1->layout.dimensions[CSS_HEIGHT] = 500;
init_css_node_children(node_1, 2);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 250;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 250;
node_2->layout.dimensions[CSS_HEIGHT] = 250;
node_2 = node_1->get_child(node_1->context, 1);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 250;
node_2->layout.dimensions[CSS_HEIGHT] = 250;
}
}
}
test("should layout node with nested children in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 200;
node_0->style.margin[CSS_LEFT] = 10;
node_0->style.margin[CSS_TOP] = 10;
node_0->style.margin[CSS_RIGHT] = 10;
node_0->style.margin[CSS_BOTTOM] = 10;
node_0->style.margin[CSS_START] = 10;
node_0->style.margin[CSS_END] = 10;
2014-04-19 14:26:19 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 10;
node_0->layout.position[CSS_LEFT] = 10;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
2014-04-19 14:26:19 -07:00
}
2014-04-19 14:35:54 -07:00
test("should layout node with margin", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
node_0->style.margin[CSS_LEFT] = 10;
node_0->style.margin[CSS_TOP] = 10;
node_0->style.margin[CSS_RIGHT] = 10;
node_0->style.margin[CSS_BOTTOM] = 10;
node_0->style.margin[CSS_START] = 10;
node_0->style.margin[CSS_END] = 10;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 3);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.margin[CSS_LEFT] = 50;
node_1->style.margin[CSS_TOP] = 50;
node_1->style.margin[CSS_RIGHT] = 50;
node_1->style.margin[CSS_BOTTOM] = 50;
node_1->style.margin[CSS_START] = 50;
node_1->style.margin[CSS_END] = 50;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.margin[CSS_LEFT] = 25;
node_1->style.margin[CSS_TOP] = 25;
node_1->style.margin[CSS_RIGHT] = 25;
node_1->style.margin[CSS_BOTTOM] = 25;
node_1->style.margin[CSS_START] = 25;
node_1->style.margin[CSS_END] = 25;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 2);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 10;
node_0->layout.position[CSS_LEFT] = 10;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 3);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 50;
node_1->layout.position[CSS_LEFT] = 50;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 225;
node_1->layout.position[CSS_LEFT] = 25;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 2);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 360;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with several children", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
node_0->style.margin[CSS_LEFT] = 10;
node_0->style.margin[CSS_TOP] = 10;
node_0->style.margin[CSS_RIGHT] = 10;
node_0->style.margin[CSS_BOTTOM] = 10;
node_0->style.margin[CSS_START] = 10;
node_0->style.margin[CSS_END] = 10;
init_css_node_children(node_0, 3);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.margin[CSS_LEFT] = 50;
node_1->style.margin[CSS_TOP] = 50;
node_1->style.margin[CSS_RIGHT] = 50;
node_1->style.margin[CSS_BOTTOM] = 50;
node_1->style.margin[CSS_START] = 50;
node_1->style.margin[CSS_END] = 50;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.margin[CSS_LEFT] = 25;
node_1->style.margin[CSS_TOP] = 25;
node_1->style.margin[CSS_RIGHT] = 25;
node_1->style.margin[CSS_BOTTOM] = 25;
node_1->style.margin[CSS_START] = 25;
node_1->style.margin[CSS_END] = 25;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 10;
node_0->layout.position[CSS_LEFT] = 10;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 3);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 850;
node_1->layout.position[CSS_LEFT] = 50;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 675;
node_1->layout.position[CSS_LEFT] = 25;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 540;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with several children in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW_REVERSE;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 200;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 300;
node_1->style.dimensions[CSS_HEIGHT] = 150;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 100;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 300;
node_1->layout.dimensions[CSS_HEIGHT] = 150;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout rtl with reverse correctly", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 200;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 300;
node_1->style.dimensions[CSS_HEIGHT] = 150;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 100;
node_1->layout.dimensions[CSS_WIDTH] = 300;
node_1->layout.dimensions[CSS_HEIGHT] = 150;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with row flex direction", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-18 17:15:03 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 300;
node_1->style.dimensions[CSS_HEIGHT] = 150;
2014-04-18 17:15:03 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 900;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 600;
node_1->layout.dimensions[CSS_WIDTH] = 300;
node_1->layout.dimensions[CSS_HEIGHT] = 150;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with row flex direction in rtl", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 300;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 200;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 300;
node_1->style.dimensions[CSS_HEIGHT] = 150;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 350;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 200;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 300;
node_1->layout.dimensions[CSS_HEIGHT] = 150;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node based on children main dimensions", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.dimensions[CSS_WIDTH] = 300;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 200;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 300;
node_1->style.dimensions[CSS_HEIGHT] = 150;
2014-04-19 14:26:19 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 350;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 150;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 300;
node_1->layout.dimensions[CSS_HEIGHT] = 150;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node based on children main dimensions in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 200;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 200;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 800;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with just flex", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 200;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 800;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 800;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with just flex in reverse", root_node, root_layout);
2014-04-19 14:26:19 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1->style.dimensions[CSS_WIDTH] = 1000;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.flex = 1;
node_2->style.dimensions[CSS_WIDTH] = 1000;
init_css_node_children(node_2, 1);
{
css_node_t *node_3;
node_3 = node_2->get_child(node_2->context, 0);
node_3->style.flex = 1;
node_3->style.dimensions[CSS_WIDTH] = 1000;
}
}
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 1000;
node_1->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 1000;
node_2->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_2, 1);
{
css_node_t *node_3;
node_3 = node_2->get_child(node_2->context, 0);
node_3->layout.position[CSS_TOP] = 0;
node_3->layout.position[CSS_LEFT] = 0;
node_3->layout.dimensions[CSS_WIDTH] = 1000;
node_3->layout.dimensions[CSS_HEIGHT] = 1000;
}
}
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with flex recursively", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_1->style.flex = 1;
node_1->style.dimensions[CSS_WIDTH] = 1000;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_2->style.flex = 1;
node_2->style.dimensions[CSS_WIDTH] = 1000;
init_css_node_children(node_2, 1);
{
css_node_t *node_3;
node_3 = node_2->get_child(node_2->context, 0);
node_3->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_3->style.flex = 1;
node_3->style.dimensions[CSS_WIDTH] = 1000;
}
}
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 1000;
node_1->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 1000;
node_2->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_2, 1);
{
css_node_t *node_3;
node_3 = node_2->get_child(node_2->context, 0);
node_3->layout.position[CSS_TOP] = 0;
node_3->layout.position[CSS_LEFT] = 0;
node_3->layout.dimensions[CSS_WIDTH] = 1000;
node_3->layout.dimensions[CSS_HEIGHT] = 1000;
}
}
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with flex recursively in reverse", root_node, root_layout);
}
2014-04-18 17:15:03 -07:00
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
node_0->style.margin[CSS_LEFT] = 5;
node_0->style.margin[CSS_TOP] = 10;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.margin[CSS_LEFT] = 15;
node_1->style.margin[CSS_TOP] = 50;
node_1->style.margin[CSS_BOTTOM] = 20;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.margin[CSS_LEFT] = 30;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 10;
node_0->layout.position[CSS_LEFT] = 5;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 50;
node_1->layout.position[CSS_LEFT] = 15;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 170;
node_1->layout.position[CSS_LEFT] = 30;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with targeted margin", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
node_0->style.margin[CSS_LEFT] = 5;
node_0->style.margin[CSS_TOP] = 10;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 100;
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.margin[CSS_LEFT] = 15;
node_1->style.margin[CSS_TOP] = 50;
node_1->style.margin[CSS_BOTTOM] = 20;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.margin[CSS_LEFT] = 30;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 10;
node_0->layout.position[CSS_LEFT] = 5;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 880;
node_1->layout.position[CSS_LEFT] = 15;
node_1->layout.dimensions[CSS_WIDTH] = 100;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 730;
node_1->layout.position[CSS_LEFT] = 30;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with targeted margin in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.justify_content = CSS_JUSTIFY_FLEX_START;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 100;
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with justifyContent: flex-start", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.justify_content = CSS_JUSTIFY_FLEX_START;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 100;
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 900;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 800;
node_1->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with justifyContent: flex-start in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.justify_content = CSS_JUSTIFY_FLEX_END;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 100;
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 800;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 900;
node_1->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with justifyContent: flex-end", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.justify_content = CSS_JUSTIFY_FLEX_END;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 100;
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with justifyContent: flex-end in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.justify_content = CSS_JUSTIFY_SPACE_BETWEEN;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 900;
node_1->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with justifyContent: space-between", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.justify_content = CSS_JUSTIFY_SPACE_BETWEEN;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 900;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with justifyContent: space-between in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.justify_content = CSS_JUSTIFY_SPACE_AROUND;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 200;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 700;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with justifyContent: space-around", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.justify_content = CSS_JUSTIFY_SPACE_AROUND;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 700;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 200;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with justifyContent: space-around in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.justify_content = CSS_JUSTIFY_CENTER;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 400;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 500;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with justifyContent: center", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.justify_content = CSS_JUSTIFY_CENTER;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 500;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 400;
node_1->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with justifyContent: center in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 1000;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with flex override height", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.align_items = CSS_ALIGN_FLEX_START;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 200;
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 100;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with alignItems: flex-start", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.align_items = CSS_ALIGN_FLEX_START;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 200;
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 900;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 800;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with alignItems: flex-start in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.align_items = CSS_ALIGN_CENTER;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 200;
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 400;
node_1->layout.dimensions[CSS_WIDTH] = 200;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 450;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with alignItems: center", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.align_items = CSS_ALIGN_CENTER;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 200;
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 900;
node_1->layout.position[CSS_LEFT] = 400;
node_1->layout.dimensions[CSS_WIDTH] = 200;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 800;
node_1->layout.position[CSS_LEFT] = 450;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with alignItems: center in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.align_items = CSS_ALIGN_FLEX_END;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 200;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 800;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 900;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with alignItems: flex-end", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.align_items = CSS_ALIGN_FLEX_END;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 200;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 900;
node_1->layout.position[CSS_LEFT] = 800;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 800;
node_1->layout.position[CSS_LEFT] = 900;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with alignItems: flex-end in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.align_items = CSS_ALIGN_FLEX_END;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 200;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.align_self = CSS_ALIGN_CENTER;
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 800;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 450;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with alignSelf overrides alignItems", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
2014-05-16 18:04:24 -07:00
node_0->style.align_items = CSS_ALIGN_FLEX_END;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 200;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.align_self = CSS_ALIGN_CENTER;
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 900;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 800;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 800;
node_1->layout.position[CSS_LEFT] = 450;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with alignSelf overrides alignItems in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.align_items = CSS_ALIGN_STRETCH;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:26:19 -07:00
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 1000;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with alignItem: stretch", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
2014-05-16 18:04:24 -07:00
node_0->style.align_items = CSS_ALIGN_STRETCH;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 900;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 1000;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with alignItem: stretch in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-04-19 14:26:19 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-19 14:26:19 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout empty node", root_node, root_layout);
2014-04-18 17:15:03 -07:00
}
2014-04-19 22:08:10 -07:00
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
test("should layout empty node in reverse", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.margin[CSS_LEFT] = 5;
node_1->style.margin[CSS_TOP] = 5;
node_1->style.margin[CSS_RIGHT] = 5;
node_1->style.margin[CSS_BOTTOM] = 5;
node_1->style.margin[CSS_START] = 5;
node_1->style.margin[CSS_END] = 5;
2014-04-19 22:08:10 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 10;
node_0->layout.dimensions[CSS_HEIGHT] = 10;
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 5;
node_1->layout.position[CSS_LEFT] = 5;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-19 22:08:10 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout child with margin", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.margin[CSS_LEFT] = 5;
node_1->style.margin[CSS_TOP] = 5;
node_1->style.margin[CSS_RIGHT] = 5;
node_1->style.margin[CSS_BOTTOM] = 5;
node_1->style.margin[CSS_START] = 5;
node_1->style.margin[CSS_END] = 5;
2014-04-19 22:08:10 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 10;
node_0->layout.dimensions[CSS_HEIGHT] = 10;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 5;
node_1->layout.position[CSS_LEFT] = 5;
node_1->layout.dimensions[CSS_WIDTH] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-19 22:08:10 -07:00
}
}
test("should layout child with margin in reverse", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 200;
2014-04-19 14:26:19 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
2014-04-19 14:26:19 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-04-19 14:35:54 -07:00
test("should not shrink children if not enough space", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_HEIGHT] = 200;
}
2014-04-19 22:08:10 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 2);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = -200;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
test("should not shrink children if not enough space in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.justify_content = CSS_JUSTIFY_CENTER;
2014-04-19 14:26:19 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-19 22:08:10 -07:00
}
2014-04-19 14:35:54 -07:00
test("should layout for center", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.justify_content = CSS_JUSTIFY_FLEX_END;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.margin[CSS_TOP] = 10;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
test("should layout flex-end taking into account margin", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.justify_content = CSS_JUSTIFY_FLEX_END;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.margin[CSS_TOP] = 10;
2014-04-19 22:08:10 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 10;
node_1->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-19 22:08:10 -07:00
}
}
test("should layout flex-end taking into account margin in reverse", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.align_items = CSS_ALIGN_FLEX_END;
init_css_node_children(node_1, 2);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.margin[CSS_LEFT] = 10;
node_2->style.margin[CSS_TOP] = 10;
node_2->style.margin[CSS_RIGHT] = 10;
node_2->style.margin[CSS_BOTTOM] = 10;
node_2->style.margin[CSS_START] = 10;
node_2->style.margin[CSS_END] = 10;
node_2 = node_1->get_child(node_1->context, 1);
node_2->style.dimensions[CSS_HEIGHT] = 100;
}
2014-04-19 22:08:10 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 20;
node_0->layout.dimensions[CSS_HEIGHT] = 120;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 20;
node_1->layout.dimensions[CSS_HEIGHT] = 120;
init_css_node_children(node_1, 2);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 10;
node_2->layout.position[CSS_LEFT] = 10;
node_2->layout.dimensions[CSS_WIDTH] = 0;
node_2->layout.dimensions[CSS_HEIGHT] = 0;
node_2 = node_1->get_child(node_1->context, 1);
node_2->layout.position[CSS_TOP] = 20;
node_2->layout.position[CSS_LEFT] = 20;
node_2->layout.dimensions[CSS_WIDTH] = 0;
node_2->layout.dimensions[CSS_HEIGHT] = 100;
}
2014-04-19 22:08:10 -07:00
}
}
test("should layout alignItems with margin", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
2014-05-16 18:04:24 -07:00
node_1->style.align_items = CSS_ALIGN_FLEX_END;
init_css_node_children(node_1, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
2014-05-16 18:04:24 -07:00
node_2->style.margin[CSS_LEFT] = 10;
node_2->style.margin[CSS_TOP] = 10;
node_2->style.margin[CSS_RIGHT] = 10;
node_2->style.margin[CSS_BOTTOM] = 10;
node_2->style.margin[CSS_START] = 10;
node_2->style.margin[CSS_END] = 10;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 1);
2014-05-16 18:04:24 -07:00
node_2->style.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
2014-04-19 22:08:10 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 20;
node_0->layout.dimensions[CSS_HEIGHT] = 120;
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 20;
node_1->layout.dimensions[CSS_HEIGHT] = 120;
init_css_node_children(node_1, 2);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 110;
2014-05-16 18:04:24 -07:00
node_2->layout.position[CSS_LEFT] = 10;
node_2->layout.dimensions[CSS_WIDTH] = 0;
node_2->layout.dimensions[CSS_HEIGHT] = 0;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 1);
node_2->layout.position[CSS_TOP] = 0;
2014-05-16 18:04:24 -07:00
node_2->layout.position[CSS_LEFT] = 20;
node_2->layout.dimensions[CSS_WIDTH] = 0;
node_2->layout.dimensions[CSS_HEIGHT] = 100;
2014-04-19 14:26:19 -07:00
}
2014-04-19 22:08:10 -07:00
}
}
test("should layout alignItems with margin in reverse", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-04-19 14:35:54 -07:00
test("should layout flex inside of an empty element", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.align_items = CSS_ALIGN_STRETCH;
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.margin[CSS_LEFT] = 10;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 10;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-04-19 14:35:54 -07:00
test("should layout alignItems stretch and margin", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.align_items = CSS_ALIGN_STRETCH;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.margin[CSS_LEFT] = 10;
2014-04-19 22:08:10 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 10;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-19 22:08:10 -07:00
}
}
test("should layout alignItems stretch and margin in reverse", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.padding[CSS_LEFT] = 5;
node_0->style.padding[CSS_TOP] = 5;
node_0->style.padding[CSS_RIGHT] = 5;
node_0->style.padding[CSS_BOTTOM] = 5;
node_0->style.padding[CSS_START] = 5;
node_0->style.padding[CSS_END] = 5;
2014-04-19 22:08:10 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 10;
node_0->layout.dimensions[CSS_HEIGHT] = 10;
2014-04-19 22:08:10 -07:00
}
2014-04-19 14:35:54 -07:00
test("should layout node with padding", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.padding[CSS_LEFT] = 5;
node_0->style.padding[CSS_TOP] = 5;
node_0->style.padding[CSS_RIGHT] = 5;
node_0->style.padding[CSS_BOTTOM] = 5;
node_0->style.padding[CSS_START] = 5;
node_0->style.padding[CSS_END] = 5;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-04-19 22:08:10 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 10;
node_0->layout.dimensions[CSS_HEIGHT] = 10;
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 5;
node_1->layout.position[CSS_LEFT] = 5;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-19 22:08:10 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with padding and a child", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.padding[CSS_LEFT] = 5;
node_0->style.padding[CSS_TOP] = 5;
node_0->style.padding[CSS_RIGHT] = 5;
node_0->style.padding[CSS_BOTTOM] = 5;
node_0->style.padding[CSS_START] = 5;
node_0->style.padding[CSS_END] = 5;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.margin[CSS_LEFT] = 5;
node_1->style.margin[CSS_TOP] = 5;
node_1->style.margin[CSS_RIGHT] = 5;
node_1->style.margin[CSS_BOTTOM] = 5;
node_1->style.margin[CSS_START] = 5;
node_1->style.margin[CSS_END] = 5;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 20;
node_0->layout.dimensions[CSS_HEIGHT] = 20;
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 10;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-04-19 14:35:54 -07:00
test("should layout node with padding and a child with margin", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.align_self = CSS_ALIGN_STRETCH;
node_1->style.padding[CSS_LEFT] = 10;
node_1->style.padding[CSS_TOP] = 10;
node_1->style.padding[CSS_RIGHT] = 10;
node_1->style.padding[CSS_BOTTOM] = 10;
node_1->style.padding[CSS_START] = 10;
node_1->style.padding[CSS_END] = 10;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 20;
node_0->layout.dimensions[CSS_HEIGHT] = 20;
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 20;
node_1->layout.dimensions[CSS_HEIGHT] = 20;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-04-19 14:35:54 -07:00
test("should layout node with padding and stretch", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.padding[CSS_LEFT] = 50;
node_0->style.padding[CSS_TOP] = 50;
node_0->style.padding[CSS_RIGHT] = 50;
node_0->style.padding[CSS_BOTTOM] = 50;
node_0->style.padding[CSS_START] = 50;
node_0->style.padding[CSS_END] = 50;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.align_self = CSS_ALIGN_STRETCH;
node_1->style.padding[CSS_LEFT] = 10;
node_1->style.padding[CSS_TOP] = 10;
node_1->style.padding[CSS_RIGHT] = 10;
node_1->style.padding[CSS_BOTTOM] = 10;
node_1->style.padding[CSS_START] = 10;
node_1->style.padding[CSS_END] = 10;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 120;
node_0->layout.dimensions[CSS_HEIGHT] = 120;
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 50;
node_1->layout.position[CSS_LEFT] = 50;
node_1->layout.dimensions[CSS_WIDTH] = 20;
node_1->layout.dimensions[CSS_HEIGHT] = 20;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-04-19 14:35:54 -07:00
test("should layout node with inner & outer padding and stretch", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.align_self = CSS_ALIGN_STRETCH;
init_css_node_children(node_1, 1);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
2014-05-16 18:04:24 -07:00
node_2->style.margin[CSS_LEFT] = 16;
node_2->style.margin[CSS_TOP] = 16;
node_2->style.margin[CSS_RIGHT] = 16;
node_2->style.margin[CSS_BOTTOM] = 16;
node_2->style.margin[CSS_START] = 16;
node_2->style.margin[CSS_END] = 16;
2014-04-19 14:26:19 -07:00
}
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 32;
node_0->layout.dimensions[CSS_HEIGHT] = 32;
init_css_node_children(node_0, 1);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 32;
node_1->layout.dimensions[CSS_HEIGHT] = 32;
init_css_node_children(node_1, 1);
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
2014-05-16 18:04:24 -07:00
node_2->layout.position[CSS_TOP] = 16;
node_2->layout.position[CSS_LEFT] = 16;
node_2->layout.dimensions[CSS_WIDTH] = 0;
node_2->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-19 14:26:19 -07:00
}
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-04-19 14:35:54 -07:00
test("should layout node with stretch and child with margin", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.position[CSS_LEFT] = 5;
node_0->style.position[CSS_TOP] = 5;
2014-04-19 22:08:10 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 5;
node_0->layout.position[CSS_LEFT] = 5;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-19 22:08:10 -07:00
}
2014-04-19 14:35:54 -07:00
test("should layout node with top and left", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
2014-04-22 14:59:59 -07:00
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.justify_content = CSS_JUSTIFY_SPACE_AROUND;
node_0->style.dimensions[CSS_HEIGHT] = 10;
node_0->style.padding[CSS_TOP] = 5;
init_css_node_children(node_0, 1);
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-04-22 14:59:59 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 10;
init_css_node_children(node_0, 1);
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 7.5;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-22 14:59:59 -07:00
}
}
2014-04-19 14:35:54 -07:00
test("should layout node with height, padding and space-around", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
2014-04-22 17:37:55 -07:00
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 17:37:55 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.position[CSS_BOTTOM] = 5;
2014-04-22 17:37:55 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 17:37:55 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = -5;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-22 17:37:55 -07:00
}
2014-04-19 14:35:54 -07:00
test("should layout node with bottom", root_node, root_layout);
2014-04-22 17:37:55 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 17:37:55 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.position[CSS_TOP] = 10;
node_0->style.position[CSS_BOTTOM] = 5;
2014-04-19 14:26:19 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 14:26:19 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 10;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-19 14:26:19 -07:00
}
2014-04-19 14:35:54 -07:00
test("should layout node with both top and bottom", root_node, root_layout);
2014-04-18 17:15:03 -07:00
}
2014-04-19 22:08:10 -07:00
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 500;
init_css_node_children(node_0, 3);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.dimensions[CSS_WIDTH] = 50;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.flex = 1;
2014-04-22 17:37:55 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 17:37:55 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 500;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 3);
2014-04-22 13:18:05 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 250;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 250;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 2);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 250;
node_1->layout.dimensions[CSS_WIDTH] = 250;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-22 13:18:05 -07:00
}
2014-04-19 22:08:10 -07:00
}
2014-04-22 13:18:05 -07:00
test("should layout node with position: absolute", root_node, root_layout);
2014-04-19 22:08:10 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.margin[CSS_RIGHT] = 15;
2014-04-19 22:08:10 -07:00
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
2014-04-22 17:37:55 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-22 17:37:55 -07:00
}
}
2014-04-22 13:18:05 -07:00
test("should layout node with child with position: absolute and margin", root_node, root_layout);
2014-04-22 17:37:55 -07:00
}
2014-04-22 14:59:59 -07:00
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.align_self = CSS_ALIGN_CENTER;
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.padding[CSS_RIGHT] = 12;
2014-04-19 22:08:10 -07:00
}
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
2014-04-19 22:08:10 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 12;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-19 22:08:10 -07:00
}
2014-04-22 14:59:59 -07:00
}
2014-04-22 13:18:05 -07:00
test("should layout node with position: absolute, padding and alignSelf: center", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_HEIGHT] = 5;
node_0->style.padding[CSS_BOTTOM] = 20;
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 20;
2014-04-22 14:59:59 -07:00
}
2014-04-22 13:18:05 -07:00
test("should work with height smaller than paddingBottom", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 5;
node_0->style.padding[CSS_LEFT] = 20;
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 20;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-22 14:59:59 -07:00
}
2014-04-22 13:18:05 -07:00
test("should work with width smaller than paddingLeft", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 2);
2014-04-28 12:34:04 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
2014-05-16 18:04:24 -07:00
node_2->style.dimensions[CSS_WIDTH] = 400;
}
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.align_self = CSS_ALIGN_STRETCH;
node_1->style.dimensions[CSS_WIDTH] = 200;
2014-04-28 12:34:04 -07:00
}
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 400;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 2);
2014-04-28 12:34:04 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 400;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_2->layout.dimensions[CSS_WIDTH] = 400;
node_2->layout.dimensions[CSS_HEIGHT] = 0;
}
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-04-28 12:34:04 -07:00
}
2014-04-22 14:59:59 -07:00
}
2014-04-22 13:18:05 -07:00
test("should layout node with specified width and stretch", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
2014-05-16 18:04:24 -07:00
node_0->style.padding[CSS_LEFT] = 5;
node_0->style.padding[CSS_TOP] = 5;
node_0->style.padding[CSS_RIGHT] = 5;
node_0->style.padding[CSS_BOTTOM] = 5;
node_0->style.padding[CSS_START] = 5;
node_0->style.padding[CSS_END] = 5;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 10;
node_0->layout.dimensions[CSS_HEIGHT] = 10;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 5;
node_1->layout.position[CSS_LEFT] = 5;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
2014-04-22 13:18:05 -07:00
test("should layout node with padding and child with position absolute", root_node, root_layout);
}
2014-04-22 14:59:59 -07:00
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
css_node_t *node_0 = root_node;
2014-05-16 18:04:24 -07:00
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.position[CSS_LEFT] = 10;
node_1->style.position[CSS_TOP] = 10;
}
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 10;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
2014-04-22 14:59:59 -07:00
}
2014-04-22 13:18:05 -07:00
test("should layout node with position absolute, top and left", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.padding[CSS_LEFT] = 20;
node_0->style.padding[CSS_TOP] = 20;
node_0->style.padding[CSS_RIGHT] = 20;
node_0->style.padding[CSS_BOTTOM] = 20;
node_0->style.padding[CSS_START] = 20;
node_0->style.padding[CSS_END] = 20;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.position[CSS_LEFT] = 5;
}
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 40;
node_0->layout.dimensions[CSS_HEIGHT] = 40;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 20;
node_1->layout.position[CSS_LEFT] = 5;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
2014-04-22 14:59:59 -07:00
}
2014-04-22 13:18:05 -07:00
test("should layout node with padding and child position absolute, left", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.margin[CSS_TOP] = 5;
node_1->style.position[CSS_TOP] = 5;
}
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 10;
node_1->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
2014-04-22 14:59:59 -07:00
}
2014-04-22 13:18:05 -07:00
test("should layout node with position: absolute, top and marginTop", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.margin[CSS_LEFT] = 5;
node_1->style.position[CSS_LEFT] = 5;
}
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
2014-04-22 14:59:59 -07:00
}
2014-04-22 13:18:05 -07:00
test("should layout node with position: absolute, left and marginLeft", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.justify_content = CSS_JUSTIFY_SPACE_AROUND;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
}
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
2014-04-22 14:59:59 -07:00
}
2014-04-22 13:18:05 -07:00
test("should layout node with space-around and child position absolute", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.justify_content = CSS_JUSTIFY_SPACE_AROUND;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1 = node_0->get_child(node_0->context, 1);
}
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should layout node with space-around and child position absolute in reverse", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
2014-05-16 18:04:24 -07:00
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 700;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
2014-05-16 18:04:24 -07:00
node_1->style.margin[CSS_LEFT] = 5;
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 700;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 5;
node_1->layout.dimensions[CSS_WIDTH] = 695;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
2014-04-22 13:18:05 -07:00
test("should layout node with flex and main margin", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 700;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1->style.margin[CSS_RIGHT] = 5;
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 700;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 695;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should layout node with flex and main margin in rtl", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
2014-05-16 18:04:24 -07:00
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 700;
init_css_node_children(node_0, 2);
2014-09-11 09:23:30 -07:00
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
2014-05-16 18:04:24 -07:00
node_1->style.padding[CSS_RIGHT] = 5;
2014-09-11 09:23:30 -07:00
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 700;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 2);
2014-09-11 09:23:30 -07:00
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 347.5;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 347.5;
node_1->layout.dimensions[CSS_WIDTH] = 352.5;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-09-11 09:23:30 -07:00
}
}
2014-04-22 13:18:05 -07:00
test("should layout node with multiple flex and padding", root_node, root_layout);
2014-09-11 09:23:30 -07:00
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 700;
2014-09-11 09:23:30 -07:00
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
node_1->style.padding[CSS_LEFT] = 5;
2014-09-11 09:23:30 -07:00
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 700;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
2014-09-11 09:23:30 -07:00
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 352.5;
node_1->layout.dimensions[CSS_WIDTH] = 347.5;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
2014-09-11 09:23:30 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 352.5;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-09-11 09:23:30 -07:00
}
}
test("should layout node with multiple flex and padding in rtl", root_node, root_layout);
2014-09-11 09:23:30 -07:00
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
2014-05-16 18:04:24 -07:00
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 700;
2014-09-11 09:23:30 -07:00
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
2014-05-16 18:04:24 -07:00
node_1->style.margin[CSS_LEFT] = 5;
2014-09-11 09:23:30 -07:00
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 700;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
2014-09-11 09:23:30 -07:00
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 347.5;
2014-09-11 09:23:30 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 0;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 352.5;
node_1->layout.dimensions[CSS_WIDTH] = 347.5;
2014-09-11 09:23:30 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
2014-04-22 13:18:05 -07:00
test("should layout node with multiple flex and margin", root_node, root_layout);
2014-09-11 09:23:30 -07:00
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 700;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
node_1->style.margin[CSS_RIGHT] = 5;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 700;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 352.5;
node_1->layout.dimensions[CSS_WIDTH] = 347.5;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 347.5;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should layout node with multiple flex and margin in rtl", root_node, root_layout);
}
2014-09-30 13:11:32 -07:00
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_HEIGHT] = 300;
init_css_node_children(node_0, 2);
2014-09-30 13:11:32 -07:00
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.dimensions[CSS_HEIGHT] = 600;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
2014-09-30 13:11:32 -07:00
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_HEIGHT] = 300;
init_css_node_children(node_0, 2);
2014-09-30 13:11:32 -07:00
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 600;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 600;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-09-30 13:11:32 -07:00
}
}
test("should layout node with flex and overflow", root_node, root_layout);
2014-09-30 13:11:32 -07:00
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 600;
2014-09-30 13:11:32 -07:00
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.flex = 1;
2014-09-30 13:11:32 -07:00
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 600;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
2014-09-30 13:11:32 -07:00
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 0;
2014-09-30 13:11:32 -07:00
}
}
test("should layout node with flex and position absolute", root_node, root_layout);
2014-09-30 13:11:32 -07:00
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
2014-05-16 18:04:24 -07:00
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 600;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
2014-09-11 09:23:30 -07:00
node_1->style.flex = 1;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 600;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 600;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should layout node with flex and position absolute in rtl", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_HEIGHT] = 500;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
2014-09-11 09:23:30 -07:00
node_1->style.flex = 1;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
2014-09-11 09:23:30 -07:00
node_1->style.flex = 1;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 500;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 500;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 500;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
2014-04-22 13:18:05 -07:00
test("should layout node with double flex and position absolute", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
2014-05-16 18:04:24 -07:00
node_0->style.border[CSS_LEFT] = 5;
node_0->style.border[CSS_TOP] = 5;
node_0->style.border[CSS_RIGHT] = 5;
node_0->style.border[CSS_BOTTOM] = 5;
node_0->style.border[CSS_START] = 5;
node_0->style.border[CSS_END] = 5;
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 10;
node_0->layout.dimensions[CSS_HEIGHT] = 10;
}
2014-04-22 13:18:05 -07:00
test("should layout node with borderWidth", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
2014-05-16 18:04:24 -07:00
node_0->style.border[CSS_TOP] = 1;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
2014-05-16 18:04:24 -07:00
node_1->style.position[CSS_TOP] = -1;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 1;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
2014-04-22 13:18:05 -07:00
test("should layout node with borderWidth and position: absolute, top", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
2014-05-16 18:04:24 -07:00
node_0->style.border[CSS_LEFT] = 1;
node_0->style.border[CSS_TOP] = 1;
node_0->style.border[CSS_RIGHT] = 1;
node_0->style.border[CSS_BOTTOM] = 1;
node_0->style.border[CSS_START] = 1;
node_0->style.border[CSS_END] = 1;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
2014-05-16 18:04:24 -07:00
node_1->style.position[CSS_LEFT] = 5;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 2;
node_0->layout.dimensions[CSS_HEIGHT] = 2;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 1;
node_1->layout.position[CSS_LEFT] = 6;
node_1->layout.dimensions[CSS_WIDTH] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
2014-04-22 13:18:05 -07:00
test("should layout node with borderWidth and position: absolute, top. cross axis", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 50;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.align_self = CSS_ALIGN_STRETCH;
node_1->style.margin[CSS_LEFT] = 20;
node_1->style.padding[CSS_LEFT] = 20;
node_1->style.padding[CSS_TOP] = 20;
node_1->style.padding[CSS_RIGHT] = 20;
node_1->style.padding[CSS_BOTTOM] = 20;
node_1->style.padding[CSS_START] = 20;
node_1->style.padding[CSS_END] = 20;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 50;
node_0->layout.dimensions[CSS_HEIGHT] = 40;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 20;
node_1->layout.dimensions[CSS_WIDTH] = 40;
node_1->layout.dimensions[CSS_HEIGHT] = 40;
}
}
2014-04-22 14:59:59 -07:00
test("should correctly take into account min padding for stretch", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = -31;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.border[CSS_RIGHT] = 5;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 5;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.dimensions[CSS_WIDTH] = 5;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
2014-04-22 17:37:55 -07:00
test("should layout node with negative width", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
2014-05-16 18:04:24 -07:00
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.border[CSS_RIGHT] = 1;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->style.margin[CSS_RIGHT] = -8;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.dimensions[CSS_WIDTH] = 1;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
2014-04-22 17:37:55 -07:00
test("should handle negative margin and min padding correctly", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.border[CSS_LEFT] = 1;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.margin[CSS_LEFT] = -8;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 1;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should handle negative margin and min padding correctly in rtl", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
2014-06-11 21:00:57 -07:00
node_0->measure = measure;
node_0->context = "small";
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 35;
node_0->layout.dimensions[CSS_HEIGHT] = 18;
}
2014-04-28 12:34:04 -07:00
test("should layout node with just text", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->measure = measure;
node_0->context = "measureWithRatio2";
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
}
test("should layout node with fixed width and custom measure function", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_HEIGHT] = 100;
node_0->measure = measure;
node_0->context = "measureWithRatio2";
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
}
test("should layout node with fixed height and custom measure function", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
node_0->measure = measure;
node_0->context = "measureWithRatio2";
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
}
test("should layout node with fixed height and fixed width, ignoring custom measure function", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->measure = measure;
node_0->context = "measureWithRatio2";
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 99999;
node_0->layout.dimensions[CSS_HEIGHT] = 99999;
}
test("should layout node with no fixed dimension and custom measure function", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN;
node_0->style.dimensions[CSS_WIDTH] = 320;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->measure = measure;
node_1->context = "measureWithRatio2";
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex_direction = CSS_FLEX_DIRECTION_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 = CSS_OVERFLOW_HIDDEN;
node_1->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 2);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->measure = measure;
node_2->context = "measureWithRatio2";
node_2 = node_1->get_child(node_1->context, 1);
node_2->measure = measure;
node_2->context = "measureWithRatio2";
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 320;
node_0->layout.dimensions[CSS_HEIGHT] = 740;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 320;
node_1->layout.dimensions[CSS_HEIGHT] = 640;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 640;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 320;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 2);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 200;
node_2->layout.dimensions[CSS_HEIGHT] = 100;
node_2 = node_1->get_child(node_1->context, 1);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 200;
node_2->layout.dimensions[CSS_WIDTH] = 200;
node_2->layout.dimensions[CSS_HEIGHT] = 100;
}
}
}
test("should layout node with nested stacks and custom measure function", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
2014-05-16 18:04:24 -07:00
node_0->style.dimensions[CSS_WIDTH] = 10;
2014-06-11 21:00:57 -07:00
node_0->measure = measure;
node_0->context = "small";
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 10;
node_0->layout.dimensions[CSS_HEIGHT] = 18;
2014-04-22 14:59:59 -07:00
}
2014-04-28 12:34:04 -07:00
test("should layout node with text and width", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
2014-06-11 21:00:57 -07:00
node_0->measure = measure;
node_0->context = "loooooooooong with space";
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 172;
node_0->layout.dimensions[CSS_HEIGHT] = 18;
2014-04-22 14:59:59 -07:00
}
2014-04-28 12:34:04 -07:00
test("should layout node with text, padding and margin", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 300;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.align_self = CSS_ALIGN_STRETCH;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.align_self = CSS_ALIGN_STRETCH;
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
2014-05-16 18:04:24 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 300;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 300;
node_2->layout.dimensions[CSS_HEIGHT] = 0;
}
}
}
test("should layout node with nested alignSelf: stretch", root_node, root_layout);
}
2014-12-12 12:03:31 +00:00
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
2014-12-12 12:03:31 +00:00
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_1->style.dimensions[CSS_WIDTH] = 500;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.flex = 1;
2014-06-11 21:00:57 -07:00
node_2->measure = measure;
node_2->context = "loooooooooong with space";
}
2014-12-12 12:03:31 +00:00
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 500;
node_0->layout.dimensions[CSS_HEIGHT] = 18;
init_css_node_children(node_0, 1);
2014-12-12 12:03:31 +00:00
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 500;
node_1->layout.dimensions[CSS_HEIGHT] = 18;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 500;
node_2->layout.dimensions[CSS_HEIGHT] = 18;
}
2014-12-12 12:03:31 +00:00
}
}
test("should layout node with text and flex", root_node, root_layout);
2014-12-12 12:03:31 +00:00
}
2015-02-04 07:50:15 -08:00
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
2015-02-04 07:50:15 -08:00
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.direction = CSS_DIRECTION_RTL;
node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_1->style.dimensions[CSS_WIDTH] = 500;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.flex = 1;
node_2->measure = measure;
node_2->context = "loooooooooong with space";
}
2015-02-04 07:50:15 -08:00
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 500;
node_0->layout.dimensions[CSS_HEIGHT] = 18;
init_css_node_children(node_0, 1);
2015-02-04 07:50:15 -08:00
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 500;
node_1->layout.dimensions[CSS_HEIGHT] = 18;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 500;
node_2->layout.dimensions[CSS_HEIGHT] = 18;
}
2015-02-04 07:50:15 -08:00
}
}
test("should layout node with text and flex in rtl", root_node, root_layout);
2015-02-04 07:50:15 -08:00
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 130;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.align_items = CSS_ALIGN_STRETCH;
node_1->style.align_self = CSS_ALIGN_STRETCH;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
2014-06-11 21:00:57 -07:00
node_2->measure = measure;
node_2->context = "loooooooooong with space";
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 130;
2015-08-06 12:35:12 -07:00
node_0->layout.dimensions[CSS_HEIGHT] = 36;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 130;
2015-08-06 12:35:12 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 36;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 130;
2015-08-06 12:35:12 -07:00
node_2->layout.dimensions[CSS_HEIGHT] = 36;
}
}
}
test("should layout node with text and stretch", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.align_items = CSS_ALIGN_STRETCH;
node_1->style.align_self = CSS_ALIGN_STRETCH;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 130;
2014-06-11 21:00:57 -07:00
node_2->measure = measure;
node_2->context = "loooooooooong with space";
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
2015-08-06 12:35:12 -07:00
node_0->layout.dimensions[CSS_HEIGHT] = 36;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
2015-08-06 12:35:12 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 36;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 130;
2015-08-06 12:35:12 -07:00
node_2->layout.dimensions[CSS_HEIGHT] = 36;
}
}
2014-04-22 14:59:59 -07:00
}
test("should layout node with text stretch and width", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
2014-10-08 09:35:44 -07:00
node_0->style.align_self = CSS_ALIGN_FLEX_START;
node_0->style.dimensions[CSS_WIDTH] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-10-08 09:35:44 -07:00
node_1->style.align_self = CSS_ALIGN_FLEX_START;
2014-06-11 21:00:57 -07:00
node_1->measure = measure;
node_1->context = "loooooooooong with space";
}
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
2015-08-06 12:35:12 -07:00
node_0->layout.dimensions[CSS_HEIGHT] = 36;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
2015-08-06 12:35:12 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 36;
}
2014-04-22 14:59:59 -07:00
}
test("should layout node with text bounded by parent", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
2014-10-08 09:35:44 -07:00
node_0->style.align_self = CSS_ALIGN_FLEX_START;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.padding[CSS_LEFT] = 10;
node_0->style.padding[CSS_TOP] = 10;
node_0->style.padding[CSS_RIGHT] = 10;
node_0->style.padding[CSS_BOTTOM] = 10;
node_0->style.padding[CSS_START] = 10;
node_0->style.padding[CSS_END] = 10;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
2014-10-08 09:35:44 -07:00
node_1->style.align_self = CSS_ALIGN_FLEX_START;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
2014-06-11 21:00:57 -07:00
node_2->measure = measure;
node_2->context = "loooooooooong with space";
}
}
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
2014-05-16 18:04:24 -07:00
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
2015-08-06 12:35:12 -07:00
node_0->layout.dimensions[CSS_HEIGHT] = 76;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 20;
node_1->layout.position[CSS_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[CSS_WIDTH] = 60;
2015-08-06 12:35:12 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 36;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 100;
2015-08-06 12:35:12 -07:00
node_2->layout.dimensions[CSS_HEIGHT] = 36;
}
}
2014-04-22 14:59:59 -07:00
}
test("should layout node with text bounded by grand-parent", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.justify_content = CSS_JUSTIFY_SPACE_BETWEEN;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 900;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
}
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 900;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 900;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
2014-04-22 14:59:59 -07:00
}
test("should layout space-between when remaining space is negative", root_node, root_layout);
2014-04-22 14:59:59 -07:00
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
node_0->style.justify_content = CSS_JUSTIFY_SPACE_BETWEEN;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 900;
node_1 = node_0->get_child(node_0->context, 1);
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = -800;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 900;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = -800;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should layout space-between when remaining space is negative in reverse", root_node, root_layout);
}
2014-04-22 14:59:59 -07:00
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
2014-04-22 14:59:59 -07:00
{
2014-05-16 18:04:24 -07:00
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.justify_content = CSS_JUSTIFY_FLEX_END;
node_0->style.dimensions[CSS_WIDTH] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 900;
}
2014-04-22 14:59:59 -07:00
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = -700;
node_1->layout.dimensions[CSS_WIDTH] = 900;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should layout flex-end when remaining space is negative", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.justify_content = CSS_JUSTIFY_FLEX_END;
node_0->style.dimensions[CSS_WIDTH] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 900;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 900;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should layout flex-end when remaining space is negative in rtl", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_1->style.dimensions[CSS_WIDTH] = 200;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.margin[CSS_LEFT] = 20;
node_2->style.margin[CSS_TOP] = 20;
node_2->style.margin[CSS_RIGHT] = 20;
node_2->style.margin[CSS_BOTTOM] = 20;
node_2->style.margin[CSS_START] = 20;
node_2->style.margin[CSS_END] = 20;
2014-06-11 21:00:57 -07:00
node_2->measure = measure;
node_2->context = "loooooooooong with space";
}
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 58;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 58;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 20;
node_2->layout.position[CSS_LEFT] = 20;
node_2->layout.dimensions[CSS_WIDTH] = 172;
node_2->layout.dimensions[CSS_HEIGHT] = 18;
}
}
}
test("should layout text with flexDirection row", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_1->style.dimensions[CSS_WIDTH] = 200;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.margin[CSS_LEFT] = 20;
node_2->style.margin[CSS_TOP] = 20;
node_2->style.margin[CSS_RIGHT] = 20;
node_2->style.margin[CSS_BOTTOM] = 20;
node_2->style.margin[CSS_START] = 20;
node_2->style.margin[CSS_END] = 20;
node_2->measure = measure;
node_2->context = "loooooooooong with space";
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 58;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 58;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 20;
node_2->layout.position[CSS_LEFT] = 8;
node_2->layout.dimensions[CSS_WIDTH] = 172;
node_2->layout.dimensions[CSS_HEIGHT] = 18;
}
}
}
test("should layout text with flexDirection row in rtl", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 200;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.margin[CSS_LEFT] = 20;
node_2->style.margin[CSS_TOP] = 20;
node_2->style.margin[CSS_RIGHT] = 20;
node_2->style.margin[CSS_BOTTOM] = 20;
node_2->style.margin[CSS_START] = 20;
node_2->style.margin[CSS_END] = 20;
2014-06-11 21:00:57 -07:00
node_2->measure = measure;
node_2->context = "loooooooooong with space";
}
}
}
2014-09-11 09:23:30 -07:00
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
2015-08-06 12:35:12 -07:00
node_0->layout.dimensions[CSS_HEIGHT] = 76;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
2015-08-06 12:35:12 -07:00
node_1->layout.dimensions[CSS_HEIGHT] = 76;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
2014-09-11 09:23:30 -07:00
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 20;
node_2->layout.position[CSS_LEFT] = 20;
node_2->layout.dimensions[CSS_WIDTH] = 160;
2015-08-06 12:35:12 -07:00
node_2->layout.dimensions[CSS_HEIGHT] = 36;
}
}
}
test("should layout with text and margin", root_node, root_layout);
}
{
2014-09-11 09:23:30 -07:00
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.position[CSS_LEFT] = 0;
node_1->style.position[CSS_TOP] = 0;
node_1->style.position[CSS_RIGHT] = 0;
node_1->style.position[CSS_BOTTOM] = 0;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
}
}
test("should layout with position absolute, top, left, bottom, right", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.align_self = CSS_ALIGN_FLEX_START;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
2014-09-11 09:23:30 -07:00
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.align_self = CSS_ALIGN_FLEX_START;
node_1->style.flex = 2.5;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.align_self = CSS_ALIGN_FLEX_START;
node_1->style.flex = 7.5;
2014-09-11 09:23:30 -07:00
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
2014-09-11 09:23:30 -07:00
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 25;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 25;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 75;
2014-09-11 09:23:30 -07:00
}
}
test("should layout with arbitrary flex", root_node, root_layout);
2014-09-11 09:23:30 -07:00
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
2014-10-08 09:35:44 -07:00
node_0->style.align_self = CSS_ALIGN_FLEX_START;
2014-09-11 09:23:30 -07:00
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
2014-10-08 09:35:44 -07:00
node_1->style.align_self = CSS_ALIGN_FLEX_START;
2014-09-11 09:23:30 -07:00
node_1->style.flex = 2.5;
node_1 = node_0->get_child(node_0->context, 1);
2014-10-08 09:35:44 -07:00
node_1->style.align_self = CSS_ALIGN_FLEX_START;
2014-09-11 09:23:30 -07:00
node_1->style.flex = 7.5;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 75;
2014-09-11 09:23:30 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 25;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
2014-09-11 09:23:30 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 75;
}
}
test("should layout with arbitrary flex in reverse", root_node, root_layout);
2014-09-11 09:23:30 -07:00
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
2014-10-08 09:35:44 -07:00
node_0->style.align_self = CSS_ALIGN_FLEX_START;
2014-09-11 09:23:30 -07:00
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
2014-10-08 09:35:44 -07:00
node_1->style.align_self = CSS_ALIGN_FLEX_START;
node_1->style.flex = -2.5;
2014-09-11 09:23:30 -07:00
node_1 = node_0->get_child(node_0->context, 1);
2014-10-08 09:35:44 -07:00
node_1->style.align_self = CSS_ALIGN_FLEX_START;
2014-09-11 09:23:30 -07:00
node_1->style.flex = 0;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 100;
2014-09-11 09:23:30 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 100;
2014-09-11 09:23:30 -07:00
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should layout with negative flex in reverse", root_node, root_layout);
2014-09-11 09:23:30 -07:00
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.position[CSS_LEFT] = 0;
node_1->style.position[CSS_RIGHT] = 0;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 50;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
2014-09-29 14:07:47 -07:00
test("should layout with position: absolute and another sibling", root_node, root_layout);
}
2014-09-30 13:11:32 -07:00
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.position[CSS_TOP] = 0;
node_1->style.position[CSS_BOTTOM] = 20;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
2014-09-30 13:11:32 -07:00
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 80;
}
}
test("should calculate height properly with position: absolute top and bottom", root_node, root_layout);
2014-09-30 13:11:32 -07:00
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 200;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.justify_content = CSS_JUSTIFY_CENTER;
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.position[CSS_LEFT] = 0;
node_1->style.position[CSS_TOP] = 0;
node_1->style.position[CSS_RIGHT] = 0;
node_1->style.position[CSS_BOTTOM] = 0;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 100;
node_2->style.dimensions[CSS_HEIGHT] = 100;
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 50;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 100;
node_2->layout.dimensions[CSS_HEIGHT] = 100;
}
}
}
test("should layout with complicated position: absolute and justifyContent: center combo", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.position[CSS_BOTTOM] = 0;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should calculate top properly with position: absolute bottom", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.position[CSS_RIGHT] = 0;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 100;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should calculate left properly with position: absolute right", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.dimensions[CSS_HEIGHT] = 10;
node_1->style.position[CSS_BOTTOM] = 0;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 90;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 10;
}
}
test("should calculate top properly with position: absolute bottom and height", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.dimensions[CSS_WIDTH] = 10;
node_1->style.position[CSS_RIGHT] = 0;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 90;
node_1->layout.dimensions[CSS_WIDTH] = 10;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should calculate left properly with position: absolute right and width", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.dimensions[CSS_HEIGHT] = 10;
node_1->style.position[CSS_BOTTOM] = 0;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = -10;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 10;
}
}
test("should calculate top properly with position: absolute right, width, and no parent dimensions", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.dimensions[CSS_WIDTH] = 10;
node_1->style.position[CSS_RIGHT] = 0;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = -10;
node_1->layout.dimensions[CSS_WIDTH] = 10;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should calculate left properly with position: absolute right, width, and no parent dimensions", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.justify_content = CSS_JUSTIFY_SPACE_BETWEEN;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.border[CSS_BOTTOM] = 1;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 1;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 1;
}
}
test("should layout border bottom inside of justify content space between container", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.justify_content = CSS_JUSTIFY_CENTER;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.margin[CSS_TOP] = -6;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = -3;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should layout negative margin top inside of justify content center container", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.justify_content = CSS_JUSTIFY_CENTER;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.margin[CSS_TOP] = 20;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 20;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 20;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should layout positive margin top inside of justify content center container", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.justify_content = CSS_JUSTIFY_FLEX_END;
node_0->style.border[CSS_BOTTOM] = 5;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 5;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should layout border bottom and flex end with an empty child", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 800;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position[CSS_LEFT] = 5;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 800;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 5;
node_1->layout.dimensions[CSS_WIDTH] = 800;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 800;
node_2->layout.dimensions[CSS_HEIGHT] = 0;
}
}
}
test("should layout with children of a contain with left", root_node, root_layout);
}
2014-12-12 12:03:31 +00:00
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.flex_wrap = CSS_WRAP;
node_0->style.dimensions[CSS_WIDTH] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 40;
node_1->style.dimensions[CSS_HEIGHT] = 10;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 40;
node_1->style.dimensions[CSS_HEIGHT] = 10;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 40;
node_1->style.dimensions[CSS_HEIGHT] = 10;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 20;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 40;
node_1->layout.dimensions[CSS_HEIGHT] = 10;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 40;
node_1->layout.dimensions[CSS_WIDTH] = 40;
node_1->layout.dimensions[CSS_HEIGHT] = 10;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 10;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 40;
node_1->layout.dimensions[CSS_HEIGHT] = 10;
}
}
test("should layout flex-wrap", root_node, root_layout);
}
2015-02-04 07:50:15 -08:00
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.flex_wrap = CSS_WRAP;
node_0->style.dimensions[CSS_WIDTH] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 40;
node_1->style.dimensions[CSS_HEIGHT] = 10;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 40;
node_1->style.dimensions[CSS_HEIGHT] = 10;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 40;
node_1->style.dimensions[CSS_HEIGHT] = 10;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 20;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 60;
node_1->layout.dimensions[CSS_WIDTH] = 40;
node_1->layout.dimensions[CSS_HEIGHT] = 10;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 20;
node_1->layout.dimensions[CSS_WIDTH] = 40;
node_1->layout.dimensions[CSS_HEIGHT] = 10;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 10;
node_1->layout.position[CSS_LEFT] = 60;
node_1->layout.dimensions[CSS_WIDTH] = 40;
node_1->layout.dimensions[CSS_HEIGHT] = 10;
}
}
test("should layout flex-wrap in rtl", root_node, root_layout);
}
2015-02-04 07:50:15 -08:00
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_wrap = CSS_WRAP;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_HEIGHT] = 200;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 0;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
}
}
test("should layout flex wrap with a line bigger than container", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 200;
node_0->style.maxDimensions[CSS_WIDTH] = 90;
node_0->style.maxDimensions[CSS_HEIGHT] = 190;
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 90;
node_0->layout.dimensions[CSS_HEIGHT] = 190;
}
test("should use max bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 200;
node_0->style.minDimensions[CSS_WIDTH] = 110;
node_0->style.minDimensions[CSS_HEIGHT] = 210;
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 110;
node_0->layout.dimensions[CSS_HEIGHT] = 210;
}
test("should use min bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 200;
node_0->style.maxDimensions[CSS_WIDTH] = 90;
node_0->style.maxDimensions[CSS_HEIGHT] = 190;
node_0->style.minDimensions[CSS_WIDTH] = 110;
node_0->style.minDimensions[CSS_HEIGHT] = 210;
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 110;
node_0->layout.dimensions[CSS_HEIGHT] = 210;
}
test("should use min bounds over max bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 200;
node_0->style.maxDimensions[CSS_WIDTH] = 80;
node_0->style.maxDimensions[CSS_HEIGHT] = 180;
node_0->style.minDimensions[CSS_WIDTH] = 90;
node_0->style.minDimensions[CSS_HEIGHT] = 190;
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 90;
node_0->layout.dimensions[CSS_HEIGHT] = 190;
}
test("should use min bounds over max bounds and natural width", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 200;
node_0->style.minDimensions[CSS_WIDTH] = -10;
node_0->style.minDimensions[CSS_HEIGHT] = -20;
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
}
test("should ignore negative min bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 200;
node_0->style.maxDimensions[CSS_WIDTH] = -10;
node_0->style.maxDimensions[CSS_HEIGHT] = -20;
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
}
test("should ignore negative max bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.maxDimensions[CSS_WIDTH] = 30;
node_0->style.maxDimensions[CSS_HEIGHT] = 10;
node_0->style.padding[CSS_LEFT] = 20;
node_0->style.padding[CSS_TOP] = 15;
node_0->style.padding[CSS_RIGHT] = 20;
node_0->style.padding[CSS_BOTTOM] = 15;
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 40;
node_0->layout.dimensions[CSS_HEIGHT] = 30;
}
test("should use padded size over max bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.minDimensions[CSS_WIDTH] = 50;
node_0->style.minDimensions[CSS_HEIGHT] = 40;
node_0->style.padding[CSS_LEFT] = 20;
node_0->style.padding[CSS_TOP] = 15;
node_0->style.padding[CSS_RIGHT] = 20;
node_0->style.padding[CSS_BOTTOM] = 15;
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 50;
node_0->layout.dimensions[CSS_HEIGHT] = 40;
}
test("should use min size over padded size", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 300;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
node_1->style.minDimensions[CSS_WIDTH] = 200;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.flex = 1;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 50;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 250;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
}
}
test("should override flex direction size with min bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 300;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
node_1->style.minDimensions[CSS_WIDTH] = 200;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.flex = 1;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 250;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 50;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
}
}
test("should override flex direction size with min bounds in rtl", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 300;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
node_1->style.maxDimensions[CSS_WIDTH] = 110;
node_1->style.minDimensions[CSS_WIDTH] = 90;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.flex = 1;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 100;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 200;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
}
}
test("should not override flex direction size within bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 300;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
node_1->style.maxDimensions[CSS_WIDTH] = 110;
node_1->style.minDimensions[CSS_WIDTH] = 90;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.flex = 1;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 200;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 100;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
}
}
test("should not override flex direction size within bounds in rtl", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 300;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
node_1->style.maxDimensions[CSS_WIDTH] = 60;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.flex = 1;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 120;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 120;
node_1->layout.dimensions[CSS_WIDTH] = 60;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 180;
node_1->layout.dimensions[CSS_WIDTH] = 120;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
}
}
test("should override flex direction size with max bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 300;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
node_1->style.maxDimensions[CSS_WIDTH] = 60;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.flex = 1;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 180;
node_1->layout.dimensions[CSS_WIDTH] = 120;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 120;
node_1->layout.dimensions[CSS_WIDTH] = 60;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 120;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
}
}
test("should override flex direction size with max bounds in rtl", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 300;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1->style.maxDimensions[CSS_WIDTH] = 60;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
node_1->style.maxDimensions[CSS_WIDTH] = 60;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.flex = 1;
node_1->style.maxDimensions[CSS_WIDTH] = 60;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 60;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 60;
node_1->layout.dimensions[CSS_WIDTH] = 60;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 120;
node_1->layout.dimensions[CSS_WIDTH] = 60;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
}
}
test("should ignore flex size if fully max bound", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 300;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1->style.maxDimensions[CSS_WIDTH] = 60;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
node_1->style.maxDimensions[CSS_WIDTH] = 60;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.flex = 1;
node_1->style.maxDimensions[CSS_WIDTH] = 60;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 240;
node_1->layout.dimensions[CSS_WIDTH] = 60;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 180;
node_1->layout.dimensions[CSS_WIDTH] = 60;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 120;
node_1->layout.dimensions[CSS_WIDTH] = 60;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
}
}
test("should ignore flex size if fully max bound in rtl", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 300;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1->style.minDimensions[CSS_WIDTH] = 120;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
node_1->style.minDimensions[CSS_WIDTH] = 120;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.flex = 1;
node_1->style.minDimensions[CSS_WIDTH] = 120;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 120;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 120;
node_1->layout.dimensions[CSS_WIDTH] = 120;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 240;
node_1->layout.dimensions[CSS_WIDTH] = 120;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
}
}
test("should ignore flex size if fully min bound", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 300;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1->style.minDimensions[CSS_WIDTH] = 120;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
node_1->style.minDimensions[CSS_WIDTH] = 120;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.flex = 1;
node_1->style.minDimensions[CSS_WIDTH] = 120;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 180;
node_1->layout.dimensions[CSS_WIDTH] = 120;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 60;
node_1->layout.dimensions[CSS_WIDTH] = 120;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = -60;
node_1->layout.dimensions[CSS_WIDTH] = 120;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
}
}
test("should ignore flex size if fully min bound in rtl", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 300;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1->style.maxDimensions[CSS_WIDTH] = 310;
node_1->style.minDimensions[CSS_WIDTH] = 290;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 300;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
}
}
test("should pre-fill child size within bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 300;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1->style.maxDimensions[CSS_WIDTH] = 290;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 290;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
}
}
test("should pre-fill child size within max bound", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 300;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1->style.minDimensions[CSS_WIDTH] = 310;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 310;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
}
}
test("should pre-fill child size within min bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.maxDimensions[CSS_WIDTH] = 300;
node_0->style.maxDimensions[CSS_HEIGHT] = 700;
node_0->style.minDimensions[CSS_WIDTH] = 100;
node_0->style.minDimensions[CSS_HEIGHT] = 500;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 200;
node_1->style.dimensions[CSS_HEIGHT] = 300;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 200;
node_1->style.dimensions[CSS_HEIGHT] = 300;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 600;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 300;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 300;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 300;
}
}
test("should set parents size based on bounded children", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.maxDimensions[CSS_WIDTH] = 100;
node_0->style.maxDimensions[CSS_HEIGHT] = 500;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 200;
node_1->style.dimensions[CSS_HEIGHT] = 300;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 200;
node_1->style.dimensions[CSS_HEIGHT] = 300;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 500;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 300;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 300;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 300;
}
}
test("should set parents size based on max bounded children", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.minDimensions[CSS_WIDTH] = 300;
node_0->style.minDimensions[CSS_HEIGHT] = 700;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 200;
node_1->style.dimensions[CSS_HEIGHT] = 300;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 200;
node_1->style.dimensions[CSS_HEIGHT] = 300;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 700;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 300;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 300;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 300;
}
}
test("should set parents size based on min bounded children", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.align_items = CSS_ALIGN_STRETCH;
node_0->style.dimensions[CSS_WIDTH] = 1000;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.maxDimensions[CSS_WIDTH] = 1100;
node_1->style.maxDimensions[CSS_HEIGHT] = 110;
node_1->style.minDimensions[CSS_WIDTH] = 900;
node_1->style.minDimensions[CSS_HEIGHT] = 90;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 1000;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
}
}
test("should keep stretched size within bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.align_items = CSS_ALIGN_STRETCH;
node_0->style.dimensions[CSS_WIDTH] = 1000;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.maxDimensions[CSS_WIDTH] = 900;
node_1->style.maxDimensions[CSS_HEIGHT] = 90;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 90;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 900;
node_1->layout.dimensions[CSS_HEIGHT] = 90;
}
}
test("should keep stretched size within max bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.align_items = CSS_ALIGN_STRETCH;
node_0->style.dimensions[CSS_WIDTH] = 1000;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.minDimensions[CSS_WIDTH] = 1100;
node_1->style.minDimensions[CSS_HEIGHT] = 110;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 110;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 1100;
node_1->layout.dimensions[CSS_HEIGHT] = 110;
}
}
test("should keep stretched size within min bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 1000;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.minDimensions[CSS_WIDTH] = 100;
node_1->style.minDimensions[CSS_HEIGHT] = 110;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 110;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 110;
}
}
test("should keep cross axis size within min bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 1000;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.minDimensions[CSS_WIDTH] = 100;
node_1->style.minDimensions[CSS_HEIGHT] = 110;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 110;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 900;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 110;
}
}
test("should keep cross axis size within min bounds in rtl", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.maxDimensions[CSS_WIDTH] = 500;
node_1->style.maxDimensions[CSS_HEIGHT] = 600;
node_1->style.position[CSS_LEFT] = 100;
node_1->style.position[CSS_TOP] = 100;
node_1->style.position[CSS_RIGHT] = 100;
node_1->style.position[CSS_BOTTOM] = 100;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 100;
node_1->layout.dimensions[CSS_WIDTH] = 500;
node_1->layout.dimensions[CSS_HEIGHT] = 600;
}
}
test("should layout node with position absolute, top and left and max bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.minDimensions[CSS_WIDTH] = 900;
node_1->style.minDimensions[CSS_HEIGHT] = 1000;
node_1->style.position[CSS_LEFT] = 100;
node_1->style.position[CSS_TOP] = 100;
node_1->style.position[CSS_RIGHT] = 100;
node_1->style.position[CSS_BOTTOM] = 100;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 100;
node_1->layout.dimensions[CSS_WIDTH] = 900;
node_1->layout.dimensions[CSS_HEIGHT] = 1000;
}
}
test("should layout node with position absolute, top and left and min bounds", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.justify_content = CSS_JUSTIFY_CENTER;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1->style.dimensions[CSS_HEIGHT] = 1000;
node_1->style.maxDimensions[CSS_WIDTH] = 600;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 200;
node_1->layout.dimensions[CSS_WIDTH] = 600;
node_1->layout.dimensions[CSS_HEIGHT] = 1000;
}
}
test("should center flexible item with max size", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 1000;
node_0->style.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 1000;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = 1;
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 1000;
node_1->style.maxDimensions[CSS_WIDTH] = 200;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 1000;
node_0->layout.dimensions[CSS_HEIGHT] = 1000;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 800;
node_1->layout.dimensions[CSS_HEIGHT] = 1000;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 800;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 1000;
}
}
test("should correctly size flexible items with flex basis and a max width", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 400;
node_0->style.dimensions[CSS_HEIGHT] = 400;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.padding[CSS_LEFT] = 10;
node_1->style.padding[CSS_TOP] = 10;
node_1->style.padding[CSS_RIGHT] = 10;
node_1->style.padding[CSS_BOTTOM] = 10;
node_1->style.padding[CSS_START] = 10;
node_1->style.padding[CSS_END] = 10;
node_1->style.position[CSS_LEFT] = 100;
node_1->style.position[CSS_TOP] = 100;
node_1->style.position[CSS_RIGHT] = 100;
node_1->style.position[CSS_BOTTOM] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.position_type = CSS_POSITION_ABSOLUTE;
node_2->style.position[CSS_LEFT] = 10;
node_2->style.position[CSS_TOP] = 10;
node_2->style.position[CSS_RIGHT] = 10;
node_2->style.position[CSS_BOTTOM] = 10;
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 400;
node_0->layout.dimensions[CSS_HEIGHT] = 400;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 100;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 10;
node_2->layout.position[CSS_LEFT] = 10;
node_2->layout.dimensions[CSS_WIDTH] = 180;
node_2->layout.dimensions[CSS_HEIGHT] = 180;
}
}
}
test("should layout absolutely positioned node with absolutely positioned padded parent", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 400;
node_0->style.dimensions[CSS_HEIGHT] = 400;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.position_type = CSS_POSITION_ABSOLUTE;
node_1->style.padding[CSS_LEFT] = 10;
node_1->style.padding[CSS_TOP] = 10;
node_1->style.padding[CSS_RIGHT] = 10;
node_1->style.padding[CSS_BOTTOM] = 10;
node_1->style.padding[CSS_START] = 10;
node_1->style.padding[CSS_END] = 10;
node_1->style.border[CSS_LEFT] = 1;
node_1->style.border[CSS_TOP] = 1;
node_1->style.border[CSS_RIGHT] = 1;
node_1->style.border[CSS_BOTTOM] = 1;
node_1->style.border[CSS_START] = 1;
node_1->style.border[CSS_END] = 1;
node_1->style.position[CSS_LEFT] = 100;
node_1->style.position[CSS_TOP] = 100;
node_1->style.position[CSS_RIGHT] = 100;
node_1->style.position[CSS_BOTTOM] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.position_type = CSS_POSITION_ABSOLUTE;
node_2->style.position[CSS_LEFT] = 10;
node_2->style.position[CSS_TOP] = 10;
node_2->style.position[CSS_RIGHT] = 10;
node_2->style.position[CSS_BOTTOM] = 10;
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 400;
node_0->layout.dimensions[CSS_HEIGHT] = 400;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 100;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 11;
node_2->layout.position[CSS_LEFT] = 11;
node_2->layout.dimensions[CSS_WIDTH] = 178;
node_2->layout.dimensions[CSS_HEIGHT] = 178;
}
}
}
test("should layout absolutely positioned node with absolutely positioned padded and bordered parent", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 400;
node_0->style.dimensions[CSS_HEIGHT] = 400;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = 1;
node_1->style.padding[CSS_LEFT] = 10;
node_1->style.padding[CSS_TOP] = 10;
node_1->style.padding[CSS_RIGHT] = 10;
node_1->style.padding[CSS_BOTTOM] = 10;
node_1->style.padding[CSS_START] = 10;
node_1->style.padding[CSS_END] = 10;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.position_type = CSS_POSITION_ABSOLUTE;
node_2->style.position[CSS_LEFT] = 10;
node_2->style.position[CSS_TOP] = 10;
node_2->style.position[CSS_RIGHT] = 10;
node_2->style.position[CSS_BOTTOM] = 10;
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 400;
node_0->layout.dimensions[CSS_HEIGHT] = 400;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 400;
node_1->layout.dimensions[CSS_HEIGHT] = 400;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 10;
node_2->layout.position[CSS_LEFT] = 10;
node_2->layout.dimensions[CSS_WIDTH] = 380;
node_2->layout.dimensions[CSS_HEIGHT] = 380;
}
}
}
test("should layout absolutely positioned node with padded flex 1 parent", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.dimensions[CSS_WIDTH] = 200;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
init_css_node_children(node_1, 2);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 50;
node_2->style.dimensions[CSS_HEIGHT] = 50;
node_2 = node_1->get_child(node_1->context, 1);
node_2->style.dimensions[CSS_WIDTH] = 50;
node_2->style.dimensions[CSS_HEIGHT] = 50;
}
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.direction = CSS_DIRECTION_LTR;
node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
init_css_node_children(node_1, 2);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 50;
node_2->style.dimensions[CSS_HEIGHT] = 50;
node_2 = node_1->get_child(node_1->context, 1);
node_2->style.dimensions[CSS_WIDTH] = 50;
node_2->style.dimensions[CSS_HEIGHT] = 50;
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
init_css_node_children(node_1, 2);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 150;
node_2->layout.dimensions[CSS_WIDTH] = 50;
node_2->layout.dimensions[CSS_HEIGHT] = 50;
node_2 = node_1->get_child(node_1->context, 1);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 100;
node_2->layout.dimensions[CSS_WIDTH] = 50;
node_2->layout.dimensions[CSS_HEIGHT] = 50;
}
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 50;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
init_css_node_children(node_1, 2);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 50;
node_2->layout.dimensions[CSS_HEIGHT] = 50;
node_2 = node_1->get_child(node_1->context, 1);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 50;
node_2->layout.dimensions[CSS_WIDTH] = 50;
node_2->layout.dimensions[CSS_HEIGHT] = 50;
}
}
}
test("should layout nested nodes with mixed directions", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
2015-05-12 09:54:02 +01:00
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.justify_content = CSS_JUSTIFY_SPACE_BETWEEN;
node_0->style.flex_wrap = CSS_WRAP;
node_0->style.dimensions[CSS_WIDTH] = 320;
node_0->style.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 6);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
2015-05-12 09:54:02 +01:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
2015-05-12 09:54:02 +01:00
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 3);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 4);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 5);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 100;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
2015-05-12 09:54:02 +01:00
node_0->layout.dimensions[CSS_WIDTH] = 320;
node_0->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_0, 6);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
2015-05-12 09:54:02 +01:00
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 110;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 220;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 3);
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 4);
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 110;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 5);
node_1->layout.position[CSS_TOP] = 100;
node_1->layout.position[CSS_LEFT] = 220;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
}
}
2015-05-12 09:54:02 +01:00
test("should correctly space wrapped nodes", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 200;
node_0->style.padding[CSS_LEFT] = 5;
node_0->style.padding[CSS_RIGHT] = 5;
node_0->style.padding[CSS_START] = 15;
node_0->style.padding[CSS_END] = 15;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 50;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 50;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 15;
node_1->layout.dimensions[CSS_WIDTH] = 170;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
}
}
test("should give start/end padding precedence over left/right padding", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_LEFT] = 5;
node_1->style.margin[CSS_RIGHT] = 5;
node_1->style.margin[CSS_START] = 15;
node_1->style.margin[CSS_END] = 15;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 50;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 15;
node_1->layout.dimensions[CSS_WIDTH] = 170;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
}
}
test("should give start/end margin precedence over left/right margin", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 200;
node_0->style.border[CSS_LEFT] = 5;
node_0->style.border[CSS_RIGHT] = 5;
node_0->style.border[CSS_START] = 15;
node_0->style.border[CSS_END] = 15;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 50;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 50;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 15;
node_1->layout.dimensions[CSS_WIDTH] = 170;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
}
}
test("should give start/end border precedence over left/right border", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 200;
node_0->style.padding[CSS_START] = 15;
node_0->style.padding[CSS_END] = 5;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 50;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 50;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 15;
node_1->layout.dimensions[CSS_WIDTH] = 180;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
}
}
test("should layout node with correct start/end padding", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.dimensions[CSS_WIDTH] = 200;
node_0->style.padding[CSS_START] = 15;
node_0->style.padding[CSS_END] = 5;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 50;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 50;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 5;
node_1->layout.dimensions[CSS_WIDTH] = 180;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
}
}
test("should layout node with correct start/end padding in rtl", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_START] = 15;
node_1->style.margin[CSS_END] = 5;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 50;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 15;
node_1->layout.dimensions[CSS_WIDTH] = 180;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
}
}
test("should layout node with correct start/end margin", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.direction = CSS_DIRECTION_RTL;
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_START] = 15;
node_1->style.margin[CSS_END] = 5;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 50;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 5;
node_1->layout.dimensions[CSS_WIDTH] = 180;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
}
}
test("should layout node with correct start/end margin in rtl", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 200;
node_0->style.border[CSS_START] = 15;
node_0->style.border[CSS_END] = 5;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 50;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 50;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 15;
node_1->layout.dimensions[CSS_WIDTH] = 180;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
}
}
test("should layout node with correct start/end border", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.direction = CSS_DIRECTION_RTL;
node_0->style.dimensions[CSS_WIDTH] = 200;
node_0->style.border[CSS_START] = 15;
node_0->style.border[CSS_END] = 5;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_HEIGHT] = 50;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 50;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 5;
node_1->layout.dimensions[CSS_WIDTH] = 180;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
}
}
test("should layout node with correct start/end border in rtl", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 200;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 0;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
}
}
test("should layout node with a 0 width", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.align_items = CSS_ALIGN_FLEX_START;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 10;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 10;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN;
node_1->style.align_items = CSS_ALIGN_FLEX_START;
node_1->style.flex = 1;
node_1->style.dimensions[CSS_HEIGHT] = 10;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.flex = 1;
node_2->style.dimensions[CSS_HEIGHT] = 10;
node_2->measure = measure;
node_2->context = "measureWithMatchParent";
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 10;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 10;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 50;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 10;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 50;
node_2->layout.dimensions[CSS_HEIGHT] = 10;
}
}
}
test("should correctly progagate size contraints from flexible parents", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.align_items = CSS_ALIGN_STRETCH;
node_0->style.dimensions[CSS_WIDTH] = 150;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
init_css_node_children(node_2, 1);
{
css_node_t *node_3;
node_3 = node_2->get_child(node_2->context, 0);
node_3->style.align_self = CSS_ALIGN_CENTER;
}
}
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_HEIGHT] = 150;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 150;
node_0->layout.dimensions[CSS_HEIGHT] = 150;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 10;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 140;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 0;
node_2->layout.dimensions[CSS_HEIGHT] = 140;
init_css_node_children(node_2, 1);
{
css_node_t *node_3;
node_3 = node_2->get_child(node_2->context, 0);
node_3->layout.position[CSS_TOP] = 70;
node_3->layout.position[CSS_LEFT] = 0;
node_3->layout.dimensions[CSS_WIDTH] = 0;
node_3->layout.dimensions[CSS_HEIGHT] = 0;
}
}
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 150;
}
}
test("should layout content of an item which is stretched late", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 200;
node_2->style.dimensions[CSS_HEIGHT] = 200;
}
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 210;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 200;
node_1->layout.dimensions[CSS_HEIGHT] = 200;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 200;
node_2->layout.dimensions[CSS_HEIGHT] = 200;
}
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 210;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 190;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 190;
node_2->layout.dimensions[CSS_HEIGHT] = 0;
}
}
}
test("should layout items whose positioning is determined by sibling tree branches", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.align_self = CSS_ALIGN_FLEX_START;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.align_self = CSS_ALIGN_STRETCH;
node_1->style.dimensions[CSS_WIDTH] = 1;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_HEIGHT] = 150;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 11;
node_0->layout.dimensions[CSS_HEIGHT] = 150;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 10;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 0;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 1;
node_1->layout.dimensions[CSS_HEIGHT] = 150;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 11;
node_1->layout.dimensions[CSS_WIDTH] = 0;
node_1->layout.dimensions[CSS_HEIGHT] = 150;
}
}
test("should layout child whose cross axis is undefined and whose alignSelf is stretch", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 100;
node_2->style.dimensions[CSS_HEIGHT] = 100;
}
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN;
node_2->style.align_items = CSS_ALIGN_CENTER;
init_css_node_children(node_2, 1);
{
css_node_t *node_3;
node_3 = node_2->get_child(node_2->context, 0);
node_3->style.dimensions[CSS_WIDTH] = 50;
node_3->style.dimensions[CSS_HEIGHT] = 50;
}
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 200;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 2);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 100;
node_2->layout.dimensions[CSS_HEIGHT] = 100;
}
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 100;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 100;
node_2->layout.dimensions[CSS_HEIGHT] = 50;
init_css_node_children(node_2, 1);
{
css_node_t *node_3;
node_3 = node_2->get_child(node_2->context, 0);
node_3->layout.position[CSS_TOP] = 0;
node_3->layout.position[CSS_LEFT] = 25;
node_3->layout.dimensions[CSS_WIDTH] = 50;
node_3->layout.dimensions[CSS_HEIGHT] = 50;
}
}
}
}
test("should center items correctly inside a stretched layout", root_node, root_layout);
}
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
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = -1;
node_1->style.dimensions[CSS_WIDTH] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 100;
node_2->style.dimensions[CSS_HEIGHT] = 25;
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 25;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 100;
node_2->layout.dimensions[CSS_HEIGHT] = 25;
}
}
}
test("should not shrink column node when there is space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = -1;
node_1->style.dimensions[CSS_WIDTH] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 100;
node_2->style.dimensions[CSS_HEIGHT] = 200;
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 100;
node_2->layout.dimensions[CSS_HEIGHT] = 200;
}
}
}
test("should shrink column node when there is not any space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 25;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = -1;
node_1->style.dimensions[CSS_WIDTH] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 100;
node_2->style.dimensions[CSS_HEIGHT] = 30;
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 15;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 25;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 25;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 30;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 100;
node_2->layout.dimensions[CSS_HEIGHT] = 30;
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 55;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 15;
}
}
test("should not shrink column node with siblings when there is space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 25;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = -1;
node_1->style.dimensions[CSS_WIDTH] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 100;
node_2->style.dimensions[CSS_HEIGHT] = 80;
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 15;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 25;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 25;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 60;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 100;
node_2->layout.dimensions[CSS_HEIGHT] = 80;
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 85;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 15;
}
}
test("should shrink column node with siblings when there is not any space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = -1;
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 30;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 40;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.flex = -1;
node_1->style.dimensions[CSS_WIDTH] = 100;
node_1->style.dimensions[CSS_HEIGHT] = 50;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 22.5;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 22.5;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 40;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 62.5;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 37.5;
}
}
test("should shrink column nodes proportional to their main size when there is not any space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = -1;
node_1->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 25;
node_2->style.dimensions[CSS_HEIGHT] = 100;
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 25;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 25;
node_2->layout.dimensions[CSS_HEIGHT] = 100;
}
}
}
test("should not shrink visible row node when there is space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = -1;
node_1->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 200;
node_2->style.dimensions[CSS_HEIGHT] = 100;
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 200;
node_2->layout.dimensions[CSS_HEIGHT] = 100;
}
}
}
test("should shrink visible row node when there is not any space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 25;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = -1;
node_1->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 30;
node_2->style.dimensions[CSS_HEIGHT] = 100;
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 15;
node_1->style.dimensions[CSS_HEIGHT] = 100;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 25;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 25;
node_1->layout.dimensions[CSS_WIDTH] = 30;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 30;
node_2->layout.dimensions[CSS_HEIGHT] = 100;
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 55;
node_1->layout.dimensions[CSS_WIDTH] = 15;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
}
}
test("should not shrink visible row node with siblings when there is space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 25;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex = -1;
node_1->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 80;
node_2->style.dimensions[CSS_HEIGHT] = 100;
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 15;
node_1->style.dimensions[CSS_HEIGHT] = 100;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 25;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 25;
node_1->layout.dimensions[CSS_WIDTH] = 60;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 80;
node_2->layout.dimensions[CSS_HEIGHT] = 100;
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 85;
node_1->layout.dimensions[CSS_WIDTH] = 15;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
}
}
test("should shrink visible row node with siblings when there is not any space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.flex = -1;
node_1->style.dimensions[CSS_WIDTH] = 30;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 40;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.flex = -1;
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 100;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 22.5;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 22.5;
node_1->layout.dimensions[CSS_WIDTH] = 40;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 62.5;
node_1->layout.dimensions[CSS_WIDTH] = 37.5;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
}
}
test("should shrink visible row nodes when there is not any space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.overflow = CSS_OVERFLOW_HIDDEN;
node_1->style.flex = -1;
node_1->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 25;
node_2->style.dimensions[CSS_HEIGHT] = 100;
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 25;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 25;
node_2->layout.dimensions[CSS_HEIGHT] = 100;
}
}
}
test("should not shrink hidden row node when there is space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.overflow = CSS_OVERFLOW_HIDDEN;
node_1->style.flex = -1;
node_1->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 200;
node_2->style.dimensions[CSS_HEIGHT] = 100;
}
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 1);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 200;
node_2->layout.dimensions[CSS_HEIGHT] = 100;
}
}
}
test("should shrink hidden row node when there is not any space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 25;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.overflow = CSS_OVERFLOW_HIDDEN;
node_1->style.flex = -1;
node_1->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 30;
node_2->style.dimensions[CSS_HEIGHT] = 100;
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 15;
node_1->style.dimensions[CSS_HEIGHT] = 100;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 25;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 25;
node_1->layout.dimensions[CSS_WIDTH] = 30;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 30;
node_2->layout.dimensions[CSS_HEIGHT] = 100;
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 55;
node_1->layout.dimensions[CSS_WIDTH] = 15;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
}
}
test("should not shrink hidden row node with siblings when there is space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 25;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.overflow = CSS_OVERFLOW_HIDDEN;
node_1->style.flex = -1;
node_1->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.dimensions[CSS_WIDTH] = 80;
node_2->style.dimensions[CSS_HEIGHT] = 100;
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 15;
node_1->style.dimensions[CSS_HEIGHT] = 100;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 25;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 25;
node_1->layout.dimensions[CSS_WIDTH] = 60;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 80;
node_2->layout.dimensions[CSS_HEIGHT] = 100;
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 85;
node_1->layout.dimensions[CSS_WIDTH] = 15;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
}
}
test("should shrink hidden row node with siblings when there is not any space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 100;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.overflow = CSS_OVERFLOW_HIDDEN;
node_1->style.flex = -1;
node_1->style.dimensions[CSS_WIDTH] = 30;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 40;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.overflow = CSS_OVERFLOW_HIDDEN;
node_1->style.flex = -1;
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 100;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 22.5;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 22.5;
node_1->layout.dimensions[CSS_WIDTH] = 40;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 62.5;
node_1->layout.dimensions[CSS_WIDTH] = 37.5;
node_1->layout.dimensions[CSS_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);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 213;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 25;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_1->style.align_items = CSS_ALIGN_FLEX_START;
node_1->style.flex = -1;
node_1->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->measure = measure;
node_2->context = "loooooooooong with space";
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 15;
node_1->style.dimensions[CSS_HEIGHT] = 100;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 213;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 25;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 25;
node_1->layout.dimensions[CSS_WIDTH] = 172;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 172;
node_2->layout.dimensions[CSS_HEIGHT] = 18;
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 197;
node_1->layout.dimensions[CSS_WIDTH] = 15;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
}
}
test("should not shrink text node with siblings when there is space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.dimensions[CSS_WIDTH] = 140;
node_0->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 25;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_1->style.align_items = CSS_ALIGN_FLEX_START;
node_1->style.flex = -1;
node_1->style.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->style.flex = -1;
node_2->measure = measure;
node_2->context = "loooooooooong with space";
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 15;
node_1->style.dimensions[CSS_HEIGHT] = 100;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 140;
node_0->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 25;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 25;
node_1->layout.dimensions[CSS_WIDTH] = 100;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
init_css_node_children(node_1, 1);
{
css_node_t *node_2;
node_2 = node_1->get_child(node_1->context, 0);
node_2->layout.position[CSS_TOP] = 0;
node_2->layout.position[CSS_LEFT] = 0;
node_2->layout.dimensions[CSS_WIDTH] = 100;
node_2->layout.dimensions[CSS_HEIGHT] = 36;
}
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 125;
node_1->layout.dimensions[CSS_WIDTH] = 15;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
}
}
test("should shrink text node with siblings when there is not any space left over", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.align_content = CSS_ALIGN_STRETCH;
node_0->style.align_items = CSS_ALIGN_FLEX_START;
node_0->style.flex_wrap = CSS_WRAP;
node_0->style.dimensions[CSS_WIDTH] = 300;
node_0->style.dimensions[CSS_HEIGHT] = 380;
init_css_node_children(node_0, 15);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
node_1 = node_0->get_child(node_0->context, 3);
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
node_1 = node_0->get_child(node_0->context, 4);
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
node_1 = node_0->get_child(node_0->context, 5);
node_1->style.align_self = CSS_ALIGN_FLEX_START;
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
node_1 = node_0->get_child(node_0->context, 6);
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
node_1 = node_0->get_child(node_0->context, 7);
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 100;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
node_1 = node_0->get_child(node_0->context, 8);
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
node_1 = node_0->get_child(node_0->context, 9);
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
node_1 = node_0->get_child(node_0->context, 10);
node_1->style.align_self = CSS_ALIGN_FLEX_START;
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
node_1 = node_0->get_child(node_0->context, 11);
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
node_1 = node_0->get_child(node_0->context, 12);
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
node_1 = node_0->get_child(node_0->context, 13);
node_1->style.align_self = CSS_ALIGN_FLEX_START;
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
node_1 = node_0->get_child(node_0->context, 14);
node_1->style.dimensions[CSS_WIDTH] = 50;
node_1->style.dimensions[CSS_HEIGHT] = 50;
node_1->style.margin[CSS_LEFT] = 10;
node_1->style.margin[CSS_TOP] = 10;
node_1->style.margin[CSS_RIGHT] = 10;
node_1->style.margin[CSS_BOTTOM] = 10;
node_1->style.margin[CSS_START] = 10;
node_1->style.margin[CSS_END] = 10;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 300;
node_0->layout.dimensions[CSS_HEIGHT] = 380;
init_css_node_children(node_0, 15);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 10;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 10;
node_1->layout.position[CSS_LEFT] = 80;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 10;
node_1->layout.position[CSS_LEFT] = 150;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
node_1 = node_0->get_child(node_0->context, 3);
node_1->layout.position[CSS_TOP] = 10;
node_1->layout.position[CSS_LEFT] = 220;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
node_1 = node_0->get_child(node_0->context, 4);
node_1->layout.position[CSS_TOP] = 92.5;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 5);
node_1->layout.position[CSS_TOP] = 92.5;
node_1->layout.position[CSS_LEFT] = 80;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
node_1 = node_0->get_child(node_0->context, 6);
node_1->layout.position[CSS_TOP] = 92.5;
node_1->layout.position[CSS_LEFT] = 150;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
node_1 = node_0->get_child(node_0->context, 7);
node_1->layout.position[CSS_TOP] = 92.5;
node_1->layout.position[CSS_LEFT] = 220;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 100;
node_1 = node_0->get_child(node_0->context, 8);
node_1->layout.position[CSS_TOP] = 225;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
node_1 = node_0->get_child(node_0->context, 9);
node_1->layout.position[CSS_TOP] = 225;
node_1->layout.position[CSS_LEFT] = 80;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
node_1 = node_0->get_child(node_0->context, 10);
node_1->layout.position[CSS_TOP] = 225;
node_1->layout.position[CSS_LEFT] = 150;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
node_1 = node_0->get_child(node_0->context, 11);
node_1->layout.position[CSS_TOP] = 225;
node_1->layout.position[CSS_LEFT] = 220;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
node_1 = node_0->get_child(node_0->context, 12);
node_1->layout.position[CSS_TOP] = 307.5;
node_1->layout.position[CSS_LEFT] = 10;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
node_1 = node_0->get_child(node_0->context, 13);
node_1->layout.position[CSS_TOP] = 307.5;
node_1->layout.position[CSS_LEFT] = 80;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
node_1 = node_0->get_child(node_0->context, 14);
node_1->layout.position[CSS_TOP] = 307.5;
node_1->layout.position[CSS_LEFT] = 150;
node_1->layout.dimensions[CSS_WIDTH] = 50;
node_1->layout.dimensions[CSS_HEIGHT] = 50;
}
}
test("should layout with alignContent: stretch, and alignItems: flex-start", root_node, root_layout);
}
/** END_GENERATED **/
2014-09-26 20:08:37 -07:00
return tests_finished();
}