From d7f3ea868d8c6862bb201895700674983b99fb99 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Thu, 11 Sep 2014 09:23:30 -0700 Subject: [PATCH] Import latest changes --- Makefile | 8 +- src/Layout-test-utils.c | 33 +- src/Layout-test-utils.h | 2 + src/Layout-test-utils.js | 17 +- src/Layout.c | 123 +- src/Layout.h | 24 +- src/Layout.js | 132 +- src/__tests__/Layout-test.c | 3118 +++++++++++++++++++--------------- src/__tests__/Layout-test.js | 130 +- src/transpile.html | 15 +- 10 files changed, 1934 insertions(+), 1668 deletions(-) diff --git a/Makefile b/Makefile index f7d26ec4..20187e3a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,10 @@ +FILES=src/__tests__/Layout-test.c src/Layout.c src/Layout-test-utils.c + test: - @gcc -Weverything -Werror -Wno-padded src/__tests__/Layout-test.c src/Layout.c src/Layout-test-utils.c && ./a.out + @gcc -Weverything -Werror -Wno-padded $(FILES) && ./a.out + @rm a.out + +debug: + @gcc -ggdb $(FILES) && lldb ./a.out @rm a.out diff --git a/src/Layout-test-utils.c b/src/Layout-test-utils.c index d0d97eb4..e90a4c2e 100644 --- a/src/Layout-test-utils.c +++ b/src/Layout-test-utils.c @@ -1,5 +1,6 @@ #include "Layout-test-utils.h" +#include static bool eq(float a, float b) { return fabs(a - b) < 0.0001; @@ -14,7 +15,7 @@ static bool are_layout_equal(css_node_t *a, css_node_t *b) { return false; } for (int i = 0; i < a->children_count; ++i) { - if (!are_layout_equal(&a->children[i], &b->children[i])) { + if (!are_layout_equal(a->get_child(a->context, i), b->get_child(b->context, i))) { return false; } } @@ -64,3 +65,33 @@ void test(const char *name, css_node_t *style, css_node_t *expected_layout) { free_css_node(style); free_css_node(expected_layout); } + +static css_node_t* get_child(void *context, int i) { + css_node_t* children = (css_node_t*)context; + return &children[i]; +} + +static bool is_dirty(void *context) { + (void)context; // remove unused warning + return true; +} + +static void init_test_css_node(css_node_t *node) { + node->get_child = get_child; + node->is_dirty = is_dirty; +} + +css_node_t *new_test_css_node(void) { + css_node_t *node = new_css_node(); + init_test_css_node(node); + return node; +} + +void init_css_node_children(css_node_t *node, int children_count) { + node->context = calloc((size_t)children_count, sizeof(css_node_t)); + for (int i = 0; i < children_count; ++i) { + init_css_node(node->get_child(node->context, i)); + init_test_css_node(node->get_child(node->context, i)); + } + node->children_count = children_count; +} diff --git a/src/Layout-test-utils.h b/src/Layout-test-utils.h index 7b708956..5cba72c5 100644 --- a/src/Layout-test-utils.h +++ b/src/Layout-test-utils.h @@ -6,3 +6,5 @@ void test(const char *name, css_node_t *style, css_node_t *expected_layout); css_dim_t measure(void *context, float width); +void init_css_node_children(css_node_t *node, int children_count); +css_node_t *new_test_css_node(void); diff --git a/src/Layout-test-utils.js b/src/Layout-test-utils.js index b7063b7c..6f665bfb 100644 --- a/src/Layout-test-utils.js +++ b/src/Layout-test-utils.js @@ -114,22 +114,13 @@ var layoutTestUtils = (function() { var div = renderNode(body, node); - function isInt(n) { - return n === ~~n; - } - function buildLayout(absoluteRect, div) { var rect = div.getBoundingClientRect(); - // There's a bug with getBoundingClientRect() with position absolute - // and overlapping left and right. - // https://code.google.com/p/chromium/issues/detail?id=383936 - // In order to workaround, we can check if offsetWidth is negative and - // return 0 in this case. var result = { - width: div.offsetWidth < 0 ? 0 : rect.width, - height: div.offsetHeight < 0 ? 0 : rect.height, - top: div.offsetHeight < 0 ? div.offsetTop : rect.top - absoluteRect.top, - left: div.offsetWidth < 0 ? div.offsetLeft : rect.left - absoluteRect.left + width: rect.width, + height: rect.height, + top: rect.top - absoluteRect.top, + left: rect.left - absoluteRect.left }; var children = []; diff --git a/src/Layout.c b/src/Layout.c index f0bf426b..ee2edd77 100644 --- a/src/Layout.c +++ b/src/Layout.c @@ -6,11 +6,18 @@ #include "Layout.h" +static bool isUndefined(float value) { + return isnan(value); +} + static bool eq(float a, float b) { + if (isUndefined(a)) { + return isUndefined(b); + } return fabs(a - b) < 0.0001; } -static void init_css_node(css_node_t *node) { +void init_css_node(css_node_t *node) { node->style.align_items = CSS_ALIGN_FLEX_START; // Some of the fields default to undefined and not 0 @@ -24,6 +31,12 @@ static void init_css_node(css_node_t *node) { node->layout.dimensions[CSS_WIDTH] = CSS_UNDEFINED; node->layout.dimensions[CSS_HEIGHT] = CSS_UNDEFINED; + + // Such that the comparison is always going to be false + node->layout.last_requested_dimensions[CSS_WIDTH] = -1; + node->layout.last_requested_dimensions[CSS_HEIGHT] = -1; + node->layout.last_parent_max_width = -1; + node->layout.should_update = true; } css_node_t *new_css_node() { @@ -32,23 +45,7 @@ css_node_t *new_css_node() { return node; } -void init_css_node_children(css_node_t *node, int children_count) { - node->children = calloc((unsigned long)children_count, sizeof(css_node_t)); - for (int i = 0; i < children_count; ++i) { - init_css_node(&node->children[i]); - } - node->children_count = children_count; -} - -static void cleanup_css_node(css_node_t *node) { - for (int i = 0; i < node->children_count; ++i) { - cleanup_css_node(&node->children[i]); - } - free(node->children); -} - void free_css_node(css_node_t *node) { - cleanup_css_node(node); free(node); } @@ -132,9 +129,7 @@ static void print_css_node_rec( printf("alignSelf: 'stretch', "); } - if (node->style.flex == CSS_FLEX_ONE) { - printf("flex: 1, "); - } + print_number_nan("flex", node->style.flex); if (four_equal(node->style.margin)) { print_number_0("margin", node->style.margin[CSS_LEFT]); @@ -176,10 +171,10 @@ static void print_css_node_rec( print_number_nan("bottom", node->style.position[CSS_BOTTOM]); } - if (node->children_count > 0) { + if (options & CSS_PRINT_CHILDREN && node->children_count > 0) { printf("children: [\n"); for (int i = 0; i < node->children_count; ++i) { - print_css_node_rec(&node->children[i], options, level + 1); + print_css_node_rec(node->get_child(node->context, i), options, level + 1); } indent(level); printf("]},\n"); @@ -212,10 +207,6 @@ static css_dimension_t dim[2] = { -static bool isUndefined(float value) { - return isnan(value); -} - static float getMargin(css_node_t *node, int location) { return node->style.margin[location]; } @@ -265,12 +256,15 @@ static css_flex_direction_t getFlexDirection(css_node_t *node) { return node->style.flex_direction; } -static css_flex_t getFlex(css_node_t *node) { +static float getFlex(css_node_t *node) { return node->style.flex; } static bool isFlex(css_node_t *node) { - return getPositionType(node) == CSS_POSITION_RELATIVE && getFlex(node); + return ( + getPositionType(node) == CSS_POSITION_RELATIVE && + getFlex(node) > 0 + ); } static float getDimWithMargin(css_node_t *node, css_flex_direction_t axis) { @@ -327,7 +321,7 @@ static float getRelativePosition(css_node_t *node, css_flex_direction_t axis) { return -getPosition(node, trailing[axis]); } -void layoutNode(css_node_t *node, float parentMaxWidth) { +static void layoutNodeImpl(css_node_t *node, float parentMaxWidth) { css_flex_direction_t mainAxis = getFlexDirection(node); css_flex_direction_t crossAxis = mainAxis == CSS_FLEX_DIRECTION_ROW ? CSS_FLEX_DIRECTION_COLUMN : @@ -382,10 +376,11 @@ void layoutNode(css_node_t *node, float parentMaxWidth) { return; } - // Pre-fill cross axis dimensions when the child is using stretch before - // we call the recursive layout pass + // Pre-fill some dimensions straight from the parent for (int i = 0; i < node->children_count; ++i) { - css_node_t* child = &node->children[i]; + css_node_t* child = node->get_child(node->context, i); + // Pre-fill cross axis dimensions when the child is using stretch before + // we call the recursive layout pass if (getAlignItem(node, child) == CSS_ALIGN_STRETCH && getPositionType(child) == CSS_POSITION_RELATIVE && !isUndefined(node->layout.dimensions[dim[crossAxis]]) && @@ -398,6 +393,26 @@ void layoutNode(css_node_t *node, float parentMaxWidth) { // You never want to go smaller than padding getPaddingAndBorderAxis(child, crossAxis) ); + } else if (getPositionType(child) == CSS_POSITION_ABSOLUTE) { + // Pre-fill dimensions when using absolute position and both offsets for the axis are defined (either both + // left and right or top and bottom). + for (int ii = 0; ii < 2; ii++) { + css_flex_direction_t axis = ii ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN; + if (!isUndefined(node->layout.dimensions[dim[axis]]) && + !isDimDefined(child, axis) && + isPosDefined(child, leading[axis]) && + isPosDefined(child, trailing[axis])) { + child->layout.dimensions[dim[axis]] = fmaxf( + node->layout.dimensions[dim[axis]] - + getPaddingAndBorderAxis(node, axis) - + getMarginAxis(child, axis) - + getPosition(child, leading[axis]) - + getPosition(child, trailing[axis]), + // You never want to go smaller than padding + getPaddingAndBorderAxis(child, axis) + ); + } + } } } @@ -412,14 +427,16 @@ void layoutNode(css_node_t *node, float parentMaxWidth) { // There are three kind of children, non flexible, flexible and absolute. // We need to know how many there are in order to distribute the space. int flexibleChildrenCount = 0; + float totalFlexible = 0; int nonFlexibleChildrenCount = 0; for (int i = 0; i < node->children_count; ++i) { - css_node_t* child = &node->children[i]; + css_node_t* child = node->get_child(node->context, i); // It only makes sense to consider a child flexible if we have a computed // dimension for the node-> if (!isUndefined(node->layout.dimensions[dim[mainAxis]]) && isFlex(child)) { flexibleChildrenCount++; + totalFlexible += getFlex(child); // Even if we don't know its exact size yet, we already know the padding, // border and margin. We'll use this partial information to compute the @@ -474,7 +491,7 @@ void layoutNode(css_node_t *node, float parentMaxWidth) { // If there are flexible children in the mix, they are going to fill the // remaining space if (flexibleChildrenCount) { - float flexibleMainDim = remainingMainDim / flexibleChildrenCount; + float flexibleMainDim = remainingMainDim / totalFlexible; // The non flexible children can overflow the container, in this case // we should just assume that there is no space available. @@ -485,11 +502,11 @@ void layoutNode(css_node_t *node, float parentMaxWidth) { // children. This is faster than actually allocating a new array that // contains only flexible children. for (int i = 0; i < node->children_count; ++i) { - css_node_t* child = &node->children[i]; + css_node_t* child = node->get_child(node->context, i); if (isFlex(child)) { // At this point we know the final size of the element in the main // dimension - child->layout.dimensions[dim[mainAxis]] = flexibleMainDim + + child->layout.dimensions[dim[mainAxis]] = flexibleMainDim * getFlex(child) + getPaddingAndBorderAxis(child, mainAxis); float maxWidth = CSS_UNDEFINED; @@ -543,7 +560,7 @@ void layoutNode(css_node_t *node, float parentMaxWidth) { float mainDim = leadingMainDim + getPaddingAndBorder(node, leading[mainAxis]); for (int i = 0; i < node->children_count; ++i) { - css_node_t* child = &node->children[i]; + css_node_t* child = node->get_child(node->context, i); if (getPositionType(child) == CSS_POSITION_ABSOLUTE && isPosDefined(child, leading[mainAxis])) { @@ -598,7 +615,7 @@ void layoutNode(css_node_t *node, float parentMaxWidth) { // Position elements in the cross axis for (int i = 0; i < node->children_count; ++i) { - css_node_t* child = &node->children[i]; + css_node_t* child = node->get_child(node->context, i); if (getPositionType(child) == CSS_POSITION_ABSOLUTE && isPosDefined(child, leading[crossAxis])) { @@ -650,3 +667,33 @@ void layoutNode(css_node_t *node, float parentMaxWidth) { } } } + +void layoutNode(css_node_t *node, float parentMaxWidth) { + css_layout_t *layout = &node->layout; + layout->should_update = true; + + bool skipLayout = + !node->is_dirty(node->context) && + eq(layout->last_requested_dimensions[CSS_WIDTH], layout->dimensions[CSS_WIDTH]) && + eq(layout->last_requested_dimensions[CSS_HEIGHT], layout->dimensions[CSS_HEIGHT]) && + eq(layout->last_parent_max_width, parentMaxWidth); + + if (skipLayout) { + layout->dimensions[CSS_WIDTH] = layout->last_dimensions[CSS_WIDTH]; + layout->dimensions[CSS_HEIGHT] = layout->last_dimensions[CSS_HEIGHT]; + layout->position[CSS_TOP] = layout->last_position[CSS_TOP]; + layout->position[CSS_LEFT] = layout->last_position[CSS_LEFT]; + } else { + layout->last_requested_dimensions[CSS_WIDTH] = layout->dimensions[CSS_WIDTH]; + layout->last_requested_dimensions[CSS_HEIGHT] = layout->dimensions[CSS_HEIGHT]; + layout->last_parent_max_width = parentMaxWidth; + + layoutNodeImpl(node, parentMaxWidth); + + layout->last_dimensions[CSS_WIDTH] = layout->dimensions[CSS_WIDTH]; + layout->last_dimensions[CSS_HEIGHT] = layout->dimensions[CSS_HEIGHT]; + layout->last_position[CSS_TOP] = layout->position[CSS_TOP]; + layout->last_position[CSS_LEFT] = layout->position[CSS_LEFT]; + } +} + diff --git a/src/Layout.h b/src/Layout.h index 97cc4f94..b6a245a6 100644 --- a/src/Layout.h +++ b/src/Layout.h @@ -2,6 +2,7 @@ #define __LAYOUT_H #include +#include #define CSS_UNDEFINED NAN typedef enum { @@ -27,11 +28,6 @@ typedef enum { CSS_ALIGN_STRETCH } css_align_t; -typedef enum { - CSS_FLEX_NONE = 0, - CSS_FLEX_ONE -} css_flex_t; - typedef enum { CSS_POSITION_RELATIVE = 0, CSS_POSITION_ABSOLUTE @@ -54,6 +50,14 @@ typedef enum { typedef struct { float position[2]; float dimensions[2]; + + // Instead of recomputing the entire layout every single time, we + // cache some information to break early when nothing changed + bool should_update; + float last_requested_dimensions[2]; + float last_parent_max_width; + float last_dimensions[2]; + float last_position[2]; } css_layout_t; typedef struct { @@ -65,8 +69,8 @@ typedef struct { css_justify_t justify_content; css_align_t align_items; css_align_t align_self; - css_flex_t flex; css_position_type_t position_type; + float flex; float margin[4]; float position[4]; /** @@ -87,24 +91,26 @@ typedef struct { typedef struct css_node { css_style_t style; css_layout_t layout; - struct css_node *children; int children_count; css_dim_t (*measure)(void *context, float width); void (*print)(void *context); + struct css_node* (*get_child)(void *context, int i); + bool (*is_dirty)(void *context); void *context; } css_node_t; // Lifecycle of nodes and children css_node_t *new_css_node(void); -void init_css_node_children(css_node_t *node, int children_count); +void init_css_node(css_node_t *node); void free_css_node(css_node_t *node); // Print utilities typedef enum { CSS_PRINT_LAYOUT = 1, - CSS_PRINT_STYLE = 2 + CSS_PRINT_STYLE = 2, + CSS_PRINT_CHILDREN = 4, } css_print_options_t; void print_css_node(css_node_t *node, css_print_options_t options); diff --git a/src/Layout.js b/src/Layout.js index 9e2e9e18..91bd6f3f 100755 --- a/src/Layout.js +++ b/src/Layout.js @@ -94,11 +94,14 @@ var computeLayout = (function() { } function getFlex(node) { - return node.style.flex === 1; + return node.style.flex; } function isFlex(node) { - return getPositionType(node) === CSS_POSITION_RELATIVE && getFlex(node); + return ( + getPositionType(node) === CSS_POSITION_RELATIVE && + getFlex(node) > 0 + ); } function getDimWithMargin(node, axis) { @@ -249,10 +252,11 @@ var computeLayout = (function() { return; } - // Pre-fill cross axis dimensions when the child is using stretch before - // we call the recursive layout pass + // Pre-fill some dimensions straight from the parent for (var/*int*/ i = 0; i < node.children.length; ++i) { var/*css_node_t**/ child = node.children[i]; + // Pre-fill cross axis dimensions when the child is using stretch before + // we call the recursive layout pass if (getAlignItem(node, child) === CSS_ALIGN_STRETCH && getPositionType(child) === CSS_POSITION_RELATIVE && !isUndefined(node.layout[dim[crossAxis]]) && @@ -265,6 +269,26 @@ var computeLayout = (function() { // You never want to go smaller than padding getPaddingAndBorderAxis(child, crossAxis) ); + } else if (getPositionType(child) == CSS_POSITION_ABSOLUTE) { + // Pre-fill dimensions when using absolute position and both offsets for the axis are defined (either both + // left and right or top and bottom). + for (var/*int*/ ii = 0; ii < 2; ii++) { + var/*css_flex_direction_t*/ axis = ii ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN; + if (!isUndefined(node.layout[dim[axis]]) && + !isDimDefined(child, axis) && + isPosDefined(child, leading[axis]) && + isPosDefined(child, trailing[axis])) { + child.layout[dim[axis]] = fmaxf( + node.layout[dim[axis]] - + getPaddingAndBorderAxis(node, axis) - + getMarginAxis(child, axis) - + getPosition(child, leading[axis]) - + getPosition(child, trailing[axis]), + // You never want to go smaller than padding + getPaddingAndBorderAxis(child, axis) + ); + } + } } } @@ -279,6 +303,7 @@ var computeLayout = (function() { // There are three kind of children, non flexible, flexible and absolute. // We need to know how many there are in order to distribute the space. var/*int*/ flexibleChildrenCount = 0; + var/*float*/ totalFlexible = 0; var/*int*/ nonFlexibleChildrenCount = 0; for (var/*int*/ i = 0; i < node.children.length; ++i) { var/*css_node_t**/ child = node.children[i]; @@ -287,6 +312,7 @@ var computeLayout = (function() { // dimension for the node. if (!isUndefined(node.layout[dim[mainAxis]]) && isFlex(child)) { flexibleChildrenCount++; + totalFlexible += getFlex(child); // Even if we don't know its exact size yet, we already know the padding, // border and margin. We'll use this partial information to compute the @@ -341,7 +367,7 @@ var computeLayout = (function() { // If there are flexible children in the mix, they are going to fill the // remaining space if (flexibleChildrenCount) { - var/*float*/ flexibleMainDim = remainingMainDim / flexibleChildrenCount; + var/*float*/ flexibleMainDim = remainingMainDim / totalFlexible; // The non flexible children can overflow the container, in this case // we should just assume that there is no space available. @@ -356,7 +382,7 @@ var computeLayout = (function() { if (isFlex(child)) { // At this point we know the final size of the element in the main // dimension - child.layout[dim[mainAxis]] = flexibleMainDim + + child.layout[dim[mainAxis]] = flexibleMainDim * getFlex(child) + getPaddingAndBorderAxis(child, mainAxis); var/*float*/ maxWidth = CSS_UNDEFINED; @@ -412,12 +438,14 @@ var computeLayout = (function() { for (var/*int*/ i = 0; i < node.children.length; ++i) { var/*css_node_t**/ child = node.children[i]; - var/*bool*/ leadingPos = isPosDefined(child, leading[mainAxis]); - var/*bool*/ trailingPos = isPosDefined(child, trailing[mainAxis]); - if (getPositionType(child) === CSS_POSITION_ABSOLUTE && - (leadingPos || trailingPos)) { - // see the loop afterwards + isPosDefined(child, leading[mainAxis])) { + // In case the child is position absolute and has left/top being + // defined, we override the position to whatever the user said + // (and margin/border). + child.layout[pos[mainAxis]] = getPosition(child, leading[mainAxis]) + + getBorder(node, leading[mainAxis]) + + getMargin(child, leading[mainAxis]); } else { // If the child is position absolute (without top/left) or relative, // we put it at the current accumulated offset. @@ -459,93 +487,21 @@ var computeLayout = (function() { ); } - for (var/*int*/ i = 0; i < node.children.length; ++i) { - var/*css_node_t**/ child = node.children[i]; - - var/*bool*/ leadingPos = isPosDefined(child, leading[mainAxis]); - var/*bool*/ trailingPos = isPosDefined(child, trailing[mainAxis]); - - if (getPositionType(child) === CSS_POSITION_ABSOLUTE && - (leadingPos || trailingPos)) { - // In case the child is absolutely positionned and has a - // top/left/bottom/right being set, we override all the previously - // computed positions to set it correctly. - if (leadingPos) { - child.layout[pos[mainAxis]] = - getPosition(child, leading[mainAxis]) + - getBorder(node, leading[mainAxis]) + - getMargin(child, leading[mainAxis]); - } - if (!leadingPos && trailingPos) { - child.layout[pos[mainAxis]] = - node.layout[dim[mainAxis]] - - getBorder(node, trailing[mainAxis]) - - child.layout[dim[mainAxis]] - - getMargin(child, trailing[mainAxis]) - - getPosition(child, trailing[mainAxis]); - } - if (leadingPos && trailingPos) { - if (isDimDefined(child, mainAxis)) { - child.layout[dim[mainAxis]] = fmaxf( - child.style[dim[mainAxis]], - getPaddingAndBorderAxis(node, mainAxis) - ); - } else { - child.layout[dim[mainAxis]] = fmaxf( - getPaddingAndBorderAxis(child, mainAxis), - node.layout[dim[mainAxis]] - - child.layout[pos[mainAxis]] - - getMargin(child, trailing[mainAxis]) - - getPosition(child, trailing[mainAxis]) - ); - } - } - } - } // Position elements in the cross axis for (var/*int*/ i = 0; i < node.children.length; ++i) { var/*css_node_t**/ child = node.children[i]; - var/*bool*/ leadingPos = isPosDefined(child, leading[crossAxis]); - var/*bool*/ trailingPos = isPosDefined(child, trailing[crossAxis]); - if (getPositionType(child) === CSS_POSITION_ABSOLUTE && - (leadingPos || trailingPos)) { + isPosDefined(child, leading[crossAxis])) { // In case the child is absolutely positionned and has a // top/left/bottom/right being set, we override all the previously // computed positions to set it correctly. - if (leadingPos) { - child.layout[pos[crossAxis]] = - getPosition(child, leading[crossAxis]) + - getBorder(node, leading[crossAxis]) + - getMargin(child, leading[crossAxis]); - } - if (!leadingPos && trailingPos) { - child.layout[pos[crossAxis]] = - node.layout[dim[crossAxis]] - - getBorder(node, trailing[crossAxis]) - - child.layout[dim[crossAxis]] - - getMargin(child, trailing[crossAxis]) - - getPosition(child, trailing[crossAxis]); - } - if (leadingPos && trailingPos) { - if (isDimDefined(child, crossAxis)) { - child.layout[dim[crossAxis]] = fmaxf( - child.style[dim[crossAxis]], - getPaddingAndBorderAxis(node, crossAxis) - ); - } else { - child.layout[dim[crossAxis]] = fmaxf( - getPaddingAndBorderAxis(child, crossAxis), - node.layout[dim[crossAxis]] - - child.layout[pos[crossAxis]] - - getMargin(child, trailing[crossAxis]) - - getPosition(child, trailing[crossAxis]) - ); - } - } + child.layout[pos[crossAxis]] = getPosition(child, leading[crossAxis]) + + getBorder(node, leading[crossAxis]) + + getMargin(child, leading[crossAxis]); + } else { var/*float*/ leadingCrossDim = getPaddingAndBorder(node, leading[crossAxis]); diff --git a/src/__tests__/Layout-test.c b/src/__tests__/Layout-test.c index 21e19345..8d6a3a7c 100644 --- a/src/__tests__/Layout-test.c +++ b/src/__tests__/Layout-test.c @@ -6,14 +6,14 @@ int main() { { - css_node_t *root_node = new_css_node(); + 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; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -26,7 +26,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 1000; @@ -34,19 +34,19 @@ int main() init_css_node_children(node_0, 3); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + 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->children[2]; + 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_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -56,17 +56,17 @@ int main() init_css_node_children(node_0, 3); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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] = 500; - node_1 = &node_0->children[1]; + 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] = 250; node_1->layout.dimensions[CSS_HEIGHT] = 250; - node_1 = &node_0->children[2]; + node_1 = node_0->get_child(node_0->context, 2); node_1->layout.position[CSS_TOP] = 750; node_1->layout.position[CSS_LEFT] = 0; node_1->layout.dimensions[CSS_WIDTH] = 125; @@ -78,7 +78,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 1000; @@ -86,26 +86,26 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); 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->children[0]; + 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->children[1]; + 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_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -115,12 +115,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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] = 500; - node_1 = &node_0->children[1]; + 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] = 500; @@ -128,12 +128,12 @@ int main() init_css_node_children(node_1, 2); { css_node_t *node_2; - node_2 = &node_1->children[0]; + 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] = 250; node_2->layout.dimensions[CSS_HEIGHT] = 250; - node_2 = &node_1->children[1]; + node_2 = node_1->get_child(node_1->context, 1); node_2->layout.position[CSS_TOP] = 250; node_2->layout.position[CSS_LEFT] = 0; node_2->layout.dimensions[CSS_WIDTH] = 250; @@ -146,7 +146,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 100; @@ -157,7 +157,7 @@ int main() node_0->style.margin[CSS_BOTTOM] = 10; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 10; @@ -170,7 +170,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 1000; @@ -182,21 +182,21 @@ int main() init_css_node_children(node_0, 3); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->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 = &node_0->children[1]; + 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 = &node_0->children[2]; + 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; @@ -206,7 +206,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 10; @@ -216,17 +216,17 @@ int main() init_css_node_children(node_0, 3); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); 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; - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); 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; - node_1 = &node_0->children[2]; + node_1 = node_0->get_child(node_0->context, 2); node_1->layout.position[CSS_TOP] = 360; node_1->layout.position[CSS_LEFT] = 10; node_1->layout.dimensions[CSS_WIDTH] = 100; @@ -238,7 +238,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; @@ -247,16 +247,16 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->style.dimensions[CSS_WIDTH] = 300; node_1->style.dimensions[CSS_HEIGHT] = 150; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -266,12 +266,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + 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; @@ -283,23 +283,23 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 300; init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->style.dimensions[CSS_WIDTH] = 300; node_1->style.dimensions[CSS_HEIGHT] = 150; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -309,12 +309,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + 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; @@ -326,7 +326,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 1000; @@ -334,16 +334,16 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; - node_1->style.flex = CSS_FLEX_ONE; + node_1 = node_0->get_child(node_0->context, 1); + node_1->style.flex = 1; node_1->style.dimensions[CSS_WIDTH] = 100; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -353,12 +353,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + 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] = 100; @@ -370,7 +370,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 1000; @@ -378,27 +378,27 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.flex = CSS_FLEX_ONE; + 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->children[0]; - node_2->style.flex = CSS_FLEX_ONE; + 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->children[0]; - node_3->style.flex = CSS_FLEX_ONE; + node_3 = node_2->get_child(node_2->context, 0); + node_3->style.flex = 1; node_3->style.dimensions[CSS_WIDTH] = 1000; } } } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -408,7 +408,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -416,7 +416,7 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; + 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; @@ -424,7 +424,7 @@ int main() init_css_node_children(node_2, 1); { css_node_t *node_3; - node_3 = &node_2->children[0]; + 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; @@ -438,7 +438,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 1000; @@ -448,20 +448,20 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->style.margin[CSS_LEFT] = 15; node_1->style.margin[CSS_TOP] = 50; node_1->style.margin[CSS_BOTTOM] = 20; - node_1 = &node_0->children[1]; + 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; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 10; @@ -471,12 +471,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = 50; node_1->layout.position[CSS_LEFT] = 15; node_1->layout.dimensions[CSS_WIDTH] = 100; node_1->layout.dimensions[CSS_HEIGHT] = 100; - node_1 = &node_0->children[1]; + 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; @@ -488,7 +488,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.justify_content = CSS_JUSTIFY_FLEX_START; @@ -497,16 +497,16 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->style.dimensions[CSS_WIDTH] = 100; node_1->style.dimensions[CSS_HEIGHT] = 100; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -516,12 +516,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; - node_1 = &node_0->children[1]; + 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] = 100; @@ -533,7 +533,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; @@ -542,16 +542,16 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->style.dimensions[CSS_WIDTH] = 100; node_1->style.dimensions[CSS_HEIGHT] = 100; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -561,12 +561,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; node_1->layout.dimensions[CSS_HEIGHT] = 100; - node_1 = &node_0->children[1]; + 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] = 100; @@ -578,7 +578,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; @@ -587,16 +587,16 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->style.dimensions[CSS_WIDTH] = 100; node_1->style.dimensions[CSS_HEIGHT] = 100; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -606,12 +606,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; - node_1 = &node_0->children[1]; + 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] = 100; @@ -623,7 +623,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.justify_content = CSS_JUSTIFY_SPACE_AROUND; @@ -632,16 +632,16 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->style.dimensions[CSS_WIDTH] = 100; node_1->style.dimensions[CSS_HEIGHT] = 100; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -651,12 +651,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); 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; - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->layout.position[CSS_TOP] = 700; node_1->layout.position[CSS_LEFT] = 0; node_1->layout.dimensions[CSS_WIDTH] = 100; @@ -668,7 +668,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.justify_content = CSS_JUSTIFY_CENTER; @@ -677,16 +677,16 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->style.dimensions[CSS_WIDTH] = 100; node_1->style.dimensions[CSS_HEIGHT] = 100; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -696,12 +696,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = 400; 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->children[1]; + 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; @@ -713,7 +713,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 1000; @@ -721,14 +721,14 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.flex = CSS_FLEX_ONE; + 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] = 100; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -738,7 +738,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -750,7 +750,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.align_items = CSS_ALIGN_FLEX_START; @@ -759,16 +759,16 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->style.dimensions[CSS_WIDTH] = 100; node_1->style.dimensions[CSS_HEIGHT] = 100; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -778,12 +778,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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] = 100; - node_1 = &node_0->children[1]; + 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] = 100; @@ -795,7 +795,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.align_items = CSS_ALIGN_CENTER; @@ -804,16 +804,16 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->style.dimensions[CSS_WIDTH] = 100; node_1->style.dimensions[CSS_HEIGHT] = 100; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -823,12 +823,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; node_1->layout.dimensions[CSS_HEIGHT] = 100; - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->layout.position[CSS_TOP] = 100; node_1->layout.position[CSS_LEFT] = 450; node_1->layout.dimensions[CSS_WIDTH] = 100; @@ -840,7 +840,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.align_items = CSS_ALIGN_FLEX_END; @@ -849,16 +849,16 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->style.dimensions[CSS_WIDTH] = 100; node_1->style.dimensions[CSS_HEIGHT] = 100; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -868,12 +868,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->layout.position[CSS_TOP] = 100; node_1->layout.position[CSS_LEFT] = 900; node_1->layout.dimensions[CSS_WIDTH] = 100; @@ -885,7 +885,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.align_items = CSS_ALIGN_FLEX_END; @@ -894,17 +894,17 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->style.align_self = CSS_ALIGN_CENTER; node_1->style.dimensions[CSS_WIDTH] = 100; node_1->style.dimensions[CSS_HEIGHT] = 100; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -914,12 +914,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->layout.position[CSS_TOP] = 100; node_1->layout.position[CSS_LEFT] = 450; node_1->layout.dimensions[CSS_WIDTH] = 100; @@ -931,7 +931,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.align_items = CSS_ALIGN_STRETCH; @@ -940,12 +940,12 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.dimensions[CSS_HEIGHT] = 100; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -955,7 +955,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -967,17 +967,17 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + node_1 = node_0->get_child(node_0->context, 0); } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -987,7 +987,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -999,13 +999,13 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + 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; @@ -1013,7 +1013,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1023,7 +1023,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -1035,21 +1035,21 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.dimensions[CSS_HEIGHT] = 100; - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->style.dimensions[CSS_HEIGHT] = 200; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1059,12 +1059,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + 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; @@ -1076,13 +1076,13 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.justify_content = CSS_JUSTIFY_CENTER; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1095,7 +1095,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; @@ -1103,12 +1103,12 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.margin[CSS_TOP] = 10; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1118,7 +1118,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -1130,29 +1130,29 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + 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->children[0]; + 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 = &node_1->children[1]; + node_2 = node_1->get_child(node_1->context, 1); node_2->style.dimensions[CSS_HEIGHT] = 100; } } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1162,7 +1162,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -1170,12 +1170,12 @@ int main() init_css_node_children(node_1, 2); { css_node_t *node_2; - node_2 = &node_1->children[0]; + 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->children[1]; + 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; @@ -1188,18 +1188,18 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; - node_1->style.flex = CSS_FLEX_ONE; + node_1 = node_0->get_child(node_0->context, 0); + node_1->style.flex = 1; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1209,7 +1209,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -1221,19 +1221,19 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.align_items = CSS_ALIGN_STRETCH; init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.margin[CSS_LEFT] = 10; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1243,7 +1243,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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] = 0; @@ -1255,7 +1255,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.padding[CSS_LEFT] = 5; @@ -1264,7 +1264,7 @@ int main() node_0->style.padding[CSS_BOTTOM] = 5; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1277,7 +1277,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.padding[CSS_LEFT] = 5; @@ -1287,11 +1287,11 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1301,7 +1301,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -1313,7 +1313,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.padding[CSS_LEFT] = 5; @@ -1323,7 +1323,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -1331,7 +1331,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1341,7 +1341,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -1353,13 +1353,13 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.align_self = CSS_ALIGN_STRETCH; node_1->style.padding[CSS_LEFT] = 10; node_1->style.padding[CSS_TOP] = 10; @@ -1368,7 +1368,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1378,7 +1378,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -1390,7 +1390,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.padding[CSS_LEFT] = 50; @@ -1400,7 +1400,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.align_self = CSS_ALIGN_STRETCH; node_1->style.padding[CSS_LEFT] = 10; node_1->style.padding[CSS_TOP] = 10; @@ -1409,7 +1409,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1419,7 +1419,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = 50; node_1->layout.position[CSS_LEFT] = 50; node_1->layout.dimensions[CSS_WIDTH] = 20; @@ -1431,18 +1431,18 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + 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->children[0]; + node_2 = node_1->get_child(node_1->context, 0); node_2->style.margin[CSS_LEFT] = 16; node_2->style.margin[CSS_TOP] = 16; node_2->style.margin[CSS_RIGHT] = 16; @@ -1451,7 +1451,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1461,7 +1461,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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] = 32; @@ -1469,7 +1469,7 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; + node_2 = node_1->get_child(node_1->context, 0); node_2->layout.position[CSS_TOP] = 16; node_2->layout.position[CSS_LEFT] = 16; node_2->layout.dimensions[CSS_WIDTH] = 0; @@ -1482,14 +1482,14 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.position[CSS_LEFT] = 5; node_0->style.position[CSS_TOP] = 5; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 5; @@ -1502,7 +1502,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.justify_content = CSS_JUSTIFY_SPACE_AROUND; @@ -1511,11 +1511,11 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1525,7 +1525,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = 7.5; node_1->layout.position[CSS_LEFT] = 0; node_1->layout.dimensions[CSS_WIDTH] = 0; @@ -1537,13 +1537,13 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.position[CSS_BOTTOM] = 5; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = -5; @@ -1556,14 +1556,14 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.position[CSS_TOP] = 10; node_0->style.position[CSS_BOTTOM] = 5; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 10; @@ -1576,7 +1576,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; @@ -1584,17 +1584,17 @@ int main() init_css_node_children(node_0, 3); { css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.flex = CSS_FLEX_ONE; - node_1 = &node_0->children[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.position_type = CSS_POSITION_ABSOLUTE; node_1->style.dimensions[CSS_WIDTH] = 50; - node_1 = &node_0->children[2]; - node_1->style.flex = CSS_FLEX_ONE; + node_1 = node_0->get_child(node_0->context, 2); + node_1->style.flex = 1; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1604,17 +1604,17 @@ int main() init_css_node_children(node_0, 3); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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] = 250; node_1->layout.dimensions[CSS_HEIGHT] = 0; - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); 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; - node_1 = &node_0->children[2]; + 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] = 250; @@ -1626,19 +1626,19 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.position_type = CSS_POSITION_ABSOLUTE; node_1->style.margin[CSS_RIGHT] = 15; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1648,7 +1648,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -1660,20 +1660,20 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.align_self = CSS_ALIGN_CENTER; node_1->style.position_type = CSS_POSITION_ABSOLUTE; node_1->style.padding[CSS_RIGHT] = 12; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1683,7 +1683,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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] = 12; @@ -1695,14 +1695,14 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_HEIGHT] = 5; node_0->style.padding[CSS_BOTTOM] = 20; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1715,14 +1715,14 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 5; node_0->style.padding[CSS_LEFT] = 20; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1735,26 +1735,26 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + 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->children[0]; + node_2 = node_1->get_child(node_1->context, 0); node_2->style.dimensions[CSS_WIDTH] = 400; } - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->style.align_self = CSS_ALIGN_STRETCH; node_1->style.dimensions[CSS_WIDTH] = 200; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1764,7 +1764,7 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -1772,13 +1772,13 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; + 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] = 400; node_2->layout.dimensions[CSS_HEIGHT] = 0; } - node_1 = &node_0->children[1]; + 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] = 200; @@ -1790,7 +1790,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.padding[CSS_LEFT] = 5; @@ -1800,12 +1800,12 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.position_type = CSS_POSITION_ABSOLUTE; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1815,7 +1815,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -1827,22 +1827,22 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.dimensions[CSS_HEIGHT] = 100; - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->style.position_type = CSS_POSITION_ABSOLUTE; node_1->style.position[CSS_LEFT] = 10; node_1->style.position[CSS_TOP] = 10; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1852,12 +1852,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->layout.position[CSS_TOP] = 10; node_1->layout.position[CSS_LEFT] = 10; node_1->layout.dimensions[CSS_WIDTH] = 0; @@ -1869,7 +1869,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.padding[CSS_LEFT] = 20; @@ -1879,13 +1879,13 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.position_type = CSS_POSITION_ABSOLUTE; node_1->style.position[CSS_LEFT] = 5; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1895,7 +1895,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = 20; node_1->layout.position[CSS_LEFT] = 5; node_1->layout.dimensions[CSS_WIDTH] = 0; @@ -1907,20 +1907,20 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.position_type = CSS_POSITION_ABSOLUTE; node_1->style.margin[CSS_TOP] = 5; node_1->style.position[CSS_TOP] = 5; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1930,7 +1930,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -1942,20 +1942,20 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.position_type = CSS_POSITION_ABSOLUTE; node_1->style.margin[CSS_LEFT] = 5; node_1->style.position[CSS_LEFT] = 5; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -1965,7 +1965,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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] = 0; @@ -1977,7 +1977,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.justify_content = CSS_JUSTIFY_SPACE_AROUND; @@ -1985,13 +1985,13 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.position_type = CSS_POSITION_ABSOLUTE; - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2001,12 +2001,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + 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; @@ -2018,7 +2018,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; @@ -2026,13 +2026,13 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.flex = CSS_FLEX_ONE; + node_1 = node_0->get_child(node_0->context, 0); + node_1->style.flex = 1; node_1->style.margin[CSS_LEFT] = 5; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2042,7 +2042,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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] = 695; @@ -2054,7 +2054,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; @@ -2062,15 +2062,15 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.flex = CSS_FLEX_ONE; - node_1 = &node_0->children[1]; - node_1->style.flex = CSS_FLEX_ONE; + 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.padding[CSS_RIGHT] = 5; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2080,12 +2080,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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] = 347.5; node_1->layout.dimensions[CSS_HEIGHT] = 0; - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->layout.position[CSS_TOP] = 0; node_1->layout.position[CSS_LEFT] = 347.5; node_1->layout.dimensions[CSS_WIDTH] = 352.5; @@ -2097,7 +2097,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; @@ -2105,15 +2105,15 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.flex = CSS_FLEX_ONE; - node_1 = &node_0->children[1]; - node_1->style.flex = CSS_FLEX_ONE; + 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_LEFT] = 5; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2123,12 +2123,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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] = 347.5; node_1->layout.dimensions[CSS_HEIGHT] = 0; - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->layout.position[CSS_TOP] = 0; node_1->layout.position[CSS_LEFT] = 352.5; node_1->layout.dimensions[CSS_WIDTH] = 347.5; @@ -2140,21 +2140,21 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_HEIGHT] = 300; init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.dimensions[CSS_HEIGHT] = 600; - node_1 = &node_0->children[1]; - node_1->style.flex = CSS_FLEX_ONE; + node_1 = node_0->get_child(node_0->context, 1); + node_1->style.flex = 1; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2164,12 +2164,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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->children[1]; + 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; @@ -2181,7 +2181,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; @@ -2189,13 +2189,13 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.flex = CSS_FLEX_ONE; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.position_type = CSS_POSITION_ABSOLUTE; + node_1->style.flex = 1; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2205,7 +2205,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -2217,22 +2217,22 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_HEIGHT] = 500; init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.flex = CSS_FLEX_ONE; - node_1 = &node_0->children[1]; - node_1->style.flex = CSS_FLEX_ONE; + 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.position_type = CSS_POSITION_ABSOLUTE; + node_1->style.flex = 1; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2242,12 +2242,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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] = 500; - node_1 = &node_0->children[1]; + 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] = 0; @@ -2259,7 +2259,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.border[CSS_LEFT] = 5; @@ -2268,7 +2268,7 @@ int main() node_0->style.border[CSS_BOTTOM] = 5; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2281,20 +2281,20 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.border[CSS_TOP] = 1; init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.position_type = CSS_POSITION_ABSOLUTE; node_1->style.position[CSS_TOP] = -1; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2304,7 +2304,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -2316,7 +2316,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.border[CSS_LEFT] = 1; @@ -2326,13 +2326,13 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.position_type = CSS_POSITION_ABSOLUTE; node_1->style.position[CSS_LEFT] = 5; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2342,7 +2342,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = 1; node_1->layout.position[CSS_LEFT] = 6; node_1->layout.dimensions[CSS_WIDTH] = 0; @@ -2354,14 +2354,14 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 50; init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.align_self = CSS_ALIGN_STRETCH; node_1->style.margin[CSS_LEFT] = 20; node_1->style.padding[CSS_LEFT] = 20; @@ -2371,7 +2371,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2381,7 +2381,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = 0; node_1->layout.position[CSS_LEFT] = 20; node_1->layout.dimensions[CSS_WIDTH] = 40; @@ -2393,18 +2393,18 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.border[CSS_RIGHT] = 5; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2414,7 +2414,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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] = 5; @@ -2426,7 +2426,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; @@ -2434,12 +2434,12 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.margin[CSS_RIGHT] = -8; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2449,7 +2449,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -2461,14 +2461,14 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->measure = measure; node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2481,7 +2481,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 10; @@ -2489,7 +2489,7 @@ int main() node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2502,7 +2502,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.margin[CSS_LEFT] = 5; @@ -2517,7 +2517,7 @@ int main() node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 5; @@ -2530,25 +2530,25 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { 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->children[0]; + 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->children[0]; + node_2 = node_1->get_child(node_1->context, 0); node_2->style.align_self = CSS_ALIGN_STRETCH; } } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2558,7 +2558,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -2566,7 +2566,7 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; + 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; @@ -2579,27 +2579,27 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + 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; - node_2 = &node_1->children[0]; - node_2->style.flex = CSS_FLEX_ONE; + 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"; } } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2609,7 +2609,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -2617,7 +2617,7 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; + 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; @@ -2630,27 +2630,27 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; - node_1 = &node_0->children[0]; + 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; - node_2 = &node_1->children[0]; + node_2 = node_1->get_child(node_1->context, 0); node_2->measure = measure; node_2->context = "loooooooooong with space"; } } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2660,7 +2660,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -2668,7 +2668,7 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; + 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; @@ -2681,20 +2681,20 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + 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; - node_2 = &node_1->children[0]; + node_2 = node_1->get_child(node_1->context, 0); node_2->style.dimensions[CSS_WIDTH] = 130; node_2->measure = measure; node_2->context = "loooooooooong with space"; @@ -2702,7 +2702,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2712,7 +2712,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -2720,7 +2720,7 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; + 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; @@ -2733,20 +2733,20 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->measure = measure; node_1->context = "loooooooooong with space"; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2756,7 +2756,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -2768,7 +2768,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 100; @@ -2779,7 +2779,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.margin[CSS_LEFT] = 10; node_1->style.margin[CSS_TOP] = 10; node_1->style.margin[CSS_RIGHT] = 10; @@ -2787,14 +2787,14 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; + node_2 = node_1->get_child(node_1->context, 0); node_2->measure = measure; node_2->context = "loooooooooong with space"; } } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2804,7 +2804,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = 20; node_1->layout.position[CSS_LEFT] = 20; node_1->layout.dimensions[CSS_WIDTH] = 100; @@ -2812,7 +2812,7 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; + 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; @@ -2825,7 +2825,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; @@ -2833,13 +2833,13 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.dimensions[CSS_HEIGHT] = 900; - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2849,12 +2849,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; - node_1 = &node_0->children[1]; + 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; @@ -2866,7 +2866,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; @@ -2875,12 +2875,12 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.dimensions[CSS_WIDTH] = 900; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2890,7 +2890,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -2902,19 +2902,19 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + 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->children[0]; + 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; @@ -2925,7 +2925,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2935,7 +2935,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -2943,7 +2943,7 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; + 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] = 171; @@ -2956,18 +2956,18 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + 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; - node_2 = &node_1->children[0]; + 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; @@ -2978,7 +2978,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -2988,7 +2988,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -2996,7 +2996,7 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; + 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; @@ -3009,7 +3009,129 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.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); + node_1->style.flex = 2.5; + node_1 = node_0->get_child(node_0->context, 1); + 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] = 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; + } + } + + test("should layout with arbitrary flex", 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, 2); + { + css_node_t *node_1; + node_1 = node_0->get_child(node_0->context, 0); + node_1 = node_0->get_child(node_0->context, 1); + 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] = 0; + 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] = 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 with negative flex", 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; @@ -3022,7 +3144,7 @@ int main() node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -3035,20 +3157,20 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.position_type = CSS_POSITION_ABSOLUTE; node_1->measure = measure; node_1->context = "loooooooooong with space"; } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -3058,7 +3180,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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; @@ -3070,24 +3192,36 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { + css_node_t *node_0 = root_node; + node_0->style.justify_content = CSS_JUSTIFY_FLEX_START; + node_0->style.dimensions[CSS_WIDTH] = 620; + node_0->style.dimensions[CSS_HEIGHT] = 595; + node_0->style.margin[CSS_BOTTOM] = 13; + node_0->style.padding[CSS_LEFT] = 7; + node_0->style.padding[CSS_TOP] = 7; + node_0->style.padding[CSS_RIGHT] = 7; + node_0->style.padding[CSS_BOTTOM] = 7; + node_0->style.border[CSS_RIGHT] = 3; + node_0->measure = measure; + node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + 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; + node_0->layout.dimensions[CSS_WIDTH] = 620; + node_0->layout.dimensions[CSS_HEIGHT] = 595; } test("Random #0", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 603; @@ -3104,7 +3238,7 @@ int main() node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 6; @@ -3117,11 +3251,11 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -3134,10 +3268,9 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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_HEIGHT] = 338; node_0->style.margin[CSS_LEFT] = -5; node_0->style.margin[CSS_TOP] = -5; @@ -3152,7 +3285,7 @@ int main() node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 18; @@ -3165,10 +3298,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; - node_0->style.justify_content = CSS_JUSTIFY_FLEX_START; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; node_0->style.dimensions[CSS_WIDTH] = 255; node_0->style.margin[CSS_RIGHT] = -6; node_0->style.margin[CSS_BOTTOM] = -3; @@ -3186,7 +3319,7 @@ int main() node_0->style.border[CSS_BOTTOM] = 1; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -3199,7 +3332,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_HEIGHT] = 116; @@ -3207,9 +3340,9 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); + node_1->style.justify_content = CSS_JUSTIFY_CENTER; node_1->style.align_self = CSS_ALIGN_FLEX_START; - node_1->style.flex = CSS_FLEX_NONE; node_1->style.dimensions[CSS_HEIGHT] = 633; node_1->style.margin[CSS_LEFT] = 19; node_1->style.margin[CSS_TOP] = 19; @@ -3224,11 +3357,10 @@ int main() node_1->style.position[CSS_TOP] = 8; node_1->measure = measure; node_1->context = "small"; - node_1 = &node_0->children[1]; - node_1->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; - node_1->style.justify_content = CSS_JUSTIFY_SPACE_BETWEEN; - node_1->style.align_items = CSS_ALIGN_CENTER; - node_1->style.align_self = CSS_ALIGN_FLEX_END; + node_1 = node_0->get_child(node_0->context, 1); + node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW; + node_1->style.justify_content = CSS_JUSTIFY_FLEX_END; + node_1->style.align_items = CSS_ALIGN_FLEX_END; node_1->style.position_type = CSS_POSITION_ABSOLUTE; node_1->style.margin[CSS_LEFT] = 4; node_1->style.margin[CSS_TOP] = 13; @@ -3246,7 +3378,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 10; @@ -3256,12 +3388,12 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = 25; node_1->layout.position[CSS_LEFT] = -7; node_1->layout.dimensions[CSS_WIDTH] = 35; node_1->layout.dimensions[CSS_HEIGHT] = 633; - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->layout.position[CSS_TOP] = 3; node_1->layout.position[CSS_LEFT] = -3; node_1->layout.dimensions[CSS_WIDTH] = 7; @@ -3273,9 +3405,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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_SPACE_AROUND; node_0->style.dimensions[CSS_WIDTH] = 426; node_0->style.dimensions[CSS_HEIGHT] = 497; @@ -3289,7 +3422,7 @@ int main() node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -3302,11 +3435,11 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -3319,91 +3452,97 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { + css_node_t *node_0 = root_node; + node_0->style.justify_content = CSS_JUSTIFY_SPACE_AROUND; + node_0->style.align_items = CSS_ALIGN_STRETCH; + node_0->style.dimensions[CSS_HEIGHT] = 757; + node_0->style.margin[CSS_LEFT] = 8; + node_0->style.margin[CSS_TOP] = 6; + node_0->style.margin[CSS_RIGHT] = -1; + node_0->style.margin[CSS_BOTTOM] = 15; + node_0->style.border[CSS_LEFT] = 2; + node_0->style.border[CSS_TOP] = 1; + node_0->style.border[CSS_BOTTOM] = 0; + node_0->style.position[CSS_LEFT] = 5; + node_0->style.position[CSS_TOP] = -2; + 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_SPACE_BETWEEN; + node_1->style.align_items = CSS_ALIGN_CENTER; + node_1->style.margin[CSS_LEFT] = 16; + node_1->style.margin[CSS_TOP] = 16; + node_1->style.margin[CSS_RIGHT] = 16; + node_1->style.margin[CSS_BOTTOM] = 16; + node_1->style.margin[CSS_LEFT] = 11; + node_1->style.margin[CSS_TOP] = -2; + node_1->style.padding[CSS_LEFT] = 3; + node_1->style.padding[CSS_TOP] = 3; + node_1->style.padding[CSS_RIGHT] = 3; + node_1->style.padding[CSS_BOTTOM] = 3; + node_1->style.padding[CSS_TOP] = 18; + node_1->style.border[CSS_TOP] = 1; + node_1->style.border[CSS_BOTTOM] = 3; + node_1->style.position[CSS_LEFT] = -7; + 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; + node_2->style.align_self = CSS_ALIGN_STRETCH; + node_2->style.dimensions[CSS_HEIGHT] = 626; + node_2->style.margin[CSS_LEFT] = 18; + node_2->style.margin[CSS_TOP] = 18; + node_2->style.margin[CSS_RIGHT] = 18; + node_2->style.margin[CSS_BOTTOM] = 18; + node_2->style.margin[CSS_BOTTOM] = 0; + node_2->style.padding[CSS_RIGHT] = 2; + node_2->style.border[CSS_RIGHT] = 3; + node_2->measure = measure; + node_2->context = "small"; + } + } } - css_node_t *root_layout = new_css_node(); + 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; + node_0->layout.position[CSS_TOP] = 4; + node_0->layout.position[CSS_LEFT] = 13; + node_0->layout.dimensions[CSS_WIDTH] = 109; + node_0->layout.dimensions[CSS_HEIGHT] = 757; + 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] = 35.5; + node_1->layout.position[CSS_LEFT] = 6; + node_1->layout.dimensions[CSS_WIDTH] = 80; + node_1->layout.dimensions[CSS_HEIGHT] = 669; + 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] = 37; + node_2->layout.position[CSS_LEFT] = 21; + node_2->layout.dimensions[CSS_WIDTH] = 38; + node_2->layout.dimensions[CSS_HEIGHT] = 626; + } + } } test("Random #8", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); - { - css_node_t *node_0 = root_node; - node_0->style.justify_content = CSS_JUSTIFY_CENTER; - node_0->style.dimensions[CSS_WIDTH] = 477; - node_0->style.dimensions[CSS_HEIGHT] = 300; - node_0->style.margin[CSS_LEFT] = 9; - node_0->style.padding[CSS_LEFT] = 0; - node_0->style.padding[CSS_TOP] = 0; - node_0->style.padding[CSS_RIGHT] = 0; - node_0->style.padding[CSS_BOTTOM] = 0; - node_0->style.padding[CSS_LEFT] = 0; - node_0->style.padding[CSS_TOP] = 15; - node_0->style.padding[CSS_RIGHT] = 17; - node_0->style.padding[CSS_BOTTOM] = 16; - node_0->style.position[CSS_TOP] = 0; - node_0->measure = measure; - node_0->context = "loooooooooong with space"; - } - - css_node_t *root_layout = new_css_node(); - { - css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = 0; - node_0->layout.position[CSS_LEFT] = 9; - node_0->layout.dimensions[CSS_WIDTH] = 477; - node_0->layout.dimensions[CSS_HEIGHT] = 300; - } - - test("Random #9", root_node, root_layout); - } - - { - css_node_t *root_node = new_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_FLEX_START; - node_0->style.align_items = CSS_ALIGN_FLEX_END; - node_0->style.dimensions[CSS_HEIGHT] = 601; - node_0->style.margin[CSS_LEFT] = 17; - node_0->style.margin[CSS_TOP] = 17; - node_0->style.margin[CSS_RIGHT] = 17; - node_0->style.margin[CSS_BOTTOM] = 17; - node_0->style.border[CSS_LEFT] = 0; - node_0->style.border[CSS_BOTTOM] = 2; - node_0->style.position[CSS_LEFT] = 9; - node_0->style.position[CSS_TOP] = -6; - } - - css_node_t *root_layout = new_css_node(); - { - css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = 11; - node_0->layout.position[CSS_LEFT] = 26; - node_0->layout.dimensions[CSS_WIDTH] = 0; - node_0->layout.dimensions[CSS_HEIGHT] = 601; - } - - test("Random #10", root_node, root_layout); - } - - { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -3412,15 +3551,91 @@ int main() node_0->layout.dimensions[CSS_HEIGHT] = 0; } + test("Random #9", root_node, root_layout); + } + + { + css_node_t *root_node = new_test_css_node(); + { + } + + 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; + } + + test("Random #10", 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.align_items = CSS_ALIGN_FLEX_END; + node_0->style.dimensions[CSS_WIDTH] = 179; + node_0->style.margin[CSS_TOP] = 7; + node_0->style.padding[CSS_LEFT] = 5; + node_0->style.padding[CSS_TOP] = 17; + node_0->style.padding[CSS_BOTTOM] = 16; + node_0->style.border[CSS_TOP] = 0; + node_0->style.border[CSS_BOTTOM] = 1; + node_0->style.position[CSS_LEFT] = -4; + 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.align_self = CSS_ALIGN_CENTER; + node_1->style.dimensions[CSS_WIDTH] = 277; + node_1->style.margin[CSS_RIGHT] = 6; + node_1->style.margin[CSS_BOTTOM] = -10; + node_1->style.padding[CSS_LEFT] = 4; + node_1->style.padding[CSS_TOP] = 4; + node_1->style.padding[CSS_RIGHT] = 4; + node_1->style.padding[CSS_BOTTOM] = 4; + node_1->style.padding[CSS_LEFT] = 11; + 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_TOP] = 1; + node_1->style.position[CSS_TOP] = 1; + node_1->measure = measure; + node_1->context = "small"; + } + } + + css_node_t *root_layout = new_test_css_node(); + { + css_node_t *node_0 = root_layout; + node_0->layout.position[CSS_TOP] = 7; + node_0->layout.position[CSS_LEFT] = -4; + node_0->layout.dimensions[CSS_WIDTH] = 179; + node_0->layout.dimensions[CSS_HEIGHT] = 52; + 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] = 18; + node_1->layout.position[CSS_LEFT] = -49.5; + node_1->layout.dimensions[CSS_WIDTH] = 277; + node_1->layout.dimensions[CSS_HEIGHT] = 28; + } + } + test("Random #11", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + 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.justify_content = CSS_JUSTIFY_SPACE_BETWEEN; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW; node_0->style.dimensions[CSS_HEIGHT] = 948; node_0->style.margin[CSS_LEFT] = 10; node_0->style.margin[CSS_TOP] = 10; @@ -3438,7 +3653,7 @@ int main() node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 6; @@ -3451,7 +3666,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; @@ -3468,7 +3683,7 @@ int main() node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 12; @@ -3481,27 +3696,60 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.flex_direction = CSS_FLEX_DIRECTION_ROW; + 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 = 0; + node_2->measure = measure; + node_2->context = "loooooooooong with space"; + } + } } - css_node_t *root_layout = new_css_node(); + 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; + node_0->layout.dimensions[CSS_WIDTH] = 171; + node_0->layout.dimensions[CSS_HEIGHT] = 36; + 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] = 171; + node_1->layout.dimensions[CSS_HEIGHT] = 36; + 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] = 36; + } + } } test("Random #14", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; - node_0->style.justify_content = CSS_JUSTIFY_FLEX_START; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; node_0->style.dimensions[CSS_WIDTH] = 809; node_0->style.margin[CSS_LEFT] = 6; node_0->style.margin[CSS_TOP] = 8; @@ -3511,7 +3759,7 @@ int main() node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 8; @@ -3524,189 +3772,61 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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_SPACE_AROUND; - node_0->style.dimensions[CSS_WIDTH] = 779; - node_0->style.dimensions[CSS_HEIGHT] = 982; - node_0->style.margin[CSS_LEFT] = -3; - node_0->style.margin[CSS_TOP] = -3; - node_0->style.margin[CSS_RIGHT] = -3; - node_0->style.margin[CSS_BOTTOM] = -3; - node_0->style.margin[CSS_LEFT] = -5; - node_0->style.margin[CSS_RIGHT] = 6; - node_0->style.padding[CSS_LEFT] = 18; - node_0->style.padding[CSS_TOP] = 18; - node_0->style.padding[CSS_RIGHT] = 18; - node_0->style.padding[CSS_BOTTOM] = 18; - node_0->style.padding[CSS_LEFT] = 1; - node_0->style.padding[CSS_RIGHT] = 14; - node_0->style.border[CSS_LEFT] = 2; - node_0->style.position[CSS_LEFT] = 3; - node_0->style.position[CSS_TOP] = 5; - node_0->measure = measure; - node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = 2; - node_0->layout.position[CSS_LEFT] = -2; - node_0->layout.dimensions[CSS_WIDTH] = 779; - node_0->layout.dimensions[CSS_HEIGHT] = 982; + 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; } test("Random #16", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + 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.margin[CSS_RIGHT] = -2; - node_0->style.margin[CSS_BOTTOM] = 16; - node_0->style.padding[CSS_BOTTOM] = 14; - node_0->style.position[CSS_TOP] = 6; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = 6; + 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] = 14; + node_0->layout.dimensions[CSS_HEIGHT] = 0; } test("Random #17", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + 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.justify_content = CSS_JUSTIFY_SPACE_BETWEEN; - node_0->style.dimensions[CSS_WIDTH] = 666; - node_0->style.dimensions[CSS_HEIGHT] = 562; - node_0->style.margin[CSS_LEFT] = -2; - node_0->style.margin[CSS_TOP] = -2; - node_0->style.margin[CSS_RIGHT] = -2; - node_0->style.margin[CSS_BOTTOM] = -2; - node_0->style.margin[CSS_LEFT] = 12; - node_0->style.margin[CSS_TOP] = -3; - node_0->style.margin[CSS_RIGHT] = 13; - node_0->style.padding[CSS_LEFT] = 9; - node_0->style.padding[CSS_TOP] = 9; - node_0->style.padding[CSS_RIGHT] = 9; - node_0->style.padding[CSS_BOTTOM] = 9; - node_0->style.padding[CSS_LEFT] = 15; - node_0->style.padding[CSS_TOP] = 3; - 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_BOTTOM] = 3; - init_css_node_children(node_0, 2); - { - css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW; - node_1->style.flex = CSS_FLEX_ONE; - node_1->style.dimensions[CSS_WIDTH] = 287; - node_1->style.dimensions[CSS_HEIGHT] = 860; - node_1->style.margin[CSS_BOTTOM] = 9; - node_1->style.border[CSS_LEFT] = 3; - node_1->style.border[CSS_TOP] = 3; - node_1->style.border[CSS_RIGHT] = 3; - node_1->style.border[CSS_BOTTOM] = 3; - node_1->style.position[CSS_LEFT] = -3; - node_1->style.position[CSS_TOP] = 0; - node_1->measure = measure; - node_1->context = "loooooooooong with space"; - node_1 = &node_0->children[1]; - node_1->style.position_type = CSS_POSITION_ABSOLUTE; - node_1->style.margin[CSS_LEFT] = -7; - node_1->style.margin[CSS_TOP] = 11; - node_1->style.margin[CSS_RIGHT] = 3; - node_1->style.padding[CSS_LEFT] = 15; - node_1->style.padding[CSS_TOP] = 15; - node_1->style.padding[CSS_RIGHT] = 15; - node_1->style.padding[CSS_BOTTOM] = 15; - node_1->style.padding[CSS_TOP] = 11; - node_1->style.position[CSS_LEFT] = -10; - node_1->style.position[CSS_TOP] = 8; - init_css_node_children(node_1, 1); - { - css_node_t *node_2; - node_2 = &node_1->children[0]; - node_2->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; - node_2->style.flex = CSS_FLEX_NONE; - node_2->style.dimensions[CSS_HEIGHT] = 689; - node_2->style.margin[CSS_LEFT] = 4; - node_2->style.margin[CSS_TOP] = 4; - node_2->style.margin[CSS_RIGHT] = 4; - node_2->style.margin[CSS_BOTTOM] = 4; - node_2->style.margin[CSS_TOP] = 9; - node_2->style.margin[CSS_RIGHT] = 11; - node_2->style.padding[CSS_LEFT] = 6; - node_2->style.padding[CSS_TOP] = 6; - node_2->style.padding[CSS_RIGHT] = 6; - node_2->style.padding[CSS_BOTTOM] = 6; - node_2->style.padding[CSS_RIGHT] = 5; - node_2->style.padding[CSS_BOTTOM] = 0; - node_2->style.border[CSS_LEFT] = 0; - node_2->style.position[CSS_LEFT] = 0; - node_2->measure = measure; - node_2->context = "small"; - } - } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = -3; - node_0->layout.position[CSS_LEFT] = 12; - node_0->layout.dimensions[CSS_WIDTH] = 666; - node_0->layout.dimensions[CSS_HEIGHT] = 562; - init_css_node_children(node_0, 2); - { - css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->layout.position[CSS_TOP] = 4; - node_1->layout.position[CSS_LEFT] = 13; - node_1->layout.dimensions[CSS_WIDTH] = 287; - node_1->layout.dimensions[CSS_HEIGHT] = 537; - node_1 = &node_0->children[1]; - node_1->layout.position[CSS_TOP] = 20; - node_1->layout.position[CSS_LEFT] = -16; - node_1->layout.dimensions[CSS_WIDTH] = 89; - node_1->layout.dimensions[CSS_HEIGHT] = 728; - init_css_node_children(node_1, 1); - { - css_node_t *node_2; - node_2 = &node_1->children[0]; - node_2->layout.position[CSS_TOP] = 20; - node_2->layout.position[CSS_LEFT] = 19; - node_2->layout.dimensions[CSS_WIDTH] = 44; - node_2->layout.dimensions[CSS_HEIGHT] = 689; - } - } + 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; } test("Random #18", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; - node_0->style.align_items = CSS_ALIGN_FLEX_START; + node_0->style.justify_content = CSS_JUSTIFY_FLEX_START; node_0->style.margin[CSS_LEFT] = 6; node_0->style.margin[CSS_TOP] = 6; node_0->style.margin[CSS_RIGHT] = 6; @@ -3717,7 +3837,7 @@ int main() node_0->style.position[CSS_LEFT] = 8; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 6; @@ -3730,11 +3850,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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_FLEX_END; node_0->style.dimensions[CSS_WIDTH] = 161; node_0->style.dimensions[CSS_HEIGHT] = 261; node_0->style.margin[CSS_LEFT] = 3; @@ -3749,9 +3868,9 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW; - node_1->style.justify_content = CSS_JUSTIFY_FLEX_END; + node_1 = node_0->get_child(node_0->context, 0); + node_1->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; + node_1->style.flex = 1; node_1->style.dimensions[CSS_WIDTH] = 860; node_1->style.dimensions[CSS_HEIGHT] = 424; node_1->style.margin[CSS_LEFT] = 10; @@ -3775,7 +3894,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -3785,10 +3904,10 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = 10; - node_1->layout.position[CSS_LEFT] = -688; - node_1->layout.dimensions[CSS_WIDTH] = 860; + node_1->layout.position[CSS_LEFT] = 17; + node_1->layout.dimensions[CSS_WIDTH] = 155; node_1->layout.dimensions[CSS_HEIGHT] = 424; } } @@ -3797,10 +3916,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; - node_0->style.justify_content = CSS_JUSTIFY_SPACE_AROUND; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW; node_0->style.dimensions[CSS_WIDTH] = 596; node_0->style.margin[CSS_TOP] = 12; node_0->style.margin[CSS_RIGHT] = 6; @@ -3818,7 +3937,7 @@ int main() node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 12; @@ -3831,11 +3950,11 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -3848,11 +3967,11 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -3865,11 +3984,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.justify_content = CSS_JUSTIFY_FLEX_END; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW; node_0->style.dimensions[CSS_HEIGHT] = 605; node_0->style.margin[CSS_BOTTOM] = 10; node_0->style.padding[CSS_LEFT] = 6; @@ -3883,7 +4001,7 @@ int main() node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 7; @@ -3896,10 +4014,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.justify_content = CSS_JUSTIFY_SPACE_AROUND; node_0->style.dimensions[CSS_HEIGHT] = 846; node_0->style.margin[CSS_LEFT] = 19; node_0->style.margin[CSS_TOP] = 19; @@ -3910,7 +4028,7 @@ int main() node_0->style.padding[CSS_TOP] = 6; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 19; @@ -3923,10 +4041,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW; node_0->style.dimensions[CSS_WIDTH] = 726; node_0->style.margin[CSS_LEFT] = 16; node_0->style.margin[CSS_TOP] = 16; @@ -3942,7 +4060,7 @@ int main() node_0->style.position[CSS_LEFT] = -1; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 15; @@ -3955,11 +4073,11 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -3972,11 +4090,41 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); + { + css_node_t *node_0 = root_node; + node_0->style.justify_content = CSS_JUSTIFY_FLEX_START; + node_0->style.align_items = CSS_ALIGN_STRETCH; + node_0->style.margin[CSS_LEFT] = 1; + node_0->style.margin[CSS_RIGHT] = -2; + node_0->style.padding[CSS_LEFT] = 4; + node_0->style.padding[CSS_TOP] = 4; + node_0->style.padding[CSS_RIGHT] = 4; + node_0->style.padding[CSS_BOTTOM] = 4; + node_0->style.padding[CSS_LEFT] = 19; + node_0->style.border[CSS_LEFT] = 1; + node_0->style.border[CSS_TOP] = 1; + node_0->style.position[CSS_TOP] = -3; + } + + css_node_t *root_layout = new_test_css_node(); + { + css_node_t *node_0 = root_layout; + node_0->layout.position[CSS_TOP] = -3; + node_0->layout.position[CSS_LEFT] = 1; + node_0->layout.dimensions[CSS_WIDTH] = 24; + node_0->layout.dimensions[CSS_HEIGHT] = 9; + } + + test("Random #28", root_node, root_layout); + } + + { + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -3985,47 +4133,15 @@ int main() node_0->layout.dimensions[CSS_HEIGHT] = 0; } - test("Random #28", root_node, root_layout); - } - - { - css_node_t *root_node = new_css_node(); - { - css_node_t *node_0 = root_node; - node_0->style.dimensions[CSS_WIDTH] = 75; - node_0->style.margin[CSS_LEFT] = 19; - node_0->style.margin[CSS_TOP] = 19; - node_0->style.margin[CSS_RIGHT] = 19; - node_0->style.margin[CSS_BOTTOM] = 19; - node_0->style.margin[CSS_LEFT] = 17; - node_0->style.margin[CSS_TOP] = -5; - node_0->style.margin[CSS_RIGHT] = 10; - node_0->style.margin[CSS_BOTTOM] = 1; - node_0->style.padding[CSS_BOTTOM] = 12; - node_0->style.border[CSS_LEFT] = 2; - node_0->style.position[CSS_LEFT] = -6; - node_0->measure = measure; - node_0->context = "small"; - } - - css_node_t *root_layout = new_css_node(); - { - css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = -5; - node_0->layout.position[CSS_LEFT] = 11; - node_0->layout.dimensions[CSS_WIDTH] = 75; - node_0->layout.dimensions[CSS_HEIGHT] = 30; - } - test("Random #29", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -4038,11 +4154,11 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -4055,11 +4171,11 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -4072,10 +4188,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; - node_0->style.justify_content = CSS_JUSTIFY_CENTER; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; node_0->style.dimensions[CSS_HEIGHT] = 315; node_0->style.margin[CSS_TOP] = -2; node_0->style.margin[CSS_RIGHT] = -4; @@ -4086,7 +4202,7 @@ int main() node_0->style.position[CSS_TOP] = -2; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = -4; @@ -4099,50 +4215,28 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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] = 337; - node_0->style.margin[CSS_LEFT] = 8; - node_0->style.margin[CSS_TOP] = 8; - node_0->style.margin[CSS_RIGHT] = 8; - node_0->style.margin[CSS_BOTTOM] = 8; - node_0->style.margin[CSS_TOP] = 12; - node_0->style.padding[CSS_LEFT] = 6; - node_0->style.padding[CSS_TOP] = 6; - node_0->style.padding[CSS_RIGHT] = 6; - node_0->style.padding[CSS_BOTTOM] = 6; - node_0->style.padding[CSS_TOP] = 18; - node_0->style.padding[CSS_RIGHT] = 5; - node_0->style.border[CSS_LEFT] = 0; - node_0->style.border[CSS_TOP] = 0; - node_0->style.border[CSS_RIGHT] = 0; - node_0->style.border[CSS_BOTTOM] = 0; - node_0->style.border[CSS_TOP] = 0; - node_0->style.position[CSS_LEFT] = 1; - node_0->measure = measure; - node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = 12; - node_0->layout.position[CSS_LEFT] = 9; - node_0->layout.dimensions[CSS_WIDTH] = 337; - node_0->layout.dimensions[CSS_HEIGHT] = 42; + 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; } test("Random #34", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + 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.align_items = CSS_ALIGN_FLEX_END; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; + node_0->style.justify_content = CSS_JUSTIFY_SPACE_BETWEEN; node_0->style.dimensions[CSS_HEIGHT] = 819; node_0->style.margin[CSS_LEFT] = 1; node_0->style.margin[CSS_TOP] = 1; @@ -4157,11 +4251,10 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW; - node_1->style.justify_content = CSS_JUSTIFY_SPACE_AROUND; - node_1->style.align_self = CSS_ALIGN_FLEX_END; - node_1->style.flex = CSS_FLEX_ONE; + node_1->style.align_self = CSS_ALIGN_STRETCH; + node_1->style.flex = 8; node_1->style.dimensions[CSS_WIDTH] = 532; node_1->style.margin[CSS_LEFT] = 8; node_1->style.margin[CSS_TOP] = 8; @@ -4181,7 +4274,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = -3; @@ -4191,7 +4284,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = 8; node_1->layout.position[CSS_LEFT] = 40; node_1->layout.dimensions[CSS_WIDTH] = 532; @@ -4203,45 +4296,72 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { + css_node_t *node_0 = root_node; + node_0->style.align_items = CSS_ALIGN_CENTER; + node_0->style.margin[CSS_LEFT] = 13; + node_0->style.margin[CSS_TOP] = 13; + node_0->style.margin[CSS_RIGHT] = 13; + node_0->style.margin[CSS_BOTTOM] = 13; + node_0->style.margin[CSS_BOTTOM] = 0; + node_0->style.border[CSS_TOP] = 1; + node_0->style.border[CSS_RIGHT] = 1; + node_0->style.position[CSS_TOP] = 8; } - css_node_t *root_layout = new_css_node(); + 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; + node_0->layout.position[CSS_TOP] = 21; + node_0->layout.position[CSS_LEFT] = 13; + node_0->layout.dimensions[CSS_WIDTH] = 1; + node_0->layout.dimensions[CSS_HEIGHT] = 1; } test("Random #36", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + 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_END; + node_0->style.dimensions[CSS_WIDTH] = 632; + node_0->style.dimensions[CSS_HEIGHT] = 907; + node_0->style.margin[CSS_LEFT] = -3; + node_0->style.margin[CSS_TOP] = 5; + node_0->style.margin[CSS_RIGHT] = -6; + node_0->style.margin[CSS_BOTTOM] = -5; + node_0->style.padding[CSS_LEFT] = 1; + node_0->style.padding[CSS_TOP] = 1; + node_0->style.padding[CSS_RIGHT] = 1; + node_0->style.padding[CSS_BOTTOM] = 1; + node_0->style.padding[CSS_BOTTOM] = 6; + node_0->style.border[CSS_BOTTOM] = 3; + node_0->style.position[CSS_LEFT] = -9; + node_0->style.position[CSS_TOP] = 4; } - css_node_t *root_layout = new_css_node(); + 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; + node_0->layout.position[CSS_TOP] = 9; + node_0->layout.position[CSS_LEFT] = -12; + node_0->layout.dimensions[CSS_WIDTH] = 632; + node_0->layout.dimensions[CSS_HEIGHT] = 907; } test("Random #37", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -4254,11 +4374,36 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); + { + css_node_t *node_0 = root_node; + node_0->style.dimensions[CSS_HEIGHT] = 635; + node_0->style.margin[CSS_LEFT] = 3; + node_0->style.margin[CSS_TOP] = 6; + node_0->style.border[CSS_BOTTOM] = 1; + node_0->style.position[CSS_LEFT] = -5; + node_0->measure = measure; + node_0->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] = 6; + node_0->layout.position[CSS_LEFT] = -2; + node_0->layout.dimensions[CSS_WIDTH] = 171; + node_0->layout.dimensions[CSS_HEIGHT] = 635; + } + + test("Random #39", root_node, root_layout); + } + + { + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -4267,76 +4412,31 @@ int main() node_0->layout.dimensions[CSS_HEIGHT] = 0; } - test("Random #39", root_node, root_layout); - } - - { - css_node_t *root_node = new_css_node(); - { - css_node_t *node_0 = root_node; - node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW; - node_0->style.dimensions[CSS_HEIGHT] = 257; - node_0->style.margin[CSS_LEFT] = 18; - node_0->style.margin[CSS_TOP] = 18; - node_0->style.margin[CSS_RIGHT] = 18; - node_0->style.margin[CSS_BOTTOM] = 18; - node_0->style.margin[CSS_LEFT] = 15; - node_0->style.margin[CSS_RIGHT] = 0; - node_0->style.margin[CSS_BOTTOM] = 6; - node_0->style.padding[CSS_LEFT] = 17; - node_0->style.padding[CSS_RIGHT] = 3; - node_0->style.padding[CSS_BOTTOM] = 5; - node_0->style.border[CSS_TOP] = 2; - node_0->style.border[CSS_RIGHT] = 3; - node_0->style.border[CSS_BOTTOM] = 0; - node_0->style.position[CSS_LEFT] = 2; - node_0->measure = measure; - node_0->context = "small"; - } - - css_node_t *root_layout = new_css_node(); - { - css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = 18; - node_0->layout.position[CSS_LEFT] = 17; - node_0->layout.dimensions[CSS_WIDTH] = 56; - node_0->layout.dimensions[CSS_HEIGHT] = 257; - } - test("Random #40", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + 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; - node_0->style.dimensions[CSS_HEIGHT] = 308; - node_0->style.margin[CSS_LEFT] = 9; - node_0->style.margin[CSS_TOP] = 6; - node_0->style.padding[CSS_LEFT] = 9; - node_0->style.border[CSS_RIGHT] = 0; - node_0->style.position[CSS_LEFT] = -5; - node_0->measure = measure; - node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = 6; - node_0->layout.position[CSS_LEFT] = 4; - node_0->layout.dimensions[CSS_WIDTH] = 42; - node_0->layout.dimensions[CSS_HEIGHT] = 308; + 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; } test("Random #41", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + 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.dimensions[CSS_WIDTH] = 398; node_0->style.dimensions[CSS_HEIGHT] = 198; node_0->style.margin[CSS_LEFT] = 9; @@ -4349,7 +4449,7 @@ int main() node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = -11; @@ -4362,12 +4462,11 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.align_items = CSS_ALIGN_STRETCH; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; + node_0->style.justify_content = CSS_JUSTIFY_SPACE_AROUND; node_0->style.dimensions[CSS_HEIGHT] = 514; node_0->style.margin[CSS_LEFT] = 16; node_0->style.margin[CSS_TOP] = 16; @@ -4383,7 +4482,7 @@ int main() node_0->style.position[CSS_LEFT] = 5; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 5; @@ -4396,69 +4495,27 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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_FLEX_END; - node_0->style.dimensions[CSS_WIDTH] = 387; - node_0->style.margin[CSS_LEFT] = 19; - node_0->style.margin[CSS_TOP] = 19; - node_0->style.margin[CSS_RIGHT] = 19; - node_0->style.margin[CSS_BOTTOM] = 19; - node_0->style.margin[CSS_LEFT] = 11; - node_0->style.padding[CSS_TOP] = 15; - node_0->style.padding[CSS_RIGHT] = 14; - node_0->style.border[CSS_LEFT] = 0; - node_0->style.border[CSS_RIGHT] = 1; - node_0->style.position[CSS_LEFT] = 8; - init_css_node_children(node_0, 1); - { - css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.justify_content = CSS_JUSTIFY_FLEX_START; - node_1->style.flex = CSS_FLEX_ONE; - node_1->style.margin[CSS_RIGHT] = -6; - node_1->style.padding[CSS_LEFT] = 5; - node_1->style.padding[CSS_TOP] = 5; - node_1->style.padding[CSS_RIGHT] = 5; - node_1->style.padding[CSS_BOTTOM] = 5; - node_1->style.padding[CSS_RIGHT] = 13; - node_1->style.border[CSS_LEFT] = 0; - node_1->style.border[CSS_TOP] = 3; - node_1->style.position[CSS_LEFT] = -1; - node_1->measure = measure; - node_1->context = "small"; - } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = 19; - node_0->layout.position[CSS_LEFT] = 19; - node_0->layout.dimensions[CSS_WIDTH] = 387; - node_0->layout.dimensions[CSS_HEIGHT] = 46; - init_css_node_children(node_0, 1); - { - css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->layout.position[CSS_TOP] = 15; - node_1->layout.position[CSS_LEFT] = -1; - node_1->layout.dimensions[CSS_WIDTH] = 378; - node_1->layout.dimensions[CSS_HEIGHT] = 31; - } + 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; } test("Random #44", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + 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_CENTER; + node_0->style.justify_content = CSS_JUSTIFY_CENTER; node_0->style.dimensions[CSS_WIDTH] = 952; node_0->style.margin[CSS_LEFT] = -2; node_0->style.margin[CSS_TOP] = -2; @@ -4471,7 +4528,7 @@ int main() node_0->style.position[CSS_TOP] = -10; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = -9; @@ -4484,10 +4541,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; - node_0->style.justify_content = CSS_JUSTIFY_SPACE_AROUND; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW; node_0->style.dimensions[CSS_WIDTH] = 937; node_0->style.border[CSS_LEFT] = 0; node_0->style.border[CSS_TOP] = 0; @@ -4499,7 +4556,7 @@ int main() node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -4512,11 +4569,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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_FLEX_END; node_0->style.dimensions[CSS_WIDTH] = 530; node_0->style.dimensions[CSS_HEIGHT] = 726; node_0->style.margin[CSS_LEFT] = -5; @@ -4530,8 +4586,8 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.justify_content = CSS_JUSTIFY_FLEX_END; + 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] = 195; node_1->style.margin[CSS_TOP] = -2; node_1->style.margin[CSS_RIGHT] = 15; @@ -4541,8 +4597,8 @@ int main() node_1->style.position[CSS_TOP] = -1; node_1->measure = measure; node_1->context = "small"; - node_1 = &node_0->children[1]; - node_1->style.align_self = CSS_ALIGN_STRETCH; + node_1 = node_0->get_child(node_0->context, 1); + node_1->style.justify_content = CSS_JUSTIFY_SPACE_BETWEEN; node_1->style.dimensions[CSS_WIDTH] = 638; node_1->style.dimensions[CSS_HEIGHT] = 753; node_1->style.margin[CSS_LEFT] = 19; @@ -4559,7 +4615,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = -5; @@ -4569,14 +4625,14 @@ int main() init_css_node_children(node_0, 2); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = 0; - node_1->layout.position[CSS_LEFT] = -347; + node_1->layout.position[CSS_LEFT] = 2; node_1->layout.dimensions[CSS_WIDTH] = 195; node_1->layout.dimensions[CSS_HEIGHT] = 20; - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->layout.position[CSS_TOP] = 6; - node_1->layout.position[CSS_LEFT] = -125; + node_1->layout.position[CSS_LEFT] = 224; node_1->layout.dimensions[CSS_WIDTH] = 638; node_1->layout.dimensions[CSS_HEIGHT] = 753; } @@ -4586,45 +4642,72 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { + css_node_t *node_0 = root_node; + node_0->style.dimensions[CSS_HEIGHT] = 712; + node_0->style.margin[CSS_LEFT] = 16; + node_0->style.margin[CSS_TOP] = 16; + node_0->style.margin[CSS_RIGHT] = 16; + node_0->style.margin[CSS_BOTTOM] = 16; + node_0->style.margin[CSS_RIGHT] = -2; + node_0->style.margin[CSS_BOTTOM] = 15; + node_0->style.padding[CSS_TOP] = 19; + node_0->style.position[CSS_TOP] = 1; + node_0->measure = measure; + node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + 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; + node_0->layout.position[CSS_TOP] = 17; + node_0->layout.position[CSS_LEFT] = 16; + node_0->layout.dimensions[CSS_WIDTH] = 171; + node_0->layout.dimensions[CSS_HEIGHT] = 712; } test("Random #48", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + 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.justify_content = CSS_JUSTIFY_FLEX_START; + node_0->style.align_items = CSS_ALIGN_STRETCH; + node_0->style.dimensions[CSS_HEIGHT] = 194; + node_0->style.margin[CSS_LEFT] = 1; + node_0->style.margin[CSS_TOP] = 1; + node_0->style.margin[CSS_RIGHT] = 1; + node_0->style.margin[CSS_BOTTOM] = 1; + node_0->style.margin[CSS_TOP] = -7; + node_0->style.margin[CSS_RIGHT] = -6; + node_0->style.padding[CSS_LEFT] = 18; + node_0->style.padding[CSS_TOP] = 18; + node_0->style.padding[CSS_RIGHT] = 18; + node_0->style.padding[CSS_BOTTOM] = 18; + node_0->style.border[CSS_BOTTOM] = 0; } - css_node_t *root_layout = new_css_node(); + 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; + node_0->layout.position[CSS_TOP] = -7; + node_0->layout.position[CSS_LEFT] = 1; + node_0->layout.dimensions[CSS_WIDTH] = 36; + node_0->layout.dimensions[CSS_HEIGHT] = 194; } test("Random #49", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + 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_FLEX_START; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; node_0->style.dimensions[CSS_HEIGHT] = 335; node_0->style.margin[CSS_LEFT] = -6; node_0->style.margin[CSS_TOP] = -9; @@ -4636,7 +4719,7 @@ int main() node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = -10; @@ -4649,10 +4732,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.flex_direction = CSS_FLEX_DIRECTION_ROW; node_0->style.dimensions[CSS_WIDTH] = 648; node_0->style.margin[CSS_LEFT] = -1; node_0->style.margin[CSS_TOP] = 15; @@ -4668,10 +4751,10 @@ int main() init_css_node_children(node_0, 3); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); + node_1->style.justify_content = CSS_JUSTIFY_SPACE_BETWEEN; node_1->style.align_items = CSS_ALIGN_FLEX_END; - node_1->style.align_self = CSS_ALIGN_FLEX_END; - node_1->style.flex = CSS_FLEX_NONE; + node_1->style.align_self = CSS_ALIGN_FLEX_START; node_1->style.position_type = CSS_POSITION_ABSOLUTE; node_1->style.dimensions[CSS_WIDTH] = 928; node_1->style.margin[CSS_LEFT] = 5; @@ -4686,11 +4769,11 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; - node_2->style.flex_direction = CSS_FLEX_DIRECTION_ROW; - node_2->style.justify_content = CSS_JUSTIFY_CENTER; - node_2->style.align_self = CSS_ALIGN_FLEX_START; + 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_FLEX_START; node_2->style.position_type = CSS_POSITION_RELATIVE; + node_2->style.flex = 9; node_2->style.dimensions[CSS_HEIGHT] = 898; node_2->style.margin[CSS_LEFT] = 11; node_2->style.margin[CSS_TOP] = 11; @@ -4706,10 +4789,9 @@ int main() init_css_node_children(node_2, 1); { css_node_t *node_3; - node_3 = &node_2->children[0]; + node_3 = node_2->get_child(node_2->context, 0); node_3->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; - node_3->style.justify_content = CSS_JUSTIFY_CENTER; - node_3->style.align_items = CSS_ALIGN_CENTER; + node_3->style.justify_content = CSS_JUSTIFY_FLEX_END; node_3->style.dimensions[CSS_HEIGHT] = 274; node_3->style.margin[CSS_LEFT] = 6; node_3->style.margin[CSS_TOP] = 6; @@ -4723,10 +4805,10 @@ int main() init_css_node_children(node_3, 2); { css_node_t *node_4; - node_4 = &node_3->children[0]; - node_4->style.justify_content = CSS_JUSTIFY_FLEX_END; + node_4 = node_3->get_child(node_3->context, 0); + node_4->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; + node_4->style.justify_content = CSS_JUSTIFY_SPACE_BETWEEN; node_4->style.align_items = CSS_ALIGN_STRETCH; - node_4->style.align_self = CSS_ALIGN_STRETCH; node_4->style.position_type = CSS_POSITION_ABSOLUTE; node_4->style.margin[CSS_LEFT] = 3; node_4->style.margin[CSS_TOP] = 3; @@ -4736,7 +4818,7 @@ int main() node_4->style.padding[CSS_RIGHT] = 8; node_4->style.border[CSS_BOTTOM] = 3; node_4->style.position[CSS_LEFT] = -8; - node_4 = &node_3->children[1]; + node_4 = node_3->get_child(node_3->context, 1); node_4->style.margin[CSS_LEFT] = 16; node_4->style.margin[CSS_TOP] = 16; node_4->style.margin[CSS_RIGHT] = 16; @@ -4750,8 +4832,9 @@ int main() } } } - node_1 = &node_0->children[1]; - node_1->style.flex = CSS_FLEX_NONE; + node_1 = node_0->get_child(node_0->context, 1); + node_1->style.justify_content = CSS_JUSTIFY_FLEX_END; + node_1->style.align_self = CSS_ALIGN_FLEX_START; node_1->style.dimensions[CSS_HEIGHT] = 49; node_1->style.margin[CSS_TOP] = 8; node_1->style.margin[CSS_BOTTOM] = 9; @@ -4761,10 +4844,9 @@ int main() node_1->style.position[CSS_TOP] = 4; node_1->measure = measure; node_1->context = "small"; - node_1 = &node_0->children[2]; - node_1->style.justify_content = CSS_JUSTIFY_FLEX_START; + node_1 = node_0->get_child(node_0->context, 2); + node_1->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; node_1->style.align_self = CSS_ALIGN_CENTER; - node_1->style.flex = CSS_FLEX_NONE; node_1->style.margin[CSS_RIGHT] = 18; node_1->style.margin[CSS_BOTTOM] = -1; node_1->style.padding[CSS_TOP] = 14; @@ -4776,17 +4858,17 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 22; node_0->layout.position[CSS_LEFT] = -1; node_0->layout.dimensions[CSS_WIDTH] = 648; - node_0->layout.dimensions[CSS_HEIGHT] = 136; + node_0->layout.dimensions[CSS_HEIGHT] = 91; init_css_node_children(node_0, 3); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = 2; node_1->layout.position[CSS_LEFT] = 8; node_1->layout.dimensions[CSS_WIDTH] = 928; @@ -4794,15 +4876,15 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; + node_2 = node_1->get_child(node_1->context, 0); node_2->layout.position[CSS_TOP] = 31; - node_2->layout.position[CSS_LEFT] = 16; + node_2->layout.position[CSS_LEFT] = 806; node_2->layout.dimensions[CSS_WIDTH] = 115; node_2->layout.dimensions[CSS_HEIGHT] = 898; init_css_node_children(node_2, 1); { css_node_t *node_3; - node_3 = &node_2->children[0]; + node_3 = node_2->get_child(node_2->context, 0); node_3->layout.position[CSS_TOP] = 1; node_3->layout.position[CSS_LEFT] = 6; node_3->layout.dimensions[CSS_WIDTH] = 103; @@ -4810,27 +4892,27 @@ int main() init_css_node_children(node_3, 2); { css_node_t *node_4; - node_4 = &node_3->children[0]; - node_4->layout.position[CSS_TOP] = 106.5; + node_4 = node_3->get_child(node_3->context, 0); + node_4->layout.position[CSS_TOP] = 210; node_4->layout.position[CSS_LEFT] = -3; node_4->layout.dimensions[CSS_WIDTH] = 8; node_4->layout.dimensions[CSS_HEIGHT] = 3; - node_4 = &node_3->children[1]; - node_4->layout.position[CSS_TOP] = 104.5; + node_4 = node_3->get_child(node_3->context, 1); + node_4->layout.position[CSS_TOP] = 208; node_4->layout.position[CSS_LEFT] = 34; node_4->layout.dimensions[CSS_WIDTH] = 53; node_4->layout.dimensions[CSS_HEIGHT] = 37; } } } - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->layout.position[CSS_TOP] = 33; node_1->layout.position[CSS_LEFT] = 23; node_1->layout.dimensions[CSS_WIDTH] = 47; node_1->layout.dimensions[CSS_HEIGHT] = 49; - node_1 = &node_0->children[2]; - node_1->layout.position[CSS_TOP] = 87; - node_1->layout.position[CSS_LEFT] = 307; + node_1 = node_0->get_child(node_0->context, 2); + node_1->layout.position[CSS_TOP] = 31.5; + node_1->layout.position[CSS_LEFT] = 66; node_1->layout.dimensions[CSS_WIDTH] = 33; node_1->layout.dimensions[CSS_HEIGHT] = 46; } @@ -4840,7 +4922,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 803; @@ -4856,7 +4938,7 @@ int main() node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -4869,9 +4951,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.dimensions[CSS_HEIGHT] = 861; node_0->style.margin[CSS_LEFT] = 0; node_0->style.margin[CSS_TOP] = 0; @@ -4885,7 +4968,7 @@ int main() node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -4898,32 +4981,24 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { - css_node_t *node_0 = root_node; - node_0->style.margin[CSS_RIGHT] = -7; - node_0->style.margin[CSS_BOTTOM] = -5; - node_0->style.padding[CSS_TOP] = 0; - node_0->style.padding[CSS_BOTTOM] = 11; - node_0->style.border[CSS_RIGHT] = 3; - node_0->measure = measure; - node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + 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] = 174; - node_0->layout.dimensions[CSS_HEIGHT] = 29; + node_0->layout.dimensions[CSS_WIDTH] = 0; + node_0->layout.dimensions[CSS_HEIGHT] = 0; } test("Random #54", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 134; @@ -4944,7 +5019,7 @@ int main() node_0->style.position[CSS_TOP] = -2; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 7; @@ -4957,10 +5032,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; - node_0->style.justify_content = CSS_JUSTIFY_FLEX_START; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; node_0->style.dimensions[CSS_WIDTH] = 216; node_0->style.dimensions[CSS_HEIGHT] = 721; node_0->style.margin[CSS_LEFT] = -6; @@ -4980,7 +5055,7 @@ int main() node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = -1; @@ -4993,41 +5068,27 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { - css_node_t *node_0 = root_node; - node_0->style.justify_content = CSS_JUSTIFY_SPACE_AROUND; - node_0->style.dimensions[CSS_WIDTH] = 526; - node_0->style.margin[CSS_RIGHT] = 11; - node_0->style.margin[CSS_BOTTOM] = 5; - node_0->style.padding[CSS_LEFT] = 13; - node_0->style.border[CSS_LEFT] = 2; - node_0->style.border[CSS_TOP] = 2; - node_0->style.border[CSS_RIGHT] = 2; - node_0->style.border[CSS_BOTTOM] = 2; - node_0->style.border[CSS_TOP] = 1; - node_0->style.border[CSS_RIGHT] = 1; - node_0->measure = measure; - node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + 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] = 526; - node_0->layout.dimensions[CSS_HEIGHT] = 21; + node_0->layout.dimensions[CSS_WIDTH] = 0; + node_0->layout.dimensions[CSS_HEIGHT] = 0; } test("Random #57", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + 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.align_items = CSS_ALIGN_FLEX_START; node_0->style.dimensions[CSS_WIDTH] = 173; node_0->style.margin[CSS_LEFT] = 11; node_0->style.margin[CSS_TOP] = 11; @@ -5041,7 +5102,7 @@ int main() node_0->style.position[CSS_LEFT] = 8; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 17; @@ -5054,43 +5115,11 @@ int main() } { - css_node_t *root_node = new_css_node(); - { - css_node_t *node_0 = root_node; - node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; - node_0->style.margin[CSS_LEFT] = -5; - node_0->style.margin[CSS_TOP] = -5; - node_0->style.margin[CSS_RIGHT] = -5; - node_0->style.margin[CSS_BOTTOM] = -5; - node_0->style.margin[CSS_RIGHT] = -8; - node_0->style.padding[CSS_TOP] = 4; - node_0->style.padding[CSS_BOTTOM] = 15; - node_0->style.border[CSS_TOP] = 3; - node_0->style.border[CSS_BOTTOM] = 3; - node_0->style.position[CSS_LEFT] = -5; - node_0->style.position[CSS_TOP] = 2; - node_0->measure = measure; - node_0->context = "small"; - } - - css_node_t *root_layout = new_css_node(); - { - css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = -3; - node_0->layout.position[CSS_LEFT] = -10; - node_0->layout.dimensions[CSS_WIDTH] = 33; - node_0->layout.dimensions[CSS_HEIGHT] = 43; - } - - test("Random #59", root_node, root_layout); - } - - { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -5099,15 +5128,131 @@ int main() node_0->layout.dimensions[CSS_HEIGHT] = 0; } + test("Random #59", 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_CENTER; + node_0->style.dimensions[CSS_WIDTH] = 632; + node_0->style.dimensions[CSS_HEIGHT] = 810; + node_0->style.margin[CSS_LEFT] = 1; + node_0->style.margin[CSS_TOP] = 1; + node_0->style.margin[CSS_RIGHT] = 1; + node_0->style.margin[CSS_BOTTOM] = 1; + node_0->style.margin[CSS_LEFT] = -9; + node_0->style.margin[CSS_TOP] = 10; + node_0->style.padding[CSS_BOTTOM] = 1; + node_0->style.border[CSS_RIGHT] = 3; + node_0->style.position[CSS_LEFT] = -4; + 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_COLUMN; + node_1->style.margin[CSS_TOP] = 15; + node_1->style.padding[CSS_TOP] = 0; + node_1->style.padding[CSS_BOTTOM] = 12; + 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_TOP] = 2; + node_1->style.position[CSS_LEFT] = -5; + 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.justify_content = CSS_JUSTIFY_CENTER; + node_2->style.align_self = CSS_ALIGN_CENTER; + node_2->style.position_type = CSS_POSITION_ABSOLUTE; + node_2->style.dimensions[CSS_HEIGHT] = 674; + node_2->style.margin[CSS_RIGHT] = 11; + node_2->style.padding[CSS_LEFT] = 4; + node_2->style.padding[CSS_RIGHT] = 10; + node_2->style.border[CSS_LEFT] = 2; + node_2->style.border[CSS_TOP] = 1; + node_2->style.border[CSS_BOTTOM] = 1; + node_2->style.position[CSS_LEFT] = 6; + node_2 = node_1->get_child(node_1->context, 1); + node_2->style.flex_direction = CSS_FLEX_DIRECTION_ROW; + node_2->style.justify_content = CSS_JUSTIFY_FLEX_START; + node_2->style.dimensions[CSS_WIDTH] = 811; + node_2->style.margin[CSS_TOP] = -5; + node_2->style.padding[CSS_LEFT] = 16; + node_2->style.padding[CSS_TOP] = 16; + node_2->style.padding[CSS_RIGHT] = 16; + node_2->style.padding[CSS_BOTTOM] = 16; + node_2->style.border[CSS_LEFT] = 0; + node_2->measure = measure; + node_2->context = "small"; + } + node_1 = node_0->get_child(node_0->context, 1); + node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW; + node_1->style.justify_content = CSS_JUSTIFY_CENTER; + node_1->style.dimensions[CSS_HEIGHT] = 51; + node_1->style.margin[CSS_TOP] = -4; + node_1->style.margin[CSS_RIGHT] = 14; + node_1->style.padding[CSS_LEFT] = 3; + node_1->style.padding[CSS_TOP] = 3; + node_1->style.padding[CSS_RIGHT] = 3; + node_1->style.padding[CSS_BOTTOM] = 3; + node_1->style.padding[CSS_LEFT] = 11; + node_1->style.padding[CSS_BOTTOM] = 18; + node_1->style.position[CSS_LEFT] = -9; + node_1->measure = measure; + node_1->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] = 10; + node_0->layout.position[CSS_LEFT] = -13; + node_0->layout.dimensions[CSS_WIDTH] = 632; + node_0->layout.dimensions[CSS_HEIGHT] = 810; + 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] = 15; + node_1->layout.position[CSS_LEFT] = -97; + node_1->layout.dimensions[CSS_WIDTH] = 813; + node_1->layout.dimensions[CSS_HEIGHT] = 60; + 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] = 2; + node_2->layout.position[CSS_LEFT] = 7; + node_2->layout.dimensions[CSS_WIDTH] = 16; + node_2->layout.dimensions[CSS_HEIGHT] = 674; + node_2 = node_1->get_child(node_1->context, 1); + node_2->layout.position[CSS_TOP] = -3; + node_2->layout.position[CSS_LEFT] = 1; + node_2->layout.dimensions[CSS_WIDTH] = 811; + node_2->layout.dimensions[CSS_HEIGHT] = 50; + } + node_1 = node_0->get_child(node_0->context, 1); + node_1->layout.position[CSS_TOP] = 71; + node_1->layout.position[CSS_LEFT] = 206; + node_1->layout.dimensions[CSS_WIDTH] = 185; + node_1->layout.dimensions[CSS_HEIGHT] = 51; + } + } + test("Random #60", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -5120,7 +5265,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 671; @@ -5135,7 +5280,7 @@ int main() node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -5148,11 +5293,11 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -5165,43 +5310,28 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { - css_node_t *node_0 = root_node; - node_0->style.dimensions[CSS_HEIGHT] = 898; - node_0->style.margin[CSS_LEFT] = 14; - node_0->style.margin[CSS_TOP] = 14; - node_0->style.margin[CSS_RIGHT] = 14; - node_0->style.margin[CSS_BOTTOM] = 14; - node_0->style.margin[CSS_TOP] = 13; - node_0->style.padding[CSS_LEFT] = 12; - node_0->style.padding[CSS_TOP] = 12; - node_0->style.padding[CSS_RIGHT] = 12; - node_0->style.padding[CSS_BOTTOM] = 12; - node_0->style.padding[CSS_BOTTOM] = 7; - node_0->style.position[CSS_LEFT] = -3; - node_0->measure = measure; - node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = 13; - node_0->layout.position[CSS_LEFT] = 11; - node_0->layout.dimensions[CSS_WIDTH] = 57; - node_0->layout.dimensions[CSS_HEIGHT] = 898; + 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; } test("Random #64", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -5214,11 +5344,11 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -5231,27 +5361,49 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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; + node_0->style.dimensions[CSS_WIDTH] = 516; + node_0->style.dimensions[CSS_HEIGHT] = 712; + node_0->style.margin[CSS_LEFT] = 15; + node_0->style.margin[CSS_TOP] = 15; + node_0->style.margin[CSS_RIGHT] = 15; + node_0->style.margin[CSS_BOTTOM] = 15; + node_0->style.margin[CSS_LEFT] = -8; + node_0->style.margin[CSS_RIGHT] = 11; + node_0->style.padding[CSS_LEFT] = 17; + node_0->style.padding[CSS_TOP] = 17; + node_0->style.padding[CSS_RIGHT] = 17; + node_0->style.padding[CSS_BOTTOM] = 17; + node_0->style.padding[CSS_TOP] = 4; + 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.position[CSS_TOP] = 4; + node_0->measure = measure; + node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + 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; + node_0->layout.position[CSS_TOP] = 19; + node_0->layout.position[CSS_LEFT] = -8; + node_0->layout.dimensions[CSS_WIDTH] = 516; + node_0->layout.dimensions[CSS_HEIGHT] = 712; } test("Random #67", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + 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.justify_content = CSS_JUSTIFY_CENTER; node_0->style.align_items = CSS_ALIGN_CENTER; node_0->style.margin[CSS_TOP] = 7; node_0->style.padding[CSS_LEFT] = 8; @@ -5265,11 +5417,10 @@ int main() init_css_node_children(node_0, 4); { css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; + node_1 = node_0->get_child(node_0->context, 0); + node_1->style.justify_content = CSS_JUSTIFY_FLEX_END; node_1->style.align_items = CSS_ALIGN_CENTER; - node_1->style.align_self = CSS_ALIGN_CENTER; - node_1->style.flex = CSS_FLEX_ONE; + node_1->style.align_self = CSS_ALIGN_STRETCH; node_1->style.dimensions[CSS_HEIGHT] = 952; node_1->style.margin[CSS_LEFT] = 17; node_1->style.margin[CSS_TOP] = 17; @@ -5284,8 +5435,8 @@ int main() node_1->style.padding[CSS_BOTTOM] = 11; node_1->style.border[CSS_BOTTOM] = 2; node_1->style.position[CSS_TOP] = 4; - node_1 = &node_0->children[1]; - node_1->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; + node_1 = node_0->get_child(node_0->context, 1); + node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW; node_1->style.justify_content = CSS_JUSTIFY_SPACE_AROUND; node_1->style.dimensions[CSS_WIDTH] = 229; node_1->style.margin[CSS_LEFT] = 1; @@ -5301,11 +5452,10 @@ int main() node_1->style.position[CSS_TOP] = -3; node_1->measure = measure; node_1->context = "loooooooooong with space"; - node_1 = &node_0->children[2]; - node_1->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; + node_1 = node_0->get_child(node_0->context, 2); + node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW; node_1->style.justify_content = CSS_JUSTIFY_SPACE_AROUND; node_1->style.align_self = CSS_ALIGN_FLEX_END; - node_1->style.flex = CSS_FLEX_ONE; node_1->style.dimensions[CSS_WIDTH] = 971; node_1->style.margin[CSS_LEFT] = 15; node_1->style.margin[CSS_TOP] = 1; @@ -5315,8 +5465,9 @@ int main() node_1->style.padding[CSS_BOTTOM] = 0; node_1->measure = measure; node_1->context = "small"; - node_1 = &node_0->children[3]; - node_1->style.flex = CSS_FLEX_NONE; + node_1 = node_0->get_child(node_0->context, 3); + node_1->style.justify_content = CSS_JUSTIFY_FLEX_END; + node_1->style.align_self = CSS_ALIGN_CENTER; node_1->style.margin[CSS_LEFT] = 0; node_1->style.margin[CSS_TOP] = 0; node_1->style.margin[CSS_RIGHT] = 0; @@ -5336,7 +5487,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 8; @@ -5346,22 +5497,22 @@ int main() init_css_node_children(node_0, 4); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = 13; - node_1->layout.position[CSS_LEFT] = 498.5; - node_1->layout.dimensions[CSS_WIDTH] = 22; + node_1->layout.position[CSS_LEFT] = 25; + node_1->layout.dimensions[CSS_WIDTH] = 969; node_1->layout.dimensions[CSS_HEIGHT] = 952; - node_1 = &node_0->children[1]; + node_1 = node_0->get_child(node_0->context, 1); node_1->layout.position[CSS_TOP] = 987; node_1->layout.position[CSS_LEFT] = 388; node_1->layout.dimensions[CSS_WIDTH] = 229; node_1->layout.dimensions[CSS_HEIGHT] = 21; - node_1 = &node_0->children[2]; + node_1 = node_0->get_child(node_0->context, 2); node_1->layout.position[CSS_TOP] = 1013; node_1->layout.position[CSS_LEFT] = 23; node_1->layout.dimensions[CSS_WIDTH] = 971; node_1->layout.dimensions[CSS_HEIGHT] = 18; - node_1 = &node_0->children[3]; + node_1 = node_0->get_child(node_0->context, 3); node_1->layout.position[CSS_TOP] = 1026; node_1->layout.position[CSS_LEFT] = 480; node_1->layout.dimensions[CSS_WIDTH] = 35; @@ -5373,11 +5524,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.justify_content = CSS_JUSTIFY_CENTER; node_0->style.dimensions[CSS_WIDTH] = 486; node_0->style.margin[CSS_LEFT] = 19; node_0->style.margin[CSS_TOP] = 19; @@ -5391,11 +5541,11 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->style.flex_direction = CSS_FLEX_DIRECTION_ROW; - node_1->style.justify_content = CSS_JUSTIFY_SPACE_BETWEEN; - node_1->style.align_items = CSS_ALIGN_FLEX_START; - node_1->style.align_self = CSS_ALIGN_STRETCH; + node_1->style.justify_content = CSS_JUSTIFY_FLEX_START; + node_1->style.align_items = CSS_ALIGN_STRETCH; + node_1->style.flex = 1; node_1->style.dimensions[CSS_WIDTH] = 482; node_1->style.dimensions[CSS_HEIGHT] = 818; node_1->style.margin[CSS_RIGHT] = 14; @@ -5408,7 +5558,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 13; @@ -5418,7 +5568,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + 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] = 482; @@ -5430,43 +5580,11 @@ int main() } { - css_node_t *root_node = new_css_node(); - { - css_node_t *node_0 = root_node; - node_0->style.justify_content = CSS_JUSTIFY_SPACE_BETWEEN; - node_0->style.dimensions[CSS_WIDTH] = 36; - node_0->style.margin[CSS_LEFT] = 18; - node_0->style.margin[CSS_TOP] = 18; - node_0->style.margin[CSS_RIGHT] = 18; - node_0->style.margin[CSS_BOTTOM] = 18; - node_0->style.margin[CSS_TOP] = 8; - node_0->style.margin[CSS_RIGHT] = -9; - node_0->style.padding[CSS_LEFT] = 12; - node_0->style.padding[CSS_RIGHT] = 14; - node_0->style.padding[CSS_BOTTOM] = 10; - node_0->style.position[CSS_LEFT] = -1; - node_0->measure = measure; - node_0->context = "loooooooooong with space"; - } - - css_node_t *root_layout = new_css_node(); - { - css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = 8; - node_0->layout.position[CSS_LEFT] = 17; - node_0->layout.dimensions[CSS_WIDTH] = 36; - node_0->layout.dimensions[CSS_HEIGHT] = 46; - } - - test("Random #70", root_node, root_layout); - } - - { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -5475,14 +5593,233 @@ int main() node_0->layout.dimensions[CSS_HEIGHT] = 0; } + test("Random #70", 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.margin[CSS_LEFT] = -7; + node_0->style.margin[CSS_TOP] = -7; + node_0->style.margin[CSS_RIGHT] = -7; + node_0->style.margin[CSS_BOTTOM] = -7; + node_0->style.margin[CSS_TOP] = -6; + node_0->style.margin[CSS_RIGHT] = 3; + node_0->style.margin[CSS_BOTTOM] = 1; + node_0->style.padding[CSS_LEFT] = 19; + node_0->style.padding[CSS_TOP] = 19; + node_0->style.padding[CSS_RIGHT] = 19; + node_0->style.padding[CSS_BOTTOM] = 19; + node_0->style.padding[CSS_LEFT] = 3; + 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_LEFT] = 0; + node_0->style.border[CSS_TOP] = 3; + node_0->style.border[CSS_RIGHT] = 1; + node_0->style.position[CSS_LEFT] = -3; + node_0->style.position[CSS_TOP] = 8; + 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_COLUMN; + node_1->style.justify_content = CSS_JUSTIFY_FLEX_START; + node_1->style.align_items = CSS_ALIGN_CENTER; + node_1->style.align_self = CSS_ALIGN_FLEX_END; + node_1->style.position_type = CSS_POSITION_RELATIVE; + node_1->style.dimensions[CSS_WIDTH] = 422; + node_1->style.dimensions[CSS_HEIGHT] = 971; + node_1->style.margin[CSS_BOTTOM] = 10; + node_1->style.padding[CSS_BOTTOM] = 3; + node_1->style.border[CSS_RIGHT] = 1; + node_1->style.position[CSS_LEFT] = -3; + 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.justify_content = CSS_JUSTIFY_FLEX_END; + node_2->style.align_items = CSS_ALIGN_CENTER; + node_2->style.position_type = CSS_POSITION_ABSOLUTE; + node_2->style.margin[CSS_LEFT] = 6; + node_2->style.padding[CSS_LEFT] = 0; + node_2->style.padding[CSS_TOP] = 0; + node_2->style.padding[CSS_RIGHT] = 0; + node_2->style.padding[CSS_BOTTOM] = 0; + node_2->style.padding[CSS_RIGHT] = 2; + node_2->style.border[CSS_TOP] = 1; + init_css_node_children(node_2, 3); + { + css_node_t *node_3; + node_3 = node_2->get_child(node_2->context, 0); + node_3->style.margin[CSS_LEFT] = 6; + node_3->style.margin[CSS_TOP] = 6; + node_3->style.margin[CSS_RIGHT] = 6; + node_3->style.margin[CSS_BOTTOM] = 6; + node_3->style.margin[CSS_BOTTOM] = 2; + node_3->style.padding[CSS_TOP] = 8; + node_3->style.padding[CSS_RIGHT] = 6; + node_3->style.padding[CSS_BOTTOM] = 6; + node_3->style.position[CSS_LEFT] = -5; + node_3->measure = measure; + node_3->context = "loooooooooong with space"; + node_3 = node_2->get_child(node_2->context, 1); + node_3->style.margin[CSS_LEFT] = 4; + node_3->style.margin[CSS_TOP] = 8; + node_3->style.margin[CSS_RIGHT] = 15; + node_3->style.padding[CSS_LEFT] = 18; + node_3->style.padding[CSS_TOP] = 18; + node_3->style.padding[CSS_RIGHT] = 18; + node_3->style.padding[CSS_BOTTOM] = 18; + init_css_node_children(node_3, 2); + { + css_node_t *node_4; + node_4 = node_3->get_child(node_3->context, 0); + node_4->style.flex_direction = CSS_FLEX_DIRECTION_ROW; + node_4->style.justify_content = CSS_JUSTIFY_FLEX_START; + node_4->style.align_self = CSS_ALIGN_CENTER; + node_4->style.dimensions[CSS_HEIGHT] = 96; + node_4->style.margin[CSS_RIGHT] = 7; + node_4->style.margin[CSS_BOTTOM] = -4; + node_4->style.padding[CSS_TOP] = 0; + node_4->style.padding[CSS_RIGHT] = 16; + node_4->style.position[CSS_TOP] = 8; + node_4->measure = measure; + node_4->context = "small"; + node_4 = node_3->get_child(node_3->context, 1); + node_4->style.justify_content = CSS_JUSTIFY_FLEX_START; + node_4->style.align_items = CSS_ALIGN_CENTER; + node_4->style.position_type = CSS_POSITION_ABSOLUTE; + node_4->style.dimensions[CSS_WIDTH] = 493; + node_4->style.margin[CSS_LEFT] = 12; + node_4->style.margin[CSS_TOP] = 12; + node_4->style.margin[CSS_RIGHT] = 12; + node_4->style.margin[CSS_BOTTOM] = 12; + node_4->style.margin[CSS_LEFT] = -5; + node_4->style.margin[CSS_TOP] = 13; + node_4->style.margin[CSS_RIGHT] = -10; + node_4->style.margin[CSS_BOTTOM] = 1; + node_4->style.border[CSS_LEFT] = 0; + node_4->style.border[CSS_TOP] = 0; + node_4->style.border[CSS_RIGHT] = 0; + node_4->style.border[CSS_BOTTOM] = 0; + node_4->style.position[CSS_LEFT] = 9; + init_css_node_children(node_4, 1); + { + css_node_t *node_5; + node_5 = node_4->get_child(node_4->context, 0); + node_5->style.align_self = CSS_ALIGN_FLEX_START; + node_5->style.dimensions[CSS_WIDTH] = 450; + node_5->style.dimensions[CSS_HEIGHT] = 863; + node_5->style.margin[CSS_LEFT] = 5; + node_5->style.margin[CSS_TOP] = 5; + node_5->style.margin[CSS_RIGHT] = 5; + node_5->style.margin[CSS_BOTTOM] = 5; + node_5->style.margin[CSS_RIGHT] = -2; + node_5->style.padding[CSS_RIGHT] = 10; + node_5->style.border[CSS_RIGHT] = 2; + node_5->measure = measure; + node_5->context = "small"; + } + } + node_3 = node_2->get_child(node_2->context, 2); + node_3->style.justify_content = CSS_JUSTIFY_FLEX_START; + node_3->style.align_self = CSS_ALIGN_FLEX_END; + node_3->style.margin[CSS_LEFT] = 13; + node_3->style.margin[CSS_BOTTOM] = -2; + node_3->style.padding[CSS_LEFT] = 16; + node_3->style.padding[CSS_RIGHT] = 9; + node_3->style.border[CSS_BOTTOM] = 0; + node_3->style.position[CSS_LEFT] = 4; + node_3->style.position[CSS_TOP] = 6; + node_3->measure = measure; + node_3->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] = 2; + node_0->layout.position[CSS_LEFT] = -10; + node_0->layout.dimensions[CSS_WIDTH] = 445; + node_0->layout.dimensions[CSS_HEIGHT] = 1023; + 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] = 22; + node_1->layout.position[CSS_LEFT] = 0; + node_1->layout.dimensions[CSS_WIDTH] = 422; + node_1->layout.dimensions[CSS_HEIGHT] = 971; + 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] = 6; + node_2->layout.dimensions[CSS_WIDTH] = 211; + node_2->layout.dimensions[CSS_HEIGHT] = 193; + init_css_node_children(node_2, 3); + { + css_node_t *node_3; + node_3 = node_2->get_child(node_2->context, 0); + node_3->layout.position[CSS_TOP] = 7; + node_3->layout.position[CSS_LEFT] = 11; + node_3->layout.dimensions[CSS_WIDTH] = 177; + node_3->layout.dimensions[CSS_HEIGHT] = 32; + node_3 = node_2->get_child(node_2->context, 1); + node_3->layout.position[CSS_TOP] = 49; + node_3->layout.position[CSS_LEFT] = 53; + node_3->layout.dimensions[CSS_WIDTH] = 92; + node_3->layout.dimensions[CSS_HEIGHT] = 128; + init_css_node_children(node_3, 2); + { + css_node_t *node_4; + node_4 = node_3->get_child(node_3->context, 0); + node_4->layout.position[CSS_TOP] = 26; + node_4->layout.position[CSS_LEFT] = 18; + node_4->layout.dimensions[CSS_WIDTH] = 49; + node_4->layout.dimensions[CSS_HEIGHT] = 96; + node_4 = node_3->get_child(node_3->context, 1); + node_4->layout.position[CSS_TOP] = 123; + node_4->layout.position[CSS_LEFT] = 4; + node_4->layout.dimensions[CSS_WIDTH] = 493; + node_4->layout.dimensions[CSS_HEIGHT] = 873; + init_css_node_children(node_4, 1); + { + css_node_t *node_5; + node_5 = node_4->get_child(node_4->context, 0); + node_5->layout.position[CSS_TOP] = 5; + node_5->layout.position[CSS_LEFT] = 5; + node_5->layout.dimensions[CSS_WIDTH] = 450; + node_5->layout.dimensions[CSS_HEIGHT] = 863; + } + } + node_3 = node_2->get_child(node_2->context, 2); + node_3->layout.position[CSS_TOP] = 183; + node_3->layout.position[CSS_LEFT] = 17; + node_3->layout.dimensions[CSS_WIDTH] = 196; + node_3->layout.dimensions[CSS_HEIGHT] = 18; + } + } + } + } + test("Random #71", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + 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.flex_direction = CSS_FLEX_DIRECTION_COLUMN; node_0->style.margin[CSS_LEFT] = 12; node_0->style.margin[CSS_TOP] = 12; node_0->style.margin[CSS_RIGHT] = 12; @@ -5498,9 +5835,9 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.align_self = CSS_ALIGN_FLEX_START; - node_1->style.flex = CSS_FLEX_NONE; + node_1 = node_0->get_child(node_0->context, 0); + node_1->style.align_items = CSS_ALIGN_FLEX_START; + node_1->style.align_self = CSS_ALIGN_CENTER; node_1->style.position_type = CSS_POSITION_ABSOLUTE; node_1->style.margin[CSS_LEFT] = -6; node_1->style.margin[CSS_TOP] = -6; @@ -5524,10 +5861,10 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; - node_2->style.justify_content = CSS_JUSTIFY_SPACE_AROUND; - node_2->style.align_items = CSS_ALIGN_CENTER; - node_2->style.align_self = CSS_ALIGN_FLEX_END; + node_2 = node_1->get_child(node_1->context, 0); + node_2->style.flex_direction = CSS_FLEX_DIRECTION_ROW; + node_2->style.justify_content = CSS_JUSTIFY_CENTER; + node_2->style.align_items = CSS_ALIGN_FLEX_END; node_2->style.margin[CSS_RIGHT] = 6; node_2->style.margin[CSS_BOTTOM] = 16; node_2->style.padding[CSS_TOP] = 6; @@ -5537,7 +5874,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 19; @@ -5547,7 +5884,7 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; + node_1 = node_0->get_child(node_0->context, 0); node_1->layout.position[CSS_TOP] = -15; node_1->layout.position[CSS_LEFT] = -12; node_1->layout.dimensions[CSS_WIDTH] = 42; @@ -5555,7 +5892,7 @@ int main() init_css_node_children(node_1, 1); { css_node_t *node_2; - node_2 = &node_1->children[0]; + node_2 = node_1->get_child(node_1->context, 0); node_2->layout.position[CSS_TOP] = 16; node_2->layout.position[CSS_LEFT] = 18; node_2->layout.dimensions[CSS_WIDTH] = 2; @@ -5568,10 +5905,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.justify_content = CSS_JUSTIFY_FLEX_START; node_0->style.margin[CSS_LEFT] = 17; node_0->style.margin[CSS_TOP] = 17; node_0->style.margin[CSS_RIGHT] = 17; @@ -5588,7 +5925,7 @@ int main() node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 20; @@ -5601,38 +5938,11 @@ int main() } { - css_node_t *root_node = new_css_node(); - { - css_node_t *node_0 = root_node; - node_0->style.dimensions[CSS_WIDTH] = 23; - node_0->style.dimensions[CSS_HEIGHT] = 892; - node_0->style.margin[CSS_LEFT] = 13; - node_0->style.margin[CSS_BOTTOM] = -8; - node_0->style.padding[CSS_TOP] = 11; - node_0->style.padding[CSS_RIGHT] = 5; - node_0->style.border[CSS_RIGHT] = 1; - node_0->measure = measure; - node_0->context = "loooooooooong with space"; - } - - css_node_t *root_layout = new_css_node(); - { - css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = 0; - node_0->layout.position[CSS_LEFT] = 13; - node_0->layout.dimensions[CSS_WIDTH] = 23; - node_0->layout.dimensions[CSS_HEIGHT] = 892; - } - - test("Random #74", root_node, root_layout); - } - - { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -5641,15 +5951,78 @@ int main() node_0->layout.dimensions[CSS_HEIGHT] = 0; } + test("Random #74", 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_END; + node_0->style.dimensions[CSS_WIDTH] = 332; + node_0->style.margin[CSS_LEFT] = 18; + node_0->style.margin[CSS_TOP] = 18; + node_0->style.margin[CSS_RIGHT] = 18; + node_0->style.margin[CSS_BOTTOM] = 18; + node_0->style.margin[CSS_RIGHT] = -5; + node_0->style.padding[CSS_LEFT] = 12; + node_0->style.padding[CSS_TOP] = 12; + node_0->style.padding[CSS_RIGHT] = 12; + node_0->style.padding[CSS_BOTTOM] = 12; + node_0->style.padding[CSS_BOTTOM] = 2; + 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_LEFT] = 1; + node_0->style.position[CSS_LEFT] = -9; + node_0->style.position[CSS_TOP] = -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.flex_direction = CSS_FLEX_DIRECTION_ROW; + node_1->style.dimensions[CSS_WIDTH] = 818; + node_1->style.dimensions[CSS_HEIGHT] = 543; + node_1->style.margin[CSS_LEFT] = -2; + node_1->style.margin[CSS_TOP] = -2; + node_1->style.margin[CSS_RIGHT] = -2; + node_1->style.margin[CSS_BOTTOM] = -2; + node_1->style.margin[CSS_LEFT] = 8; + node_1->style.margin[CSS_TOP] = 14; + node_1->style.padding[CSS_TOP] = 10; + node_1->measure = measure; + node_1->context = "small"; + } + } + + css_node_t *root_layout = new_test_css_node(); + { + css_node_t *node_0 = root_layout; + node_0->layout.position[CSS_TOP] = 13; + node_0->layout.position[CSS_LEFT] = 9; + node_0->layout.dimensions[CSS_WIDTH] = 332; + node_0->layout.dimensions[CSS_HEIGHT] = 571; + 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] = 27; + node_1->layout.position[CSS_LEFT] = 21; + node_1->layout.dimensions[CSS_WIDTH] = 818; + node_1->layout.dimensions[CSS_HEIGHT] = 543; + } + } + test("Random #75", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + 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.justify_content = CSS_JUSTIFY_SPACE_AROUND; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW; node_0->style.dimensions[CSS_HEIGHT] = 885; node_0->style.margin[CSS_LEFT] = 13; node_0->style.margin[CSS_BOTTOM] = -2; @@ -5657,7 +6030,7 @@ int main() node_0->style.position[CSS_LEFT] = -4; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -5670,11 +6043,11 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -5687,38 +6060,27 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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] = 885; - node_0->style.margin[CSS_LEFT] = 14; - node_0->style.margin[CSS_TOP] = -3; - node_0->style.padding[CSS_TOP] = 13; - node_0->style.padding[CSS_RIGHT] = 10; - node_0->style.border[CSS_LEFT] = 0; - node_0->style.position[CSS_LEFT] = -4; - node_0->measure = measure; - node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = -3; - node_0->layout.position[CSS_LEFT] = 10; - node_0->layout.dimensions[CSS_WIDTH] = 885; - node_0->layout.dimensions[CSS_HEIGHT] = 31; + 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; } test("Random #78", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; - node_0->style.align_items = CSS_ALIGN_FLEX_END; + node_0->style.justify_content = CSS_JUSTIFY_FLEX_END; node_0->style.dimensions[CSS_HEIGHT] = 332; node_0->style.margin[CSS_LEFT] = 7; node_0->style.margin[CSS_TOP] = 7; @@ -5738,7 +6100,7 @@ int main() node_0->style.position[CSS_TOP] = -2; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 15; @@ -5751,28 +6113,49 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.justify_content = CSS_JUSTIFY_SPACE_BETWEEN; + node_0->style.dimensions[CSS_WIDTH] = 410; + node_0->style.dimensions[CSS_HEIGHT] = 614; + node_0->style.margin[CSS_LEFT] = -2; + node_0->style.margin[CSS_TOP] = -2; + node_0->style.margin[CSS_RIGHT] = -2; + node_0->style.margin[CSS_BOTTOM] = -2; + node_0->style.margin[CSS_TOP] = 16; + node_0->style.margin[CSS_RIGHT] = 3; + node_0->style.margin[CSS_BOTTOM] = -7; + node_0->style.padding[CSS_TOP] = 6; + node_0->style.border[CSS_LEFT] = 3; + node_0->style.border[CSS_TOP] = 3; + node_0->style.border[CSS_RIGHT] = 3; + node_0->style.border[CSS_BOTTOM] = 3; + node_0->style.border[CSS_BOTTOM] = 0; + node_0->style.position[CSS_TOP] = 1; + node_0->measure = measure; + node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + 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; + node_0->layout.position[CSS_TOP] = 17; + node_0->layout.position[CSS_LEFT] = -2; + node_0->layout.dimensions[CSS_WIDTH] = 410; + node_0->layout.dimensions[CSS_HEIGHT] = 614; } test("Random #80", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -5785,11 +6168,11 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -5802,11 +6185,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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_FLEX_START; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; node_0->style.dimensions[CSS_WIDTH] = 978; node_0->style.dimensions[CSS_HEIGHT] = 446; node_0->style.margin[CSS_LEFT] = 10; @@ -5819,10 +6201,8 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; - node_1->style.align_self = CSS_ALIGN_CENTER; - node_1->style.flex = CSS_FLEX_ONE; + node_1 = node_0->get_child(node_0->context, 0); + node_1->style.align_self = CSS_ALIGN_FLEX_END; node_1->style.dimensions[CSS_WIDTH] = 256; node_1->style.dimensions[CSS_HEIGHT] = 883; node_1->style.margin[CSS_LEFT] = -8; @@ -5836,7 +6216,7 @@ int main() } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = -4; @@ -5846,10 +6226,10 @@ int main() init_css_node_children(node_0, 1); { css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->layout.position[CSS_TOP] = -221.5; - node_1->layout.position[CSS_LEFT] = 0; - node_1->layout.dimensions[CSS_WIDTH] = 986; + node_1 = node_0->get_child(node_0->context, 0); + node_1->layout.position[CSS_TOP] = -3; + node_1->layout.position[CSS_LEFT] = 730; + node_1->layout.dimensions[CSS_WIDTH] = 256; node_1->layout.dimensions[CSS_HEIGHT] = 883; } } @@ -5858,28 +6238,41 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.justify_content = CSS_JUSTIFY_CENTER; + node_0->style.margin[CSS_LEFT] = 18; + node_0->style.margin[CSS_TOP] = 18; + node_0->style.margin[CSS_RIGHT] = 18; + node_0->style.margin[CSS_BOTTOM] = 18; + node_0->style.margin[CSS_LEFT] = 18; + node_0->style.margin[CSS_TOP] = -8; + node_0->style.padding[CSS_BOTTOM] = 2; + node_0->style.position[CSS_TOP] = -5; + node_0->measure = measure; + node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + 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; + node_0->layout.position[CSS_TOP] = -13; + node_0->layout.position[CSS_LEFT] = 18; + node_0->layout.dimensions[CSS_WIDTH] = 171; + node_0->layout.dimensions[CSS_HEIGHT] = 20; } test("Random #84", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -5892,11 +6285,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.justify_content = CSS_JUSTIFY_CENTER; node_0->style.margin[CSS_RIGHT] = -4; node_0->style.margin[CSS_BOTTOM] = 6; node_0->style.padding[CSS_LEFT] = 11; @@ -5905,7 +6297,7 @@ int main() node_0->style.position[CSS_LEFT] = 7; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -5918,9 +6310,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; + node_0->style.justify_content = CSS_JUSTIFY_FLEX_START; node_0->style.dimensions[CSS_WIDTH] = 335; node_0->style.margin[CSS_LEFT] = 17; node_0->style.margin[CSS_TOP] = 17; @@ -5935,7 +6328,7 @@ int main() node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 24; @@ -5948,10 +6341,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.justify_content = CSS_JUSTIFY_SPACE_AROUND; node_0->style.dimensions[CSS_WIDTH] = 903; node_0->style.margin[CSS_LEFT] = 7; node_0->style.margin[CSS_TOP] = 7; @@ -5962,7 +6355,7 @@ int main() node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 7; @@ -5975,7 +6368,7 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; node_0->style.dimensions[CSS_WIDTH] = 380; @@ -5998,7 +6391,7 @@ int main() node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 13; @@ -6011,115 +6404,27 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.margin[CSS_TOP] = -2; - node_0->style.margin[CSS_RIGHT] = -9; - node_0->style.margin[CSS_BOTTOM] = 3; - node_0->style.padding[CSS_RIGHT] = 12; - node_0->style.position[CSS_LEFT] = -10; - init_css_node_children(node_0, 2); - { - css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->style.justify_content = CSS_JUSTIFY_SPACE_AROUND; - node_1->style.dimensions[CSS_WIDTH] = 641; - node_1->style.margin[CSS_LEFT] = 18; - node_1->style.margin[CSS_TOP] = 18; - node_1->style.margin[CSS_RIGHT] = 18; - node_1->style.margin[CSS_BOTTOM] = 18; - node_1->style.margin[CSS_LEFT] = 3; - node_1->style.margin[CSS_RIGHT] = 15; - node_1->style.margin[CSS_BOTTOM] = 19; - node_1->style.padding[CSS_LEFT] = 13; - node_1->style.padding[CSS_TOP] = 13; - node_1->style.padding[CSS_RIGHT] = 13; - node_1->style.padding[CSS_BOTTOM] = 13; - node_1->style.padding[CSS_RIGHT] = 0; - node_1->style.border[CSS_LEFT] = 3; - node_1->style.border[CSS_RIGHT] = 3; - node_1->style.position[CSS_LEFT] = 6; - node_1 = &node_0->children[1]; - node_1->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; - node_1->style.align_self = CSS_ALIGN_FLEX_END; - node_1->style.flex = CSS_FLEX_NONE; - node_1->style.margin[CSS_LEFT] = 16; - node_1->style.margin[CSS_TOP] = 16; - node_1->style.margin[CSS_RIGHT] = 16; - node_1->style.margin[CSS_BOTTOM] = 16; - node_1->style.margin[CSS_LEFT] = 12; - node_1->style.margin[CSS_TOP] = 9; - node_1->style.margin[CSS_RIGHT] = 1; - 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_RIGHT] = 2; - init_css_node_children(node_1, 1); - { - css_node_t *node_2; - node_2 = &node_1->children[0]; - node_2->style.flex_direction = CSS_FLEX_DIRECTION_ROW; - node_2->style.align_self = CSS_ALIGN_CENTER; - node_2->style.dimensions[CSS_WIDTH] = 180; - node_2->style.margin[CSS_LEFT] = 11; - node_2->style.margin[CSS_TOP] = 11; - node_2->style.margin[CSS_RIGHT] = 11; - node_2->style.margin[CSS_BOTTOM] = 11; - node_2->style.margin[CSS_LEFT] = 14; - node_2->style.margin[CSS_TOP] = -6; - node_2->style.margin[CSS_BOTTOM] = 14; - node_2->style.padding[CSS_BOTTOM] = 13; - node_2->style.position[CSS_LEFT] = -5; - node_2->style.position[CSS_TOP] = 6; - node_2->measure = measure; - node_2->context = "loooooooooong with space"; - } - } } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = -2; - node_0->layout.position[CSS_LEFT] = -10; - node_0->layout.dimensions[CSS_WIDTH] = 671; - node_0->layout.dimensions[CSS_HEIGHT] = 129; - init_css_node_children(node_0, 2); - { - css_node_t *node_1; - node_1 = &node_0->children[0]; - node_1->layout.position[CSS_TOP] = 18; - node_1->layout.position[CSS_LEFT] = 9; - node_1->layout.dimensions[CSS_WIDTH] = 641; - node_1->layout.dimensions[CSS_HEIGHT] = 26; - node_1 = &node_0->children[1]; - node_1->layout.position[CSS_TOP] = 72; - node_1->layout.position[CSS_LEFT] = 450; - node_1->layout.dimensions[CSS_WIDTH] = 208; - node_1->layout.dimensions[CSS_HEIGHT] = 41; - init_css_node_children(node_1, 1); - { - css_node_t *node_2; - node_2 = &node_1->children[0]; - node_2->layout.position[CSS_TOP] = 1; - node_2->layout.position[CSS_LEFT] = 10; - node_2->layout.dimensions[CSS_WIDTH] = 180; - node_2->layout.dimensions[CSS_HEIGHT] = 31; - } - } + 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; } test("Random #90", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; - node_0->style.justify_content = CSS_JUSTIFY_CENTER; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; node_0->style.margin[CSS_BOTTOM] = 7; node_0->style.padding[CSS_LEFT] = 3; node_0->style.padding[CSS_TOP] = 3; @@ -6130,7 +6435,7 @@ int main() node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 4; @@ -6143,56 +6448,38 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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_SPACE_AROUND; + node_0->style.margin[CSS_LEFT] = -8; + node_0->style.margin[CSS_RIGHT] = -2; + node_0->style.margin[CSS_BOTTOM] = 4; + node_0->style.padding[CSS_RIGHT] = 0; + node_0->style.border[CSS_TOP] = 2; + node_0->measure = measure; + node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + 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; + node_0->layout.position[CSS_LEFT] = -8; + node_0->layout.dimensions[CSS_WIDTH] = 33; + node_0->layout.dimensions[CSS_HEIGHT] = 20; } test("Random #92", root_node, root_layout); } { - css_node_t *root_node = new_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_SPACE_AROUND; - node_0->style.dimensions[CSS_WIDTH] = 310; - node_0->style.margin[CSS_TOP] = 4; - node_0->style.padding[CSS_RIGHT] = 6; - node_0->style.border[CSS_LEFT] = 1; - node_0->style.border[CSS_TOP] = 0; - node_0->style.border[CSS_RIGHT] = 0; - node_0->measure = measure; - node_0->context = "small"; - } - - css_node_t *root_layout = new_css_node(); - { - css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = 4; - node_0->layout.position[CSS_LEFT] = 0; - node_0->layout.dimensions[CSS_WIDTH] = 310; - node_0->layout.dimensions[CSS_HEIGHT] = 18; - } - - test("Random #93", root_node, root_layout); - } - - { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 0; @@ -6201,13 +6488,51 @@ int main() node_0->layout.dimensions[CSS_HEIGHT] = 0; } + test("Random #93", 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.dimensions[CSS_WIDTH] = 922; + node_0->style.margin[CSS_LEFT] = 6; + node_0->style.margin[CSS_TOP] = 6; + node_0->style.margin[CSS_RIGHT] = 6; + node_0->style.margin[CSS_BOTTOM] = 6; + node_0->style.margin[CSS_LEFT] = 18; + node_0->style.margin[CSS_TOP] = -10; + node_0->style.margin[CSS_BOTTOM] = 15; + node_0->style.padding[CSS_TOP] = 3; + node_0->style.border[CSS_LEFT] = 0; + node_0->style.border[CSS_TOP] = 0; + node_0->style.border[CSS_RIGHT] = 0; + node_0->style.border[CSS_BOTTOM] = 0; + node_0->style.border[CSS_LEFT] = 2; + node_0->style.border[CSS_TOP] = 1; + node_0->style.border[CSS_BOTTOM] = 0; + 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] = -10; + node_0->layout.position[CSS_LEFT] = 18; + node_0->layout.dimensions[CSS_WIDTH] = 922; + node_0->layout.dimensions[CSS_HEIGHT] = 22; + } + test("Random #94", root_node, root_layout); } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; + node_0->style.justify_content = CSS_JUSTIFY_CENTER; node_0->style.dimensions[CSS_WIDTH] = 779; node_0->style.margin[CSS_LEFT] = 3; node_0->style.margin[CSS_BOTTOM] = 19; @@ -6222,7 +6547,7 @@ int main() node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 9; @@ -6235,10 +6560,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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.justify_content = CSS_JUSTIFY_FLEX_START; node_0->style.dimensions[CSS_HEIGHT] = 863; node_0->style.margin[CSS_TOP] = 6; node_0->style.margin[CSS_RIGHT] = -7; @@ -6250,7 +6575,7 @@ int main() node_0->context = "small"; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 3; @@ -6263,26 +6588,16 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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_FLEX_END; - node_0->style.align_items = CSS_ALIGN_FLEX_START; - node_0->style.margin[CSS_TOP] = -4; - node_0->style.margin[CSS_BOTTOM] = -5; - node_0->style.padding[CSS_RIGHT] = 5; - node_0->style.border[CSS_RIGHT] = 3; - node_0->style.position[CSS_LEFT] = 1; - node_0->style.position[CSS_TOP] = -4; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; - node_0->layout.position[CSS_TOP] = -8; - node_0->layout.position[CSS_LEFT] = 1; - node_0->layout.dimensions[CSS_WIDTH] = 8; + 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; } @@ -6290,10 +6605,10 @@ int main() } { - css_node_t *root_node = new_css_node(); + css_node_t *root_node = new_test_css_node(); { css_node_t *node_0 = root_node; - node_0->style.justify_content = CSS_JUSTIFY_SPACE_AROUND; + node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW; node_0->style.dimensions[CSS_WIDTH] = 770; node_0->style.dimensions[CSS_HEIGHT] = 873; node_0->style.margin[CSS_BOTTOM] = 15; @@ -6305,7 +6620,7 @@ int main() node_0->style.position[CSS_TOP] = 1; } - css_node_t *root_layout = new_css_node(); + css_node_t *root_layout = new_test_css_node(); { css_node_t *node_0 = root_layout; node_0->layout.position[CSS_TOP] = 1; @@ -6318,32 +6633,17 @@ int main() } { - css_node_t *root_node = new_css_node(); + 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_FLEX_START; - node_0->style.dimensions[CSS_WIDTH] = 799; - node_0->style.margin[CSS_BOTTOM] = 3; - node_0->style.padding[CSS_LEFT] = 0; - node_0->style.padding[CSS_BOTTOM] = 3; - node_0->style.border[CSS_LEFT] = 3; - node_0->style.border[CSS_TOP] = 3; - node_0->style.border[CSS_RIGHT] = 3; - node_0->style.border[CSS_BOTTOM] = 3; - node_0->style.border[CSS_LEFT] = 1; - node_0->style.border[CSS_BOTTOM] = 1; - node_0->measure = measure; - node_0->context = "loooooooooong with space"; } - css_node_t *root_layout = new_css_node(); + 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] = 799; - node_0->layout.dimensions[CSS_HEIGHT] = 25; + node_0->layout.dimensions[CSS_WIDTH] = 0; + node_0->layout.dimensions[CSS_HEIGHT] = 0; } test("Random #99", root_node, root_layout); diff --git a/src/__tests__/Layout-test.js b/src/__tests__/Layout-test.js index e530d079..035f3128 100755 --- a/src/__tests__/Layout-test.js +++ b/src/__tests__/Layout-test.js @@ -690,7 +690,7 @@ describe('Layout', function() { ) }); - it('should layout node with borderWidth and position: absolute, top, main axis', function() { + it('should layout node with borderWidth and position: absolute, top', function() { testLayout( {style: {borderTopWidth: 1}, children: [ {style: {top: -1, position: 'absolute'}} @@ -701,7 +701,7 @@ describe('Layout', function() { ) }); - it('should layout node with borderWidth and position: absolute, top, cross axis', function() { + it('should layout node with borderWidth and position: absolute, top. cross axis', function() { testLayout( {style: {borderWidth: 1}, children: [ {style: {left: 5, position: 'absolute'}} @@ -906,112 +906,39 @@ describe('Layout', function() { ); }); - it('should layout with position absolute right', function() { + it('should layout with position absolute, top, left, bottom, right', function() { testLayout( - {style: {}, children: [ - {style: {right: 5, borderWidth: 5, position: 'absolute'}} + {style: {width: 100, height: 100}, children: [ + {style: {position: 'absolute', top: 0, left: 0, bottom: 0, right: 0}} ]}, - {width: 0, height: 0, top: 0, left: 0, children: [ - {width: 10, height: 10, top: 0, left: -15} + {width: 100, height: 100, top: 0, left: 0, children: [ + {width: 100, height: 100, top: 0, left: 0} ]} ); }); - it('should layout with position absolute right and negative margin', function() { + it('should layout with arbitrary flex', function() { testLayout( - {style: {}, children: [ - {style: {right: 20, marginLeft: 5, marginRight: -5, width: 5, position: 'absolute'}} + {style: {width: 100, height: 100}, children: [ + {style: {flex: 2.5}}, + {style: {flex: 7.5}} ]}, - {width: 0, height: 0, top: 0, left: 0, children: [ - {width: 5, height: 0, top: 0, left: -20} + {width: 100, height: 100, top: 0, left: 0, children: [ + {width: 0, height: 25, top: 0, left: 0}, + {width: 0, height: 75, top: 25, left: 0}, ]} ); }); - it('should layout with position absolute left and right', function() { + it('should layout with negative flex', function() { testLayout( - {style: {width: 100}, children: [ - {style: {right: 5, left: 5, position: 'absolute'}} + {style: {width: 100, height: 100}, children: [ + {style: {flex: -2.5}}, + {style: {flex: 0}} ]}, - {width: 100, height: 0, top: 0, left: 0, children: [ - {width: 90, height: 0, top: 0, left: 5} - ]} - ); - }); - - it('should layout with position absolute bottom', function() { - testLayout( - {style: {}, children: [ - {style: {bottom: 5, paddingTop: 5, position: 'absolute'}} - ]}, - {width: 0, height: 0, top: 0, left: 0, children: [ - {width: 0, height: 5, top: -10, left: 0} - ]} - ); - }); - - it('should layout with position absolute left and negative right', function() { - testLayout( - {style: {}, children: [ - {style: {left: 5, right: -1, position: 'absolute'}} - ]}, - {width: 0, height: 0, top: 0, left: 0, children: [ - {width: 0, height: 0, top: 0, left: 5} - ]} - ); - }); - - it('should layout with position absolute top, bottom and padding', function() { - testLayout( - {style: {}, children: [ - {style: {top: 5, bottom: 5, paddingTop: 5, position: 'absolute'}} - ]}, - {width: 0, height: 0, top: 0, left: 0, children: [ - {width: 0, height: 5, top: 5, left: 0} - ]} - ); - }); - - it('should layout with position absolute top, bottom and height', function() { - testLayout( - {style: {}, children: [ - {style: {top: 5, bottom: 5, height: 900, position: 'absolute'}} - ]}, - {width: 0, height: 0, top: 0, left: 0, children: [ - {width: 0, height: 900, top: 5, left: 0} - ]} - ); - }); - - it('should layout with position absolute left, right and width', function() { - testLayout( - {style: {}, children: [ - {style: {left: 5, right: -1, width: 300, position: 'absolute'}} - ]}, - {width: 0, height: 0, top: 0, left: 0, children: [ - {width: 300, height: 0, top: 0, left: 5} - ]} - ); - }); - - it('should layout with position absolute top, bottom and min padding', function() { - testLayout( - {style: {}, children: [ - {style: {top: -5, bottom: -5, paddingTop: 5, position: 'absolute'}} - ]}, - {width: 0, height: 0, top: 0, left: 0, children: [ - {width: 0, height: 10, top: -5, left: 0} - ]} - ); - }); - - it('should layout with border and right absolute child', function() { - testLayout( - {style: {borderRightWidth: 5}, children: [ - {style: {right: -10, position: 'absolute'}} - ]}, - {width: 5, height: 0, top: 0, left: 0, children: [ - {width: 0, height: 0, top: 0, left: 10} + {width: 100, height: 100, top: 0, left: 0, children: [ + {width: 0, height: 0, top: 0, left: 0}, + {width: 0, height: 0, top: 0, left: 0}, ]} ); }); @@ -1047,6 +974,9 @@ describe('Layout', function() { var rng = new RNG(0); function randMinMax(node, chance, attribute, min, max) { if (rng.nextFloat() < chance) { + if (attribute === 'right' || attribute === 'bottom') { + return; + } node.style[attribute] = Math.floor(rng.nextFloat() * (max - min)) + min; } } @@ -1074,20 +1004,20 @@ describe('Layout', function() { var node = {style: {}}; randMinMax(node, 0.5, 'width', -100, 1000); randMinMax(node, 0.5, 'height', -100, 1000); - randMinMax(node, 0.9, 'top', -10, 10); - randMinMax(node, 0.9, 'left', -10, 10); - randMinMax(node, 0.9, 'right', -10, 10); - randMinMax(node, 0.9, 'bottom', -10, 10); + randMinMax(node, 0.5, 'top', -10, 10); + randMinMax(node, 0.5, 'left', -10, 10); + randMinMax(node, 0.5, 'right', -10, 10); + randMinMax(node, 0.5, 'bottom', -10, 10); randSpacing(node, 0.5, 'margin', '', -10, 20); randSpacing(node, 0.5, 'padding', '', -10, 20); randSpacing(node, 0.5, 'border', 'Width', -4, 4); + randMinMax(node, 0.5, 'flex', -10, 10); randEnum(node, 0.5, 'flexDirection', ['column', 'row']); randEnum(node, 0.5, 'justifyContent', ['flex-start', 'center', 'flex-end', 'space-between', 'space-around']); randEnum(node, 0.5, 'alignItems', ['flex-start', 'center', 'flex-end', 'stretch']); randEnum(node, 0.5, 'alignSelf', ['flex-start', 'center', 'flex-end', 'stretch']); - randEnum(node, 0.5, 'flex', ['none', 1]); randEnum(node, 0.5, 'position', ['relative', 'absolute']); -// randEnum(node, 0.5, 'measure', [text('small'), text('loooooooooong with space')]); + randEnum(node, 0.5, 'measure', [text('small'), text('loooooooooong with space')]); if (node.style.measure) { // align-items: stretch on a text node makes it wrap in a different way. diff --git a/src/transpile.html b/src/transpile.html index a03409b6..179a4f9c 100644 --- a/src/transpile.html +++ b/src/transpile.html @@ -22,7 +22,7 @@ document.getElementById('layout_code').value = computeLayout.toString() .replace(/layout\[pos/g, 'layout.position[pos') .replace(/layout\[leading/g, 'layout.position[leading') .replace(/style\[dim/g, 'style.dimensions[dim') - .replace(/node.children\[i\]/g, '&node.children[i]') + .replace(/node.children\[i\]/g, 'node->get_child(node->context, i)') .replace(/node\./g, 'node->') .replace(/child\./g, 'child->') .replace(/parent\./g, 'parent->') @@ -89,7 +89,7 @@ function printLayout(test) { level++; // Output the style node - add('css_node_t *root_node = new_css_node();'); + add('css_node_t *root_node = new_test_css_node();'); add('{'); level++; if (!isEmpty(test.node.style) || test.node.children && test.node.children.length) { @@ -159,14 +159,11 @@ function printLayout(test) { 'flex-end': 'CSS_ALIGN_FLEX_END', 'stretch': 'CSS_ALIGN_STRETCH' }); - addEnum(node, 'flex', 'flex', { - 'none': 'CSS_FLEX_NONE', - '1': 'CSS_FLEX_ONE' - }); addEnum(node, 'position', 'position_type', { 'relative': 'CSS_POSITION_RELATIVE', 'absolute': 'CSS_POSITION_ABSOLUTE' }); + addFloat('positive', node, 'flex', 'flex'); addFloat('positive', node, 'width', 'dimensions[CSS_WIDTH]'); addFloat('positive', node, 'height', 'dimensions[CSS_HEIGHT]'); addSpacing('all', node, 'margin', ''); @@ -185,7 +182,7 @@ function printLayout(test) { add('css_node_t *node_' + (level - 3) + ';'); for (var i = 0; i < node.children.length; ++i) { - add('node_' + (level - 3) + ' = &node_' + (level - 4) + '->children[' + i + '];'); + add('node_' + (level - 3) + ' = node_' + (level - 4) + '->get_child(node_' + (level - 4) + '->context, ' + i + ');'); rec_style(node.children[i]); } @@ -199,7 +196,7 @@ function printLayout(test) { add(''); // Output the expected layout node - add('css_node_t *root_layout = new_css_node();'); + add('css_node_t *root_layout = new_test_css_node();'); add('{'); level++; add('css_node_t *node_0 = root_layout;'); @@ -221,7 +218,7 @@ function printLayout(test) { add('css_node_t *node_' + (level - 3) + ';'); for (var i = 0; i < node.children.length; ++i) { - add('node_' + (level - 3) + ' = &node_' + (level - 4) + '->children[' + i + '];'); + add('node_' + (level - 3) + ' = node_' + (level - 4) + '->get_child(node_' + (level - 4) + '->context, ' + i + ');'); rec_layout(node.children[i]); }