diff --git a/src/JavaTranspiler.js b/src/JavaTranspiler.js index 455b826d..1c888bc5 100644 --- a/src/JavaTranspiler.js +++ b/src/JavaTranspiler.js @@ -10,54 +10,42 @@ function __transpileToJavaCommon(code) { return code .replace(/CSS_UNDEFINED/g, 'CSSConstants.UNDEFINED') + .replace(/CSS_JUSTIFY_/g, 'CSSJustify.') + .replace(/CSS_ALIGN_/g, 'CSSAlign.') .replace(/css_flex_direction_t/g, 'CSSFlexDirection') .replace(/css_direction_t/g, 'CSSDirection') - .replace(/CSS_DIRECTION_/g, 'CSSDirection.') - .replace(/CSS_FLEX_DIRECTION_/g, 'CSSFlexDirection.') .replace(/css_align_t/g, 'CSSAlign') - .replace(/CSS_ALIGN_/g, 'CSSAlign.') - .replace(/CSS_WRAP/g, 'CSSWrap.WRAP') - .replace(/CSS_POSITION_/g, 'CSSPositionType.') .replace(/css_justify_t/g, 'CSSJustify') - .replace(/CSS_JUSTIFY_/g, 'CSSJustify.') .replace(/css_dim_t/g, 'MeasureOutput') .replace(/bool/g, 'boolean') - .replace(/^(\s+)([^\s]+)\s+\+=/gm, '$1$2 = $2 +') // Expand += - .replace(/leading\[([^\]]+)\]/g, 'getLeading($1)') - .replace(/trailing\[([^\]]+)\]/g, 'getTrailing($1)') - .replace(/pos\[([^\]]+)\]/g, 'getPos($1)') - .replace(/dim\[([^\]]+)\]/g, 'getDim($1)') - .replace(/isUndefined/g, 'CSSConstants.isUndefined') + .replace(/style\[dim/g, 'style.dimensions[dim') + .replace(/(style|layout)\.width/g, '$1.dimensions[DIMENSION_WIDTH]') + .replace(/(style|layout)\.height/g, '$1.dimensions[DIMENSION_HEIGHT]') + .replace(/layout\[dim/g, 'layout.dimensions[dim') + .replace(/layout\[pos/g, 'layout.position[pos') + .replace(/layout\[leading/g, 'layout.position[leading') + .replace(/layout\[trailing/g, 'layout.position[trailing') + .replace(/\/\*\(c\)!([^*]+)\*\//g, '') + .replace(/var\/\*\(java\)!([^*]+)\*\//g, '$1') .replace(/\/\*\(java\)!([^*]+)\*\//g, '$1') - - // Since Java doesn't store its attributes in arrays, we need to use setters/getters to access - // the appropriate layout/style fields - .replace( - /(\w+)\.layout\[((?:getLeading|getPos)\([^\)]+\))\]\s+=\s+([^;]+);/gm, - 'setLayoutPosition($1, $2, $3);') - .replace( - /(\w+)\.layout\[((?:getTrailing|getPos)\([^\)]+\))\]\s+=\s+([^;]+);/gm, - 'setLayoutPosition($1, $2, $3);') - .replace( - /(\w+)\.layout\.direction\s+=\s+([^;]+);/gm, - 'setLayoutDirection($1, $2);') - .replace(/(\w+)\.layout\[((?:getLeading|getPos)\([^\]]+\))\]/g, 'getLayoutPosition($1, $2)') - .replace(/(\w+)\.layout\[((?:getTrailing|getPos)\([^\]]+\))\]/g, 'getLayoutPosition($1, $2)') - .replace( - /(\w+)\.layout\[(getDim\([^\)]+\))\]\s+=\s+([^;]+);/gm, - 'setLayoutDimension($1, $2, $3);') - .replace(/(\w+)\.layout\[(getDim\([^\]]+\))\]/g, 'getLayoutDimension($1, $2)') - .replace(/(\w+)\.style\[((?:getLeading|getPos)\([^\]]+\))\]/g, 'getStylePosition($1, $2)') - .replace(/(\w+)\.style\[(getDim\([^\]]+\))\]/g, 'getStyleDimension($1, $2)'); } function __transpileSingleTestToJava(code) { return __transpileToJavaCommon(code) + .replace(/CSS_DIRECTION_/g, 'CSSDirection.') + .replace(/CSS_FLEX_DIRECTION_/g, 'CSSFlexDirection.') + .replace(/CSS_WRAP/g, 'CSSWrap.WRAP') + .replace(/CSS_POSITION_/g, 'CSSPositionType.') .replace(/new_test_css_node/g, 'new TestCSSNode') - .replace( // style.dimensions[CSS_WIDTH] => style.width + .replace( // style.position[CSS_TOP] => style.position[CSSLayout.POSITION_TOP] + /(style|layout)\.position\[CSS_(LEFT|TOP|RIGHT|BOTTOM)\]/g, + function (str, match1, match2) { + return match1 + '.position[POSITION_' + match2 + ']'; + }) + .replace( // style.dimensions[CSS_WIDTH] => style.dimensions[CSSLayout.DIMENSION_WIDTH] /(style|layout)\.dimensions\[CSS_(WIDTH|HEIGHT)\]/g, function (str, match1, match2) { - return match1 + '.' + match2.toLowerCase(); + return match1 + '.dimensions[DIMENSION_' + match2 + ']'; }) .replace( // style.maxDimensions[CSS_WIDTH] => style.maxWidth /(style|layout)\.maxDimensions\[CSS_(WIDTH|HEIGHT)\]/g, @@ -69,16 +57,6 @@ function __transpileSingleTestToJava(code) { function (str, match1, match2) { return match1 + '.min' + match2.substr(0, 1).toUpperCase() + match2.substr(1).toLowerCase(); }) - .replace( // layout.position[CSS_TOP] => layout.y - /layout\.position\[CSS_(TOP|LEFT)\]/g, - function (str, match1) { - return 'layout.' + (match1 === 'TOP' ? 'top' : 'left'); - }) - .replace( // style.position[CSS_TOP] => style.positionTop - /style\.(position)\[CSS_(TOP|BOTTOM|LEFT|RIGHT)\]/g, - function (str, match1, match2) { - return 'style.' + match1 + match2[0] + match2.substring(1).toLowerCase(); - }) .replace( // style.margin[CSS_TOP] = 12.3 => style.margin[Spacing.TOP].set(12.3) /style\.(margin|border|padding)\[CSS_(TOP|BOTTOM|LEFT|RIGHT|START|END)\]\s+=\s+(-?[\.\d]+)/g, function (str, match1, match2, match3) { diff --git a/src/Layout.js b/src/Layout.js index a70e205e..bb9eeb9b 100755 --- a/src/Layout.js +++ b/src/Layout.js @@ -391,9 +391,9 @@ var computeLayout = (function() { function layoutNode(node, parentMaxWidth, /*css_direction_t*/parentDirection) { var/*css_direction_t*/ direction = resolveDirection(node, parentDirection); - var/*css_flex_direction_t*/ mainAxis = resolveAxis(getFlexDirection(node), direction); - var/*css_flex_direction_t*/ crossAxis = getCrossFlexDirection(mainAxis, direction); - var/*css_flex_direction_t*/ resolvedRowAxis = resolveAxis(CSS_FLEX_DIRECTION_ROW, direction); + var/*(c)!css_flex_direction_t*//*(java)!int*/ mainAxis = resolveAxis(getFlexDirection(node), direction); + var/*(c)!css_flex_direction_t*//*(java)!int*/ crossAxis = getCrossFlexDirection(mainAxis, direction); + var/*(c)!css_flex_direction_t*//*(java)!int*/ resolvedRowAxis = resolveAxis(CSS_FLEX_DIRECTION_ROW, direction); // Handle width and height style attributes setDimensionFromStyle(node, mainAxis); @@ -457,7 +457,7 @@ var computeLayout = (function() { var/*int*/ i; var/*int*/ ii; var/*css_node_t**/ child; - var/*css_flex_direction_t*/ axis; + var/*(c)!css_flex_direction_t*//*(java)!int*/ axis; // Pre-fill some dimensions straight from the parent for (i = 0; i < node.children.length; ++i) { diff --git a/src/java/src/com/facebook/csslayout/CSSLayout.java b/src/java/src/com/facebook/csslayout/CSSLayout.java index 6b457183..e5fafb17 100644 --- a/src/java/src/com/facebook/csslayout/CSSLayout.java +++ b/src/java/src/com/facebook/csslayout/CSSLayout.java @@ -8,49 +8,50 @@ */ package com.facebook.csslayout; +import java.util.Arrays; + /** * Where the output of {@link LayoutEngine#layoutNode(CSSNode, float)} will go in the CSSNode. */ public class CSSLayout { + static final int POSITION_LEFT = 0; + static final int POSITION_TOP = 1; + static final int POSITION_RIGHT = 2; + static final int POSITION_BOTTOM = 3; - public float top; - public float left; - public float right; - public float bottom; - public float width = CSSConstants.UNDEFINED; - public float height = CSSConstants.UNDEFINED; - public CSSDirection direction = CSSDirection.LTR; + static final int DIMENSION_WIDTH = 0; + static final int DIMENSION_HEIGHT = 1; + + float[] position = new float[4]; + float[] dimensions = new float[2]; + CSSDirection direction = CSSDirection.LTR; /** * This should always get called before calling {@link LayoutEngine#layoutNode(CSSNode, float)} */ public void resetResult() { - left = 0; - top = 0; - right = 0; - bottom = 0; - width = CSSConstants.UNDEFINED; - height = CSSConstants.UNDEFINED; + Arrays.fill(position, 0); + Arrays.fill(dimensions, CSSConstants.UNDEFINED); direction = CSSDirection.LTR; } public void copy(CSSLayout layout) { - left = layout.left; - top = layout.top; - right = layout.right; - bottom = layout.bottom; - width = layout.width; - height = layout.height; + position[POSITION_LEFT] = layout.position[POSITION_LEFT]; + position[POSITION_TOP] = layout.position[POSITION_TOP]; + position[POSITION_RIGHT] = layout.position[POSITION_RIGHT]; + position[POSITION_BOTTOM] = layout.position[POSITION_BOTTOM]; + dimensions[DIMENSION_WIDTH] = layout.dimensions[DIMENSION_WIDTH]; + dimensions[DIMENSION_HEIGHT] = layout.dimensions[DIMENSION_HEIGHT]; direction = layout.direction; } @Override public String toString() { return "layout: {" + - "left: " + left + ", " + - "top: " + top + ", " + - "width: " + width + ", " + - "height: " + height + ", " + + "left: " + position[POSITION_LEFT] + ", " + + "top: " + position[POSITION_TOP] + ", " + + "width: " + dimensions[DIMENSION_WIDTH] + ", " + + "height: " + dimensions[DIMENSION_HEIGHT] + ", " + "direction: " + direction + "}"; } diff --git a/src/java/src/com/facebook/csslayout/CSSNode.java b/src/java/src/com/facebook/csslayout/CSSNode.java index 064ec193..91d7ed83 100644 --- a/src/java/src/com/facebook/csslayout/CSSNode.java +++ b/src/java/src/com/facebook/csslayout/CSSNode.java @@ -14,6 +14,13 @@ import java.util.ArrayList; import com.facebook.infer.annotation.Assertions; +import static com.facebook.csslayout.CSSLayout.DIMENSION_HEIGHT; +import static com.facebook.csslayout.CSSLayout.DIMENSION_WIDTH; +import static com.facebook.csslayout.CSSLayout.POSITION_BOTTOM; +import static com.facebook.csslayout.CSSLayout.POSITION_LEFT; +import static com.facebook.csslayout.CSSLayout.POSITION_RIGHT; +import static com.facebook.csslayout.CSSLayout.POSITION_TOP; + /** * A CSS Node. It has a style object you can manipulate at {@link #style}. After calling * {@link #calculateLayout()}, {@link #layout} will be filled with the results of the layout. @@ -293,61 +300,61 @@ public class CSSNode { } public void setPositionTop(float positionTop) { - if (!valuesEqual(style.positionTop, positionTop)) { - style.positionTop = positionTop; + if (!valuesEqual(style.position[POSITION_TOP], positionTop)) { + style.position[POSITION_TOP] = positionTop; dirty(); } } public void setPositionBottom(float positionBottom) { - if (!valuesEqual(style.positionBottom, positionBottom)) { - style.positionBottom = positionBottom; + if (!valuesEqual(style.position[POSITION_BOTTOM], positionBottom)) { + style.position[POSITION_BOTTOM] = positionBottom; dirty(); } } public void setPositionLeft(float positionLeft) { - if (!valuesEqual(style.positionLeft, positionLeft)) { - style.positionLeft = positionLeft; + if (!valuesEqual(style.position[POSITION_LEFT], positionLeft)) { + style.position[POSITION_LEFT] = positionLeft; dirty(); } } public void setPositionRight(float positionRight) { - if (!valuesEqual(style.positionRight, positionRight)) { - style.positionRight = positionRight; + if (!valuesEqual(style.position[POSITION_RIGHT], positionRight)) { + style.position[POSITION_RIGHT] = positionRight; dirty(); } } public void setStyleWidth(float width) { - if (!valuesEqual(style.width, width)) { - style.width = width; + if (!valuesEqual(style.dimensions[DIMENSION_WIDTH], width)) { + style.dimensions[DIMENSION_WIDTH] = width; dirty(); } } public void setStyleHeight(float height) { - if (!valuesEqual(style.height, height)) { - style.height = height; + if (!valuesEqual(style.dimensions[DIMENSION_HEIGHT], height)) { + style.dimensions[DIMENSION_HEIGHT] = height; dirty(); } } public float getLayoutX() { - return layout.left; + return layout.position[POSITION_LEFT]; } public float getLayoutY() { - return layout.top; + return layout.position[POSITION_TOP]; } public float getLayoutWidth() { - return layout.width; + return layout.dimensions[DIMENSION_WIDTH]; } public float getLayoutHeight() { - return layout.height; + return layout.dimensions[DIMENSION_HEIGHT]; } public CSSDirection getLayoutDirection() { @@ -365,14 +372,14 @@ public class CSSNode { * Get this node's width, as defined in the style. */ public float getStyleWidth() { - return style.width; + return style.dimensions[DIMENSION_WIDTH]; } /** * Get this node's height, as defined in the style. */ public float getStyleHeight() { - return style.height; + return style.dimensions[DIMENSION_HEIGHT]; } /** diff --git a/src/java/src/com/facebook/csslayout/CSSStyle.java b/src/java/src/com/facebook/csslayout/CSSStyle.java index 15b10a5b..4b361fb8 100644 --- a/src/java/src/com/facebook/csslayout/CSSStyle.java +++ b/src/java/src/com/facebook/csslayout/CSSStyle.java @@ -27,13 +27,17 @@ public class CSSStyle { public Spacing padding = new Spacing(); public Spacing border = new Spacing(); - public float positionTop = CSSConstants.UNDEFINED; - public float positionBottom = CSSConstants.UNDEFINED; - public float positionLeft = CSSConstants.UNDEFINED; - public float positionRight = CSSConstants.UNDEFINED; + public float[] position = { + CSSConstants.UNDEFINED, + CSSConstants.UNDEFINED, + CSSConstants.UNDEFINED, + CSSConstants.UNDEFINED, + }; - public float width = CSSConstants.UNDEFINED; - public float height = CSSConstants.UNDEFINED; + public float[] dimensions = { + CSSConstants.UNDEFINED, + CSSConstants.UNDEFINED, + }; public float minWidth = CSSConstants.UNDEFINED; public float minHeight = CSSConstants.UNDEFINED; diff --git a/src/java/src/com/facebook/csslayout/LayoutEngine.java b/src/java/src/com/facebook/csslayout/LayoutEngine.java index f0da1921..2b8a5ed8 100644 --- a/src/java/src/com/facebook/csslayout/LayoutEngine.java +++ b/src/java/src/com/facebook/csslayout/LayoutEngine.java @@ -8,329 +8,160 @@ */ package com.facebook.csslayout; +import static com.facebook.csslayout.CSSConstants.isUndefined; +import static com.facebook.csslayout.CSSLayout.DIMENSION_HEIGHT; +import static com.facebook.csslayout.CSSLayout.DIMENSION_WIDTH; +import static com.facebook.csslayout.CSSLayout.POSITION_BOTTOM; +import static com.facebook.csslayout.CSSLayout.POSITION_LEFT; +import static com.facebook.csslayout.CSSLayout.POSITION_RIGHT; +import static com.facebook.csslayout.CSSLayout.POSITION_TOP; + /** * Calculates layouts based on CSS style. See {@link #layoutNode(CSSNode, float)}. */ public class LayoutEngine { - private static enum PositionIndex { - TOP, - LEFT, - BOTTOM, - RIGHT, - START, - END, + private static final int CSS_FLEX_DIRECTION_COLUMN = + CSSFlexDirection.COLUMN.ordinal(); + private static final int CSS_FLEX_DIRECTION_COLUMN_REVERSE = + CSSFlexDirection.COLUMN_REVERSE.ordinal(); + private static final int CSS_FLEX_DIRECTION_ROW = + CSSFlexDirection.ROW.ordinal(); + private static final int CSS_FLEX_DIRECTION_ROW_REVERSE = + CSSFlexDirection.ROW_REVERSE.ordinal(); + + private static final int CSS_POSITION_RELATIVE = CSSPositionType.RELATIVE.ordinal(); + private static final int CSS_POSITION_ABSOLUTE = CSSPositionType.ABSOLUTE.ordinal(); + + private static final int[] leading = { + POSITION_TOP, + POSITION_BOTTOM, + POSITION_LEFT, + POSITION_RIGHT, + }; + + private static final int[] trailing = { + POSITION_BOTTOM, + POSITION_TOP, + POSITION_RIGHT, + POSITION_LEFT, + }; + + private static final int[] pos = { + POSITION_TOP, + POSITION_BOTTOM, + POSITION_LEFT, + POSITION_RIGHT, + }; + + private static final int[] dim = { + DIMENSION_HEIGHT, + DIMENSION_HEIGHT, + DIMENSION_WIDTH, + DIMENSION_WIDTH, + }; + + private static boolean isDimDefined(CSSNode node, int axis) { + float value = node.style.dimensions[dim[axis]]; + return !isUndefined(value) && value > 0.0; } - private static enum DimensionIndex { - WIDTH, - HEIGHT, + private static boolean isPosDefined(CSSNode node, int position) { + return !isUndefined(node.style.position[position]); } - private static void setLayoutPosition(CSSNode node, PositionIndex position, float value) { - switch (position) { - case TOP: - node.layout.top = value; - break; - case LEFT: - node.layout.left = value; - break; - case RIGHT: - node.layout.right = value; - break; - case BOTTOM: - node.layout.bottom = value; - break; - default: - throw new RuntimeException("Didn't get TOP, LEFT, RIGHT, or BOTTOM!"); - } + private static float getPosition(CSSNode node, int position) { + float result = node.style.position[position]; + return isUndefined(result) ? 0 : result; } - private static float getLayoutPosition(CSSNode node, PositionIndex position) { - switch (position) { - case TOP: - return node.layout.top; - case LEFT: - return node.layout.left; - case RIGHT: - return node.layout.right; - case BOTTOM: - return node.layout.bottom; - default: - throw new RuntimeException("Didn't get TOP, LEFT, RIGHT, or BOTTOM!"); - } - } - - private static void setLayoutDimension(CSSNode node, DimensionIndex dimension, float value) { - switch (dimension) { - case WIDTH: - node.layout.width = value; - break; - case HEIGHT: - node.layout.height = value; - break; - default: - throw new RuntimeException("Someone added a third dimension..."); - } - } - - private static float getLayoutDimension(CSSNode node, DimensionIndex dimension) { - switch (dimension) { - case WIDTH: - return node.layout.width; - case HEIGHT: - return node.layout.height; - default: - throw new RuntimeException("Someone added a third dimension..."); - } - } - - private static void setLayoutDirection(CSSNode node, CSSDirection direction) { - node.layout.direction = direction; - } - - private static float getStylePosition(CSSNode node, PositionIndex position) { - switch (position) { - case TOP: - return node.style.positionTop; - case BOTTOM: - return node.style.positionBottom; - case LEFT: - return node.style.positionLeft; - case RIGHT: - return node.style.positionRight; - default: - throw new RuntimeException("Someone added a new cardinal direction..."); - } - } - - private static float getStyleDimension(CSSNode node, DimensionIndex dimension) { - switch (dimension) { - case WIDTH: - return node.style.width; - case HEIGHT: - return node.style.height; - default: - throw new RuntimeException("Someone added a third dimension..."); - } - } - - private static PositionIndex getLeading(CSSFlexDirection axis) { - switch (axis) { - case COLUMN: - return PositionIndex.TOP; - case COLUMN_REVERSE: - return PositionIndex.BOTTOM; - case ROW: - return PositionIndex.LEFT; - case ROW_REVERSE: - return PositionIndex.RIGHT; - default: - throw new RuntimeException("Didn't get TOP, LEFT, RIGHT, or BOTTOM!"); - } - } - - private static PositionIndex getTrailing(CSSFlexDirection axis) { - switch (axis) { - case COLUMN: - return PositionIndex.BOTTOM; - case COLUMN_REVERSE: - return PositionIndex.TOP; - case ROW: - return PositionIndex.RIGHT; - case ROW_REVERSE: - return PositionIndex.LEFT; - default: - throw new RuntimeException("Didn't get COLUMN, COLUMN_REVERSE, ROW, or ROW_REVERSE!"); - } - } - - private static PositionIndex getPos(CSSFlexDirection axis) { - switch (axis) { - case COLUMN: - return PositionIndex.TOP; - case COLUMN_REVERSE: - return PositionIndex.BOTTOM; - case ROW: - return PositionIndex.LEFT; - case ROW_REVERSE: - return PositionIndex.RIGHT; - default: - throw new RuntimeException("Didn't get COLUMN, COLUMN_REVERSE, ROW, or ROW_REVERSE!"); - } - } - - private static DimensionIndex getDim(CSSFlexDirection axis) { - switch (axis) { - case COLUMN: - case COLUMN_REVERSE: - return DimensionIndex.HEIGHT; - case ROW: - case ROW_REVERSE: - return DimensionIndex.WIDTH; - default: - throw new RuntimeException("Didn't get COLUMN, COLUMN_REVERSE, ROW, or ROW_REVERSE!"); - } - } - - private static boolean isDimDefined(CSSNode node, CSSFlexDirection axis) { - float value = getStyleDimension(node, getDim(axis)); - return !CSSConstants.isUndefined(value) && value > 0.0; - } - - private static boolean isPosDefined(CSSNode node, PositionIndex position) { - return !CSSConstants.isUndefined(getStylePosition(node, position)); - } - - private static float getPosition(CSSNode node, PositionIndex position) { - float result = getStylePosition(node, position); - return CSSConstants.isUndefined(result) ? 0 : result; - } - - private static float getMargin(CSSNode node, PositionIndex position) { - switch (position) { - case TOP: - return node.style.margin.get(Spacing.TOP); - case BOTTOM: - return node.style.margin.get(Spacing.BOTTOM); - case LEFT: - return node.style.margin.get(Spacing.LEFT); - case RIGHT: - return node.style.margin.get(Spacing.RIGHT); - case START: - return node.style.margin.get(Spacing.START); - case END: - return node.style.margin.get(Spacing.END); - default: - throw new RuntimeException("Someone added a new cardinal direction..."); - } - } - - private static float getLeadingMargin(CSSNode node, CSSFlexDirection axis) { + private static float getLeadingMargin(CSSNode node, int axis) { if (isRowDirection(axis)) { float leadingMargin = node.style.margin.getRaw(Spacing.START); - if (!CSSConstants.isUndefined(leadingMargin)) { + if (!isUndefined(leadingMargin)) { return leadingMargin; } } - return getMargin(node, getLeading(axis)); + return node.style.margin.get(leading[axis]); } - private static float getTrailingMargin(CSSNode node, CSSFlexDirection axis) { + private static float getTrailingMargin(CSSNode node, int axis) { if (isRowDirection(axis)) { float trailingMargin = node.style.margin.getRaw(Spacing.END); - if (!CSSConstants.isUndefined(trailingMargin)) { + if (!isUndefined(trailingMargin)) { return trailingMargin; } } - return getMargin(node, getTrailing(axis)); + return node.style.margin.get(trailing[axis]); } - private static float getPadding(CSSNode node, PositionIndex position) { - switch (position) { - case TOP: - return node.style.padding.get(Spacing.TOP); - case BOTTOM: - return node.style.padding.get(Spacing.BOTTOM); - case LEFT: - return node.style.padding.get(Spacing.LEFT); - case RIGHT: - return node.style.padding.get(Spacing.RIGHT); - case START: - return node.style.padding.get(Spacing.START); - case END: - return node.style.padding.get(Spacing.END); - default: - throw new RuntimeException("Someone added a new cardinal direction..."); - } - } - - private static float getLeadingPadding(CSSNode node, CSSFlexDirection axis) { + private static float getLeadingPadding(CSSNode node, int axis) { if (isRowDirection(axis)) { float leadingPadding = node.style.padding.getRaw(Spacing.START); - if (!CSSConstants.isUndefined(leadingPadding)) { + if (!isUndefined(leadingPadding)) { return leadingPadding; } } - return getPadding(node, getLeading(axis)); + return node.style.padding.get(leading[axis]); } - private static float getTrailingPadding(CSSNode node, CSSFlexDirection axis) { + private static float getTrailingPadding(CSSNode node, int axis) { if (isRowDirection(axis)) { float trailingPadding = node.style.padding.getRaw(Spacing.END); - if (!CSSConstants.isUndefined(trailingPadding)) { + if (!isUndefined(trailingPadding)) { return trailingPadding; } } - return getPadding(node, getTrailing(axis)); + return node.style.padding.get(trailing[axis]); } - private static float getBorder(CSSNode node, PositionIndex position) { - switch (position) { - case TOP: - return node.style.border.get(Spacing.TOP); - case BOTTOM: - return node.style.border.get(Spacing.BOTTOM); - case LEFT: - return node.style.border.get(Spacing.LEFT); - case RIGHT: - return node.style.border.get(Spacing.RIGHT); - case START: - return node.style.border.get(Spacing.START); - case END: - return node.style.border.get(Spacing.END); - default: - throw new RuntimeException("Someone added a new cardinal direction..."); - } - } - - private static float getLeadingBorder(CSSNode node, CSSFlexDirection axis) { + private static float getLeadingBorder(CSSNode node, int axis) { if (isRowDirection(axis)) { float leadingBorder = node.style.border.getRaw(Spacing.START); - if (!CSSConstants.isUndefined(leadingBorder)) { + if (!isUndefined(leadingBorder)) { return leadingBorder; } } - return getBorder(node, getLeading(axis)); + return node.style.border.get(leading[axis]); } - private static float getTrailingBorder(CSSNode node, CSSFlexDirection axis) { + private static float getTrailingBorder(CSSNode node, int axis) { if (isRowDirection(axis)) { float trailingBorder = node.style.border.getRaw(Spacing.END); - if (!CSSConstants.isUndefined(trailingBorder)) { + if (!isUndefined(trailingBorder)) { return trailingBorder; } } - return getBorder(node, getTrailing(axis)); + return node.style.border.get(trailing[axis]); } - private static float getLeadingPaddingAndBorder(CSSNode node, CSSFlexDirection axis) { + private static float getLeadingPaddingAndBorder(CSSNode node, int axis) { return getLeadingPadding(node, axis) + getLeadingBorder(node, axis); } - private static float getTrailingPaddingAndBorder(CSSNode node, CSSFlexDirection axis) { + private static float getTrailingPaddingAndBorder(CSSNode node, int axis) { return getTrailingPadding(node, axis) + getTrailingBorder(node, axis); } - private static float getBorderAxis(CSSNode node, CSSFlexDirection axis) { + private static float getBorderAxis(CSSNode node, int axis) { return getLeadingBorder(node, axis) + getTrailingBorder(node, axis); } - private static float getMarginAxis(CSSNode node, CSSFlexDirection axis) { + private static float getMarginAxis(CSSNode node, int axis) { return getLeadingMargin(node, axis) + getTrailingMargin(node, axis); } - private static float getPaddingAndBorderAxis(CSSNode node, CSSFlexDirection axis) { + private static float getPaddingAndBorderAxis(CSSNode node, int axis) { return getLeadingPaddingAndBorder(node, axis) + getTrailingPaddingAndBorder(node, axis); } - private static float boundAxis(CSSNode node, CSSFlexDirection axis, float value) { + private static float boundAxis(CSSNode node, int axis, float value) { float min = CSSConstants.UNDEFINED; float max = CSSConstants.UNDEFINED; @@ -344,19 +175,19 @@ public class LayoutEngine { float boundValue = value; - if (!CSSConstants.isUndefined(max) && max >= 0.0 && boundValue > max) { + if (!isUndefined(max) && max >= 0.0 && boundValue > max) { boundValue = max; } - if (!CSSConstants.isUndefined(min) && min >= 0.0 && boundValue < min) { + if (!isUndefined(min) && min >= 0.0 && boundValue < min) { boundValue = min; } return boundValue; } - private static void setDimensionFromStyle(CSSNode node, CSSFlexDirection axis) { + private static void setDimensionFromStyle(CSSNode node, int axis) { // The parent already computed us a width or height. We just skip it - if (!CSSConstants.isUndefined(getLayoutDimension(node, getDim(axis)))) { + if (!isUndefined(node.layout.dimensions[dim[axis]])) { return; } // We only run if there's a width or height defined @@ -366,53 +197,49 @@ public class LayoutEngine { // The dimensions can never be smaller than the padding and border float maxLayoutDimension = Math.max( - boundAxis(node, axis, getStyleDimension(node, getDim(axis))), + boundAxis(node, axis, node.style.dimensions[dim[axis]]), getPaddingAndBorderAxis(node, axis)); - setLayoutDimension(node, getDim(axis), maxLayoutDimension); + node.layout.dimensions[dim[axis]] = maxLayoutDimension; } private static void setTrailingPosition( CSSNode node, CSSNode child, - CSSFlexDirection axis) { - setLayoutPosition( - child, - getTrailing(axis), - getLayoutDimension(node, getDim(axis)) - - getLayoutDimension(child, getDim(axis)) - - getLayoutPosition(child, getPos(axis))); + int axis) { + child.layout.position[trailing[axis]] = node.layout.dimensions[dim[axis]] - + child.layout.dimensions[dim[axis]] - child.layout.position[pos[axis]]; } - private static float getRelativePosition(CSSNode node, CSSFlexDirection axis) { - float lead = getStylePosition(node, getLeading(axis)); - if (!CSSConstants.isUndefined(lead)) { + private static float getRelativePosition(CSSNode node, int axis) { + float lead = node.style.position[leading[axis]]; + if (!isUndefined(lead)) { return lead; } - return -getPosition(node, getTrailing(axis)); + return -getPosition(node, trailing[axis]); } private static float getFlex(CSSNode node) { return node.style.flex; } - private static boolean isRowDirection(CSSFlexDirection flexDirection) { - return flexDirection == CSSFlexDirection.ROW || - flexDirection == CSSFlexDirection.ROW_REVERSE; + private static boolean isRowDirection(int flexDirection) { + return flexDirection == CSS_FLEX_DIRECTION_ROW || + flexDirection == CSS_FLEX_DIRECTION_ROW_REVERSE; } - private static boolean isColumnDirection(CSSFlexDirection flexDirection) { - return flexDirection == CSSFlexDirection.COLUMN || - flexDirection == CSSFlexDirection.COLUMN_REVERSE; + private static boolean isColumnDirection(int flexDirection) { + return flexDirection == CSS_FLEX_DIRECTION_COLUMN || + flexDirection == CSS_FLEX_DIRECTION_COLUMN_REVERSE; } - private static CSSFlexDirection resolveAxis( - CSSFlexDirection axis, + private static int resolveAxis( + int axis, CSSDirection direction) { if (direction == CSSDirection.RTL) { - if (axis == CSSFlexDirection.ROW) { - return CSSFlexDirection.ROW_REVERSE; - } else if (axis == CSSFlexDirection.ROW_REVERSE) { - return CSSFlexDirection.ROW; + if (axis == CSS_FLEX_DIRECTION_ROW) { + return CSS_FLEX_DIRECTION_ROW_REVERSE; + } else if (axis == CSS_FLEX_DIRECTION_ROW_REVERSE) { + return CSS_FLEX_DIRECTION_ROW; } } @@ -428,22 +255,22 @@ public class LayoutEngine { return direction; } - private static CSSFlexDirection getFlexDirection(CSSNode node) { - return node.style.flexDirection; + private static int getFlexDirection(CSSNode node) { + return node.style.flexDirection.ordinal(); } - private static CSSFlexDirection getCrossFlexDirection( - CSSFlexDirection flexDirection, + private static int getCrossFlexDirection( + int flexDirection, CSSDirection direction) { if (isColumnDirection(flexDirection)) { - return resolveAxis(CSSFlexDirection.ROW, direction); + return resolveAxis(CSS_FLEX_DIRECTION_ROW, direction); } else { - return CSSFlexDirection.COLUMN; + return CSS_FLEX_DIRECTION_COLUMN; } } - private static CSSPositionType getPositionType(CSSNode node) { - return node.style.positionType; + private static int getPositionType(CSSNode node) { + return node.style.positionType.ordinal(); } private static CSSAlign getAlignItem(CSSNode node, CSSNode child) { @@ -466,23 +293,27 @@ public class LayoutEngine { } private static boolean isFlex(CSSNode node) { - return getPositionType(node) == CSSPositionType.RELATIVE && getFlex(node) > 0; + return getPositionType(node) == CSS_POSITION_RELATIVE && node.style.flex > 0; } private static boolean isMeasureDefined(CSSNode node) { return node.isMeasureDefined(); } - private static float getDimWithMargin(CSSNode node, CSSFlexDirection axis) { - return getLayoutDimension(node, getDim(axis)) + + private static float getDimWithMargin(CSSNode node, int axis) { + return node.layout.dimensions[dim[axis]] + getLeadingMargin(node, axis) + getTrailingMargin(node, axis); } private static boolean needsRelayout(CSSNode node, float parentMaxWidth) { return node.isDirty() || - !FloatUtil.floatsEqual(node.lastLayout.requestedHeight, node.layout.height) || - !FloatUtil.floatsEqual(node.lastLayout.requestedWidth, node.layout.width) || + !FloatUtil.floatsEqual( + node.lastLayout.requestedHeight, + node.layout.dimensions[DIMENSION_HEIGHT]) || + !FloatUtil.floatsEqual( + node.lastLayout.requestedWidth, + node.layout.dimensions[DIMENSION_WIDTH]) || !FloatUtil.floatsEqual(node.lastLayout.parentMaxWidth, parentMaxWidth); } @@ -492,8 +323,8 @@ public class LayoutEngine { float parentMaxWidth, CSSDirection parentDirection) { if (needsRelayout(node, parentMaxWidth)) { - node.lastLayout.requestedWidth = node.layout.width; - node.lastLayout.requestedHeight = node.layout.height; + node.lastLayout.requestedWidth = node.layout.dimensions[DIMENSION_WIDTH]; + node.lastLayout.requestedHeight = node.layout.dimensions[DIMENSION_HEIGHT]; node.lastLayout.parentMaxWidth = parentMaxWidth; layoutNodeImpl(layoutContext, node, parentMaxWidth, parentDirection); @@ -517,34 +348,34 @@ public class LayoutEngine { /** START_GENERATED **/ CSSDirection direction = resolveDirection(node, parentDirection); - CSSFlexDirection mainAxis = resolveAxis(getFlexDirection(node), direction); - CSSFlexDirection crossAxis = getCrossFlexDirection(mainAxis, direction); - CSSFlexDirection resolvedRowAxis = resolveAxis(CSSFlexDirection.ROW, direction); + int mainAxis = resolveAxis(getFlexDirection(node), direction); + int crossAxis = getCrossFlexDirection(mainAxis, direction); + int resolvedRowAxis = resolveAxis(CSS_FLEX_DIRECTION_ROW, direction); // Handle width and height style attributes setDimensionFromStyle(node, mainAxis); setDimensionFromStyle(node, crossAxis); // Set the resolved resolution in the node's layout - setLayoutDirection(node, direction); + node.layout.direction = direction; // The position is set by the parent, but we need to complete it with a // delta composed of the margin and left/top/right/bottom - setLayoutPosition(node, getLeading(mainAxis), getLayoutPosition(node, getLeading(mainAxis)) + getLeadingMargin(node, mainAxis) + - getRelativePosition(node, mainAxis)); - setLayoutPosition(node, getTrailing(mainAxis), getLayoutPosition(node, getTrailing(mainAxis)) + getTrailingMargin(node, mainAxis) + - getRelativePosition(node, mainAxis)); - setLayoutPosition(node, getLeading(crossAxis), getLayoutPosition(node, getLeading(crossAxis)) + getLeadingMargin(node, crossAxis) + - getRelativePosition(node, crossAxis)); - setLayoutPosition(node, getTrailing(crossAxis), getLayoutPosition(node, getTrailing(crossAxis)) + getTrailingMargin(node, crossAxis) + - getRelativePosition(node, crossAxis)); + node.layout.position[leading[mainAxis]] += getLeadingMargin(node, mainAxis) + + getRelativePosition(node, mainAxis); + node.layout.position[trailing[mainAxis]] += getTrailingMargin(node, mainAxis) + + getRelativePosition(node, mainAxis); + node.layout.position[leading[crossAxis]] += getLeadingMargin(node, crossAxis) + + getRelativePosition(node, crossAxis); + node.layout.position[trailing[crossAxis]] += getTrailingMargin(node, crossAxis) + + getRelativePosition(node, crossAxis); if (isMeasureDefined(node)) { float width = CSSConstants.UNDEFINED; if (isDimDefined(node, resolvedRowAxis)) { - width = node.style.width; - } else if (!CSSConstants.isUndefined(getLayoutDimension(node, getDim(resolvedRowAxis)))) { - width = getLayoutDimension(node, getDim(resolvedRowAxis)); + width = node.style.dimensions[DIMENSION_WIDTH]; + } else if (!isUndefined(node.layout.dimensions[dim[resolvedRowAxis]])) { + width = node.layout.dimensions[dim[resolvedRowAxis]]; } else { width = parentMaxWidth - getMarginAxis(node, resolvedRowAxis); @@ -555,23 +386,24 @@ public class LayoutEngine { // for it computed yet. It can either be from the style attribute or because // the element is flexible. boolean isRowUndefined = !isDimDefined(node, resolvedRowAxis) && - CSSConstants.isUndefined(getLayoutDimension(node, getDim(resolvedRowAxis))); - boolean isColumnUndefined = !isDimDefined(node, CSSFlexDirection.COLUMN) && - CSSConstants.isUndefined(getLayoutDimension(node, getDim(CSSFlexDirection.COLUMN))); + isUndefined(node.layout.dimensions[dim[resolvedRowAxis]]); + boolean isColumnUndefined = !isDimDefined(node, CSS_FLEX_DIRECTION_COLUMN) && + isUndefined(node.layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]]); // Let's not measure the text if we already know both dimensions if (isRowUndefined || isColumnUndefined) { MeasureOutput measureDim = node.measure( - layoutContext.measureOutput, + + layoutContext.measureOutput, width ); if (isRowUndefined) { - node.layout.width = measureDim.width + + node.layout.dimensions[DIMENSION_WIDTH] = measureDim.width + getPaddingAndBorderAxis(node, resolvedRowAxis); } if (isColumnUndefined) { - node.layout.height = measureDim.height + - getPaddingAndBorderAxis(node, CSSFlexDirection.COLUMN); + node.layout.dimensions[DIMENSION_HEIGHT] = measureDim.height + + getPaddingAndBorderAxis(node, CSS_FLEX_DIRECTION_COLUMN); } } if (node.getChildCount() == 0) { @@ -582,7 +414,7 @@ public class LayoutEngine { int i; int ii; CSSNode child; - CSSFlexDirection axis; + int axis; // Pre-fill some dimensions straight from the parent for (i = 0; i < node.getChildCount(); ++i) { @@ -590,42 +422,42 @@ public class LayoutEngine { // Pre-fill cross axis dimensions when the child is using stretch before // we call the recursive layout pass if (getAlignItem(node, child) == CSSAlign.STRETCH && - getPositionType(child) == CSSPositionType.RELATIVE && - !CSSConstants.isUndefined(getLayoutDimension(node, getDim(crossAxis))) && + getPositionType(child) == CSS_POSITION_RELATIVE && + !isUndefined(node.layout.dimensions[dim[crossAxis]]) && !isDimDefined(child, crossAxis)) { - setLayoutDimension(child, getDim(crossAxis), Math.max( - boundAxis(child, crossAxis, getLayoutDimension(node, getDim(crossAxis)) - + child.layout.dimensions[dim[crossAxis]] = Math.max( + boundAxis(child, crossAxis, node.layout.dimensions[dim[crossAxis]] - getPaddingAndBorderAxis(node, crossAxis) - getMarginAxis(child, crossAxis)), // You never want to go smaller than padding getPaddingAndBorderAxis(child, crossAxis) - )); - } else if (getPositionType(child) == CSSPositionType.ABSOLUTE) { + ); + } 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 (ii = 0; ii < 2; ii++) { - axis = (ii != 0) ? CSSFlexDirection.ROW : CSSFlexDirection.COLUMN; - if (!CSSConstants.isUndefined(getLayoutDimension(node, getDim(axis))) && + axis = (ii != 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN; + if (!isUndefined(node.layout.dimensions[dim[axis]]) && !isDimDefined(child, axis) && - isPosDefined(child, getLeading(axis)) && - isPosDefined(child, getTrailing(axis))) { - setLayoutDimension(child, getDim(axis), Math.max( - boundAxis(child, axis, getLayoutDimension(node, getDim(axis)) - + isPosDefined(child, leading[axis]) && + isPosDefined(child, trailing[axis])) { + child.layout.dimensions[dim[axis]] = Math.max( + boundAxis(child, axis, node.layout.dimensions[dim[axis]] - getPaddingAndBorderAxis(node, axis) - getMarginAxis(child, axis) - - getPosition(child, getLeading(axis)) - - getPosition(child, getTrailing(axis))), + getPosition(child, leading[axis]) - + getPosition(child, trailing[axis])), // You never want to go smaller than padding getPaddingAndBorderAxis(child, axis) - )); + ); } } } } float definedMainDim = CSSConstants.UNDEFINED; - if (!CSSConstants.isUndefined(getLayoutDimension(node, getDim(mainAxis)))) { - definedMainDim = getLayoutDimension(node, getDim(mainAxis)) - + if (!isUndefined(node.layout.dimensions[dim[mainAxis]])) { + definedMainDim = node.layout.dimensions[dim[mainAxis]] - getPaddingAndBorderAxis(node, mainAxis); } @@ -660,9 +492,9 @@ public class LayoutEngine { // It only makes sense to consider a child flexible if we have a computed // dimension for the node. - if (!CSSConstants.isUndefined(getLayoutDimension(node, getDim(mainAxis))) && isFlex(child)) { + if (!isUndefined(node.layout.dimensions[dim[mainAxis]]) && isFlex(child)) { flexibleChildrenCount++; - totalFlexible = totalFlexible + getFlex(child); + 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, which represents @@ -679,7 +511,7 @@ public class LayoutEngine { getPaddingAndBorderAxis(node, resolvedRowAxis); if (isDimDefined(node, resolvedRowAxis)) { - maxWidth = getLayoutDimension(node, getDim(resolvedRowAxis)) - + maxWidth = node.layout.dimensions[dim[resolvedRowAxis]] - getPaddingAndBorderAxis(node, resolvedRowAxis); } } @@ -691,7 +523,7 @@ public class LayoutEngine { // Absolute positioned elements do not take part of the layout, so we // don't use them to compute mainContentDim - if (getPositionType(child) == CSSPositionType.RELATIVE) { + if (getPositionType(child) == CSS_POSITION_RELATIVE) { nonFlexibleChildrenCount++; // At this point we know the final size and margin of the element. nextContentDim = getDimWithMargin(child, mainAxis); @@ -700,7 +532,7 @@ public class LayoutEngine { // The element we are about to add would make us go to the next line if (isFlexWrap(node) && - !CSSConstants.isUndefined(getLayoutDimension(node, getDim(mainAxis))) && + !isUndefined(node.layout.dimensions[dim[mainAxis]]) && mainContentDim + nextContentDim > definedMainDim && // If there's only one element, then it's bigger than the content // and needs its own line @@ -710,7 +542,7 @@ public class LayoutEngine { break; } alreadyComputedNextLayout = 0; - mainContentDim = mainContentDim + nextContentDim; + mainContentDim += nextContentDim; endLine = i + 1; } @@ -724,7 +556,7 @@ public class LayoutEngine { // The remaining available space that needs to be allocated float remainingMainDim = 0; - if (!CSSConstants.isUndefined(getLayoutDimension(node, getDim(mainAxis)))) { + if (!isUndefined(node.layout.dimensions[dim[mainAxis]])) { remainingMainDim = definedMainDim - mainContentDim; } else { remainingMainDim = Math.max(mainContentDim, 0) - mainContentDim; @@ -768,13 +600,13 @@ public class LayoutEngine { if (isFlex(child)) { // At this point we know the final size of the element in the main // dimension - setLayoutDimension(child, getDim(mainAxis), boundAxis(child, mainAxis, + child.layout.dimensions[dim[mainAxis]] = boundAxis(child, mainAxis, flexibleMainDim * getFlex(child) + getPaddingAndBorderAxis(child, mainAxis) - )); + ); maxWidth = CSSConstants.UNDEFINED; if (isDimDefined(node, resolvedRowAxis)) { - maxWidth = getLayoutDimension(node, getDim(resolvedRowAxis)) - + maxWidth = node.layout.dimensions[dim[resolvedRowAxis]] - getPaddingAndBorderAxis(node, resolvedRowAxis); } else if (!isRowDirection(mainAxis)) { maxWidth = parentMaxWidth - @@ -825,21 +657,21 @@ public class LayoutEngine { child = node.getChildAt(i); child.lineIndex = linesCount; - if (getPositionType(child) == CSSPositionType.ABSOLUTE && - isPosDefined(child, getLeading(mainAxis))) { + if (getPositionType(child) == CSS_POSITION_ABSOLUTE && + 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). - setLayoutPosition(child, getPos(mainAxis), getPosition(child, getLeading(mainAxis)) + + child.layout.position[pos[mainAxis]] = getPosition(child, leading[mainAxis]) + getLeadingBorder(node, mainAxis) + - getLeadingMargin(child, mainAxis)); + getLeadingMargin(child, mainAxis); } else { // If the child is position absolute (without top/left) or relative, // we put it at the current accumulated offset. - setLayoutPosition(child, getPos(mainAxis), getLayoutPosition(child, getPos(mainAxis)) + mainDim); + child.layout.position[pos[mainAxis]] += mainDim; // Define the trailing position accordingly. - if (!CSSConstants.isUndefined(getLayoutDimension(node, getDim(mainAxis)))) { + if (!isUndefined(node.layout.dimensions[dim[mainAxis]])) { setTrailingPosition(node, child, mainAxis); } } @@ -847,18 +679,18 @@ public class LayoutEngine { // Now that we placed the element, we need to update the variables // We only need to do that for relative elements. Absolute elements // do not take part in that phase. - if (getPositionType(child) == CSSPositionType.RELATIVE) { + if (getPositionType(child) == CSS_POSITION_RELATIVE) { // The main dimension is the sum of all the elements dimension plus // the spacing. - mainDim = mainDim + betweenMainDim + getDimWithMargin(child, mainAxis); + mainDim += betweenMainDim + getDimWithMargin(child, mainAxis); // The cross dimension is the max of the elements dimension since there // can only be one element in that cross dimension. crossDim = Math.max(crossDim, boundAxis(child, crossAxis, getDimWithMargin(child, crossAxis))); } } - float containerCrossAxis = getLayoutDimension(node, getDim(crossAxis)); - if (CSSConstants.isUndefined(getLayoutDimension(node, getDim(crossAxis)))) { + float containerCrossAxis = node.layout.dimensions[dim[crossAxis]]; + if (isUndefined(node.layout.dimensions[dim[crossAxis]])) { containerCrossAxis = Math.max( // For the cross dim, we add both sides at the end because the value // is aggregate via a max function. Intermediate negative values @@ -872,33 +704,33 @@ public class LayoutEngine { for (i = startLine; i < endLine; ++i) { child = node.getChildAt(i); - if (getPositionType(child) == CSSPositionType.ABSOLUTE && - isPosDefined(child, getLeading(crossAxis))) { + if (getPositionType(child) == CSS_POSITION_ABSOLUTE && + 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. - setLayoutPosition(child, getPos(crossAxis), getPosition(child, getLeading(crossAxis)) + + child.layout.position[pos[crossAxis]] = getPosition(child, leading[crossAxis]) + getLeadingBorder(node, crossAxis) + - getLeadingMargin(child, crossAxis)); + getLeadingMargin(child, crossAxis); } else { float leadingCrossDim = getLeadingPaddingAndBorder(node, crossAxis); // For a relative children, we're either using alignItems (parent) or // alignSelf (child) in order to determine the position in the cross axis - if (getPositionType(child) == CSSPositionType.RELATIVE) { + if (getPositionType(child) == CSS_POSITION_RELATIVE) { CSSAlign alignItem = getAlignItem(node, child); if (alignItem == CSSAlign.STRETCH) { // You can only stretch if the dimension has not already been set // previously. if (!isDimDefined(child, crossAxis)) { - setLayoutDimension(child, getDim(crossAxis), Math.max( + child.layout.dimensions[dim[crossAxis]] = Math.max( boundAxis(child, crossAxis, containerCrossAxis - getPaddingAndBorderAxis(node, crossAxis) - getMarginAxis(child, crossAxis)), // You never want to go smaller than padding getPaddingAndBorderAxis(child, crossAxis) - )); + ); } } else if (alignItem != CSSAlign.FLEX_START) { // The remaining space between the parent dimensions+padding and child @@ -908,26 +740,26 @@ public class LayoutEngine { getDimWithMargin(child, crossAxis); if (alignItem == CSSAlign.CENTER) { - leadingCrossDim = leadingCrossDim + remainingCrossDim / 2; + leadingCrossDim += remainingCrossDim / 2; } else { // CSSAlign.FLEX_END - leadingCrossDim = leadingCrossDim + remainingCrossDim; + leadingCrossDim += remainingCrossDim; } } } // And we apply the position - setLayoutPosition(child, getPos(crossAxis), getLayoutPosition(child, getPos(crossAxis)) + linesCrossDim + leadingCrossDim); + child.layout.position[pos[crossAxis]] += linesCrossDim + leadingCrossDim; // Define the trailing position accordingly. - if (!CSSConstants.isUndefined(getLayoutDimension(node, getDim(crossAxis)))) { + if (!isUndefined(node.layout.dimensions[dim[crossAxis]])) { setTrailingPosition(node, child, crossAxis); } } } - linesCrossDim = linesCrossDim + crossDim; + linesCrossDim += crossDim; linesMainDim = Math.max(linesMainDim, mainDim); - linesCount = linesCount + 1; + linesCount += 1; startLine = endLine; } @@ -945,8 +777,8 @@ public class LayoutEngine { // section 9.4 // if (linesCount > 1 && - !CSSConstants.isUndefined(getLayoutDimension(node, getDim(crossAxis)))) { - float nodeCrossAxisInnerSize = getLayoutDimension(node, getDim(crossAxis)) - + !isUndefined(node.layout.dimensions[dim[crossAxis]])) { + float nodeCrossAxisInnerSize = node.layout.dimensions[dim[crossAxis]] - getPaddingAndBorderAxis(node, crossAxis); float remainingAlignContentDim = nodeCrossAxisInnerSize - linesCrossDim; @@ -955,9 +787,9 @@ public class LayoutEngine { CSSAlign alignContent = getAlignContent(node); if (alignContent == CSSAlign.FLEX_END) { - currentLead = currentLead + remainingAlignContentDim; + currentLead += remainingAlignContentDim; } else if (alignContent == CSSAlign.CENTER) { - currentLead = currentLead + remainingAlignContentDim / 2; + currentLead += remainingAlignContentDim / 2; } else if (alignContent == CSSAlign.STRETCH) { if (nodeCrossAxisInnerSize > linesCrossDim) { crossDimLead = (remainingAlignContentDim / linesCount); @@ -972,44 +804,44 @@ public class LayoutEngine { float lineHeight = 0; for (ii = startIndex; ii < node.getChildCount(); ++ii) { child = node.getChildAt(ii); - if (getPositionType(child) != CSSPositionType.RELATIVE) { + if (getPositionType(child) != CSS_POSITION_RELATIVE) { continue; } if (child.lineIndex != i) { break; } - if (!CSSConstants.isUndefined(getLayoutDimension(child, getDim(crossAxis)))) { + if (!isUndefined(child.layout.dimensions[dim[crossAxis]])) { lineHeight = Math.max( lineHeight, - getLayoutDimension(child, getDim(crossAxis)) + getMarginAxis(child, crossAxis) + child.layout.dimensions[dim[crossAxis]] + getMarginAxis(child, crossAxis) ); } } endIndex = ii; - lineHeight = lineHeight + crossDimLead; + lineHeight += crossDimLead; for (ii = startIndex; ii < endIndex; ++ii) { child = node.getChildAt(ii); - if (getPositionType(child) != CSSPositionType.RELATIVE) { + if (getPositionType(child) != CSS_POSITION_RELATIVE) { continue; } CSSAlign alignContentAlignItem = getAlignItem(node, child); if (alignContentAlignItem == CSSAlign.FLEX_START) { - setLayoutPosition(child, getPos(crossAxis), currentLead + getLeadingMargin(child, crossAxis)); + child.layout.position[pos[crossAxis]] = currentLead + getLeadingMargin(child, crossAxis); } else if (alignContentAlignItem == CSSAlign.FLEX_END) { - setLayoutPosition(child, getPos(crossAxis), currentLead + lineHeight - getTrailingMargin(child, crossAxis) - getLayoutDimension(child, getDim(crossAxis))); + child.layout.position[pos[crossAxis]] = currentLead + lineHeight - getTrailingMargin(child, crossAxis) - child.layout.dimensions[dim[crossAxis]]; } else if (alignContentAlignItem == CSSAlign.CENTER) { - float childHeight = getLayoutDimension(child, getDim(crossAxis)); - setLayoutPosition(child, getPos(crossAxis), currentLead + (lineHeight - childHeight) / 2); + float childHeight = child.layout.dimensions[dim[crossAxis]]; + child.layout.position[pos[crossAxis]] = currentLead + (lineHeight - childHeight) / 2; } else if (alignContentAlignItem == CSSAlign.STRETCH) { - setLayoutPosition(child, getPos(crossAxis), currentLead + getLeadingMargin(child, crossAxis)); + child.layout.position[pos[crossAxis]] = currentLead + getLeadingMargin(child, crossAxis); // TODO(prenaux): Correctly set the height of items with undefined // (auto) crossAxis dimension. } } - currentLead = currentLead + lineHeight; + currentLead += lineHeight; } } @@ -1018,26 +850,26 @@ public class LayoutEngine { // If the user didn't specify a width or height, and it has not been set // by the container, then we set it via the children. - if (CSSConstants.isUndefined(getLayoutDimension(node, getDim(mainAxis)))) { - setLayoutDimension(node, getDim(mainAxis), Math.max( + if (isUndefined(node.layout.dimensions[dim[mainAxis]])) { + node.layout.dimensions[dim[mainAxis]] = Math.max( // We're missing the last padding at this point to get the final // dimension boundAxis(node, mainAxis, linesMainDim + getTrailingPaddingAndBorder(node, mainAxis)), // We can never assign a width smaller than the padding and borders getPaddingAndBorderAxis(node, mainAxis) - )); + ); needsMainTrailingPos = true; } - if (CSSConstants.isUndefined(getLayoutDimension(node, getDim(crossAxis)))) { - setLayoutDimension(node, getDim(crossAxis), Math.max( + if (isUndefined(node.layout.dimensions[dim[crossAxis]])) { + node.layout.dimensions[dim[crossAxis]] = Math.max( // For the cross dim, we add both sides at the end because the value // is aggregate via a max function. Intermediate negative values // can mess this computation otherwise boundAxis(node, crossAxis, linesCrossDim + getPaddingAndBorderAxis(node, crossAxis)), getPaddingAndBorderAxis(node, crossAxis) - )); + ); needsCrossTrailingPos = true; } @@ -1060,34 +892,35 @@ public class LayoutEngine { // Calculate dimensions for absolutely positioned elements for (i = 0; i < node.getChildCount(); ++i) { child = node.getChildAt(i); - if (getPositionType(child) == CSSPositionType.ABSOLUTE) { + 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 (ii = 0; ii < 2; ii++) { - axis = (ii != 0) ? CSSFlexDirection.ROW : CSSFlexDirection.COLUMN; - if (!CSSConstants.isUndefined(getLayoutDimension(node, getDim(axis))) && + axis = (ii != 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN; + if (!isUndefined(node.layout.dimensions[dim[axis]]) && !isDimDefined(child, axis) && - isPosDefined(child, getLeading(axis)) && - isPosDefined(child, getTrailing(axis))) { - setLayoutDimension(child, getDim(axis), Math.max( - boundAxis(child, axis, getLayoutDimension(node, getDim(axis)) - + isPosDefined(child, leading[axis]) && + isPosDefined(child, trailing[axis])) { + child.layout.dimensions[dim[axis]] = Math.max( + boundAxis(child, axis, node.layout.dimensions[dim[axis]] - getBorderAxis(node, axis) - getMarginAxis(child, axis) - - getPosition(child, getLeading(axis)) - - getPosition(child, getTrailing(axis)) + getPosition(child, leading[axis]) - + getPosition(child, trailing[axis]) ), // You never want to go smaller than padding getPaddingAndBorderAxis(child, axis) - )); + ); } } for (ii = 0; ii < 2; ii++) { - axis = (ii != 0) ? CSSFlexDirection.ROW : CSSFlexDirection.COLUMN; - if (isPosDefined(child, getTrailing(axis)) && - !isPosDefined(child, getLeading(axis))) { - setLayoutPosition(child, getLeading(axis), getLayoutDimension(node, getDim(axis)) - - getLayoutDimension(child, getDim(axis)) - - getPosition(child, getTrailing(axis))); + axis = (ii != 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN; + if (isPosDefined(child, trailing[axis]) && + !isPosDefined(child, leading[axis])) { + child.layout.position[leading[axis]] = + node.layout.dimensions[dim[axis]] - + child.layout.dimensions[dim[axis]] - + getPosition(child, trailing[axis]); } } } diff --git a/src/java/tests/com/facebook/csslayout/LayoutEngineTest.java b/src/java/tests/com/facebook/csslayout/LayoutEngineTest.java index 2e4373b2..0610728f 100644 --- a/src/java/tests/com/facebook/csslayout/LayoutEngineTest.java +++ b/src/java/tests/com/facebook/csslayout/LayoutEngineTest.java @@ -11,6 +11,13 @@ package com.facebook.csslayout; import org.junit.Assert; import org.junit.Test; +import static com.facebook.csslayout.CSSLayout.POSITION_LEFT; +import static com.facebook.csslayout.CSSLayout.POSITION_TOP; +import static com.facebook.csslayout.CSSLayout.POSITION_RIGHT; +import static com.facebook.csslayout.CSSLayout.POSITION_BOTTOM; +import static com.facebook.csslayout.CSSLayout.DIMENSION_WIDTH; +import static com.facebook.csslayout.CSSLayout.DIMENSION_HEIGHT; + /** * Tests for {@link LayoutEngine} */ @@ -69,10 +76,10 @@ public class LayoutEngineTest { private static boolean areLayoutsEqual(CSSNode a, CSSNode b) { boolean doNodesHaveSameLayout = - areFloatsEqual(a.layout.left, b.layout.left) && - areFloatsEqual(a.layout.top, b.layout.top) && - areFloatsEqual(a.layout.width, b.layout.width) && - areFloatsEqual(a.layout.height, b.layout.height); + areFloatsEqual(a.layout.position[POSITION_LEFT], b.layout.position[POSITION_LEFT]) && + areFloatsEqual(a.layout.position[POSITION_TOP], b.layout.position[POSITION_TOP]) && + areFloatsEqual(a.layout.dimensions[DIMENSION_WIDTH], b.layout.dimensions[DIMENSION_WIDTH]) && + areFloatsEqual(a.layout.dimensions[DIMENSION_HEIGHT], b.layout.dimensions[DIMENSION_HEIGHT]); if (!doNodesHaveSameLayout) { return false; } @@ -95,17 +102,17 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 100; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 100; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; } test("should layout a single node with width and height", root_node, root_layout); @@ -117,48 +124,48 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 500; - node_1.style.height = 500; + node_1.style.dimensions[DIMENSION_WIDTH] = 500; + node_1.style.dimensions[DIMENSION_HEIGHT] = 500; node_1 = node_0.getChildAt(1); - node_1.style.width = 250; - node_1.style.height = 250; + node_1.style.dimensions[DIMENSION_WIDTH] = 250; + node_1.style.dimensions[DIMENSION_HEIGHT] = 250; node_1 = node_0.getChildAt(2); - node_1.style.width = 125; - node_1.style.height = 125; + node_1.style.dimensions[DIMENSION_WIDTH] = 125; + node_1.style.dimensions[DIMENSION_HEIGHT] = 125; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 500; - node_1.layout.height = 500; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 500; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 500; node_1 = node_0.getChildAt(1); - node_1.layout.top = 500; - node_1.layout.left = 0; - node_1.layout.width = 250; - node_1.layout.height = 250; + node_1.layout.position[POSITION_TOP] = 500; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 250; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 250; node_1 = node_0.getChildAt(2); - node_1.layout.top = 750; - node_1.layout.left = 0; - node_1.layout.width = 125; - node_1.layout.height = 125; + node_1.layout.position[POSITION_TOP] = 750; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 125; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 125; } } @@ -172,48 +179,48 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 500; - node_1.style.height = 500; + node_1.style.dimensions[DIMENSION_WIDTH] = 500; + node_1.style.dimensions[DIMENSION_HEIGHT] = 500; node_1 = node_0.getChildAt(1); - node_1.style.width = 250; - node_1.style.height = 250; + node_1.style.dimensions[DIMENSION_WIDTH] = 250; + node_1.style.dimensions[DIMENSION_HEIGHT] = 250; node_1 = node_0.getChildAt(2); - node_1.style.width = 125; - node_1.style.height = 125; + node_1.style.dimensions[DIMENSION_WIDTH] = 125; + node_1.style.dimensions[DIMENSION_HEIGHT] = 125; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 500; - node_1.layout.left = 0; - node_1.layout.width = 500; - node_1.layout.height = 500; + node_1.layout.position[POSITION_TOP] = 500; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 500; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 500; node_1 = node_0.getChildAt(1); - node_1.layout.top = 250; - node_1.layout.left = 0; - node_1.layout.width = 250; - node_1.layout.height = 250; + node_1.layout.position[POSITION_TOP] = 250; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 250; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 250; node_1 = node_0.getChildAt(2); - node_1.layout.top = 125; - node_1.layout.left = 0; - node_1.layout.width = 125; - node_1.layout.height = 125; + node_1.layout.position[POSITION_TOP] = 125; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 125; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 125; } } @@ -226,26 +233,26 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 500; - node_1.style.height = 500; + node_1.style.dimensions[DIMENSION_WIDTH] = 500; + node_1.style.dimensions[DIMENSION_HEIGHT] = 500; node_1 = node_0.getChildAt(1); - node_1.style.width = 500; - node_1.style.height = 500; + node_1.style.dimensions[DIMENSION_WIDTH] = 500; + node_1.style.dimensions[DIMENSION_HEIGHT] = 500; addChildren(node_1, 2); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.style.width = 250; - node_2.style.height = 250; + node_2.style.dimensions[DIMENSION_WIDTH] = 250; + node_2.style.dimensions[DIMENSION_HEIGHT] = 250; node_2 = node_1.getChildAt(1); - node_2.style.width = 250; - node_2.style.height = 250; + node_2.style.dimensions[DIMENSION_WIDTH] = 250; + node_2.style.dimensions[DIMENSION_HEIGHT] = 250; } } } @@ -253,36 +260,36 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 500; - node_1.layout.height = 500; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 500; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 500; node_1 = node_0.getChildAt(1); - node_1.layout.top = 500; - node_1.layout.left = 0; - node_1.layout.width = 500; - node_1.layout.height = 500; + node_1.layout.position[POSITION_TOP] = 500; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 500; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 500; addChildren(node_1, 2); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 0; - node_2.layout.left = 0; - node_2.layout.width = 250; - node_2.layout.height = 250; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 250; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 250; node_2 = node_1.getChildAt(1); - node_2.layout.top = 250; - node_2.layout.left = 0; - node_2.layout.width = 250; - node_2.layout.height = 250; + node_2.layout.position[POSITION_TOP] = 250; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 250; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 250; } } } @@ -297,27 +304,27 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 500; - node_1.style.height = 500; + node_1.style.dimensions[DIMENSION_WIDTH] = 500; + node_1.style.dimensions[DIMENSION_HEIGHT] = 500; node_1 = node_0.getChildAt(1); node_1.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; - node_1.style.width = 500; - node_1.style.height = 500; + node_1.style.dimensions[DIMENSION_WIDTH] = 500; + node_1.style.dimensions[DIMENSION_HEIGHT] = 500; addChildren(node_1, 2); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.style.width = 250; - node_2.style.height = 250; + node_2.style.dimensions[DIMENSION_WIDTH] = 250; + node_2.style.dimensions[DIMENSION_HEIGHT] = 250; node_2 = node_1.getChildAt(1); - node_2.style.width = 250; - node_2.style.height = 250; + node_2.style.dimensions[DIMENSION_WIDTH] = 250; + node_2.style.dimensions[DIMENSION_HEIGHT] = 250; } } } @@ -325,36 +332,36 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 500; - node_1.layout.left = 0; - node_1.layout.width = 500; - node_1.layout.height = 500; + node_1.layout.position[POSITION_TOP] = 500; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 500; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 500; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 500; - node_1.layout.height = 500; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 500; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 500; addChildren(node_1, 2); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 250; - node_2.layout.left = 0; - node_2.layout.width = 250; - node_2.layout.height = 250; + node_2.layout.position[POSITION_TOP] = 250; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 250; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 250; node_2 = node_1.getChildAt(1); - node_2.layout.top = 0; - node_2.layout.left = 0; - node_2.layout.width = 250; - node_2.layout.height = 250; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 250; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 250; } } } @@ -368,8 +375,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 100; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; node_0.setMargin(Spacing.LEFT, 10); node_0.setMargin(Spacing.TOP, 10); node_0.setMargin(Spacing.RIGHT, 10); @@ -381,10 +388,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 10; - node_0.layout.left = 10; - node_0.layout.width = 100; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 10; + node_0.layout.position[POSITION_LEFT] = 10; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; } test("should layout node with margin", root_node, root_layout); @@ -396,8 +403,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; node_0.setMargin(Spacing.LEFT, 10); node_0.setMargin(Spacing.TOP, 10); node_0.setMargin(Spacing.RIGHT, 10); @@ -408,8 +415,8 @@ public class LayoutEngineTest { { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.setMargin(Spacing.LEFT, 50); node_1.setMargin(Spacing.TOP, 50); node_1.setMargin(Spacing.RIGHT, 50); @@ -417,8 +424,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 50); node_1.setMargin(Spacing.END, 50); node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.setMargin(Spacing.LEFT, 25); node_1.setMargin(Spacing.TOP, 25); node_1.setMargin(Spacing.RIGHT, 25); @@ -426,8 +433,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 25); node_1.setMargin(Spacing.END, 25); node_1 = node_0.getChildAt(2); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -440,28 +447,28 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 10; - node_0.layout.left = 10; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 10; + node_0.layout.position[POSITION_LEFT] = 10; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 50; - node_1.layout.left = 50; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 50; + node_1.layout.position[POSITION_LEFT] = 50; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 225; - node_1.layout.left = 25; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 225; + node_1.layout.position[POSITION_LEFT] = 25; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(2); - node_1.layout.top = 360; - node_1.layout.left = 10; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 360; + node_1.layout.position[POSITION_LEFT] = 10; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -475,8 +482,8 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; node_0.setMargin(Spacing.LEFT, 10); node_0.setMargin(Spacing.TOP, 10); node_0.setMargin(Spacing.RIGHT, 10); @@ -487,8 +494,8 @@ public class LayoutEngineTest { { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.setMargin(Spacing.LEFT, 50); node_1.setMargin(Spacing.TOP, 50); node_1.setMargin(Spacing.RIGHT, 50); @@ -496,8 +503,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 50); node_1.setMargin(Spacing.END, 50); node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.setMargin(Spacing.LEFT, 25); node_1.setMargin(Spacing.TOP, 25); node_1.setMargin(Spacing.RIGHT, 25); @@ -505,8 +512,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 25); node_1.setMargin(Spacing.END, 25); node_1 = node_0.getChildAt(2); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -519,28 +526,28 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 10; - node_0.layout.left = 10; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 10; + node_0.layout.position[POSITION_LEFT] = 10; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 850; - node_1.layout.left = 50; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 850; + node_1.layout.position[POSITION_LEFT] = 50; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 675; - node_1.layout.left = 25; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 675; + node_1.layout.position[POSITION_LEFT] = 25; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(2); - node_1.layout.top = 540; - node_1.layout.left = 10; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 540; + node_1.layout.position[POSITION_LEFT] = 10; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -555,40 +562,40 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; node_0.style.flexDirection = CSSFlexDirection.ROW_REVERSE; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 200; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.style.width = 300; - node_1.style.height = 150; + node_1.style.dimensions[DIMENSION_WIDTH] = 300; + node_1.style.dimensions[DIMENSION_HEIGHT] = 150; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 100; - node_1.layout.width = 300; - node_1.layout.height = 150; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 100; + node_1.layout.dimensions[DIMENSION_WIDTH] = 300; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 150; } } @@ -602,40 +609,40 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 200; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.style.width = 300; - node_1.style.height = 150; + node_1.style.dimensions[DIMENSION_WIDTH] = 300; + node_1.style.dimensions[DIMENSION_HEIGHT] = 150; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 100; - node_1.layout.width = 300; - node_1.layout.height = 150; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 100; + node_1.layout.dimensions[DIMENSION_WIDTH] = 300; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 150; } } @@ -650,40 +657,40 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 200; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.style.width = 300; - node_1.style.height = 150; + node_1.style.dimensions[DIMENSION_WIDTH] = 300; + node_1.style.dimensions[DIMENSION_HEIGHT] = 150; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 900; - node_1.layout.width = 100; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 900; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 600; - node_1.layout.width = 300; - node_1.layout.height = 150; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 600; + node_1.layout.dimensions[DIMENSION_WIDTH] = 300; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 150; } } @@ -696,39 +703,39 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 300; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 200; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.style.width = 300; - node_1.style.height = 150; + node_1.style.dimensions[DIMENSION_WIDTH] = 300; + node_1.style.dimensions[DIMENSION_HEIGHT] = 150; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 350; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 350; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 200; - node_1.layout.left = 0; - node_1.layout.width = 300; - node_1.layout.height = 150; + node_1.layout.position[POSITION_TOP] = 200; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 300; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 150; } } @@ -742,39 +749,39 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; - node_0.style.width = 300; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 200; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.style.width = 300; - node_1.style.height = 150; + node_1.style.dimensions[DIMENSION_WIDTH] = 300; + node_1.style.dimensions[DIMENSION_HEIGHT] = 150; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 350; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 350; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 150; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 150; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 300; - node_1.layout.height = 150; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 300; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 150; } } @@ -787,40 +794,40 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 200; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); node_1.style.flex = 1; - node_1.style.width = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 200; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 800; + node_1.layout.position[POSITION_TOP] = 200; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 800; } } @@ -834,40 +841,40 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 200; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); node_1.style.flex = 1; - node_1.style.width = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 800; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 800; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 800; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 800; } } @@ -880,26 +887,26 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.flex = 1; - node_1.style.width = 1000; + node_1.style.dimensions[DIMENSION_WIDTH] = 1000; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); node_2.style.flex = 1; - node_2.style.width = 1000; + node_2.style.dimensions[DIMENSION_WIDTH] = 1000; addChildren(node_2, 1); { TestCSSNode node_3; node_3 = node_2.getChildAt(0); node_3.style.flex = 1; - node_3.style.width = 1000; + node_3.style.dimensions[DIMENSION_WIDTH] = 1000; } } } @@ -908,34 +915,34 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 1000; - node_1.layout.height = 1000; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 0; - node_2.layout.left = 0; - node_2.layout.width = 1000; - node_2.layout.height = 1000; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_2, 1); { TestCSSNode node_3; node_3 = node_2.getChildAt(0); - node_3.layout.top = 0; - node_3.layout.left = 0; - node_3.layout.width = 1000; - node_3.layout.height = 1000; + node_3.layout.position[POSITION_TOP] = 0; + node_3.layout.position[POSITION_LEFT] = 0; + node_3.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_3.layout.dimensions[DIMENSION_HEIGHT] = 1000; } } } @@ -951,29 +958,29 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_1.style.flex = 1; - node_1.style.width = 1000; + node_1.style.dimensions[DIMENSION_WIDTH] = 1000; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); node_2.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_2.style.flex = 1; - node_2.style.width = 1000; + node_2.style.dimensions[DIMENSION_WIDTH] = 1000; addChildren(node_2, 1); { TestCSSNode node_3; node_3 = node_2.getChildAt(0); node_3.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_3.style.flex = 1; - node_3.style.width = 1000; + node_3.style.dimensions[DIMENSION_WIDTH] = 1000; } } } @@ -982,34 +989,34 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 1000; - node_1.layout.height = 1000; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 0; - node_2.layout.left = 0; - node_2.layout.width = 1000; - node_2.layout.height = 1000; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_2, 1); { TestCSSNode node_3; node_3 = node_2.getChildAt(0); - node_3.layout.top = 0; - node_3.layout.left = 0; - node_3.layout.width = 1000; - node_3.layout.height = 1000; + node_3.layout.position[POSITION_TOP] = 0; + node_3.layout.position[POSITION_LEFT] = 0; + node_3.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_3.layout.dimensions[DIMENSION_HEIGHT] = 1000; } } } @@ -1024,22 +1031,22 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; node_0.setMargin(Spacing.LEFT, 5); node_0.setMargin(Spacing.TOP, 10); addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.setMargin(Spacing.LEFT, 15); node_1.setMargin(Spacing.TOP, 50); node_1.setMargin(Spacing.BOTTOM, 20); node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.setMargin(Spacing.LEFT, 30); } } @@ -1047,23 +1054,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 10; - node_0.layout.left = 5; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 10; + node_0.layout.position[POSITION_LEFT] = 5; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 50; - node_1.layout.left = 15; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 50; + node_1.layout.position[POSITION_LEFT] = 15; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 170; - node_1.layout.left = 30; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 170; + node_1.layout.position[POSITION_LEFT] = 30; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1077,22 +1084,22 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; node_0.setMargin(Spacing.LEFT, 5); node_0.setMargin(Spacing.TOP, 10); addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.setMargin(Spacing.LEFT, 15); node_1.setMargin(Spacing.TOP, 50); node_1.setMargin(Spacing.BOTTOM, 20); node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.setMargin(Spacing.LEFT, 30); } } @@ -1100,23 +1107,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 10; - node_0.layout.left = 5; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 10; + node_0.layout.position[POSITION_LEFT] = 5; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 880; - node_1.layout.left = 15; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 880; + node_1.layout.position[POSITION_LEFT] = 15; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 730; - node_1.layout.left = 30; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 730; + node_1.layout.position[POSITION_LEFT] = 30; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1130,40 +1137,40 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.justifyContent = CSSJustify.FLEX_START; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 100; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1178,40 +1185,40 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.justifyContent = CSSJustify.FLEX_START; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 900; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 900; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 800; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 800; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1225,40 +1232,40 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.justifyContent = CSSJustify.FLEX_END; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 800; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 800; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 900; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 900; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1273,40 +1280,40 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.justifyContent = CSSJustify.FLEX_END; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 100; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1320,40 +1327,40 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.justifyContent = CSSJustify.SPACE_BETWEEN; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 900; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 900; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1368,40 +1375,40 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.justifyContent = CSSJustify.SPACE_BETWEEN; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 900; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 900; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1415,40 +1422,40 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.justifyContent = CSSJustify.SPACE_AROUND; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 200; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 200; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 700; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 700; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1463,40 +1470,40 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.justifyContent = CSSJustify.SPACE_AROUND; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 700; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 700; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 200; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 200; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1510,40 +1517,40 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.justifyContent = CSSJustify.CENTER; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 400; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 400; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 500; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 500; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1558,40 +1565,40 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.justifyContent = CSSJustify.CENTER; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 500; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 500; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 400; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 400; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1604,33 +1611,33 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.flex = 1; - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 1000; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000; } } @@ -1644,40 +1651,40 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.alignItems = CSSAlign.FLEX_START; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 200; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 100; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1692,40 +1699,40 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.alignItems = CSSAlign.FLEX_START; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 200; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 900; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 900; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 800; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 800; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1739,40 +1746,40 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.alignItems = CSSAlign.CENTER; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 200; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 400; - node_1.layout.width = 200; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 400; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 100; - node_1.layout.left = 450; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 450; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1787,40 +1794,40 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.alignItems = CSSAlign.CENTER; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 200; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 900; - node_1.layout.left = 400; - node_1.layout.width = 200; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 900; + node_1.layout.position[POSITION_LEFT] = 400; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 800; - node_1.layout.left = 450; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 800; + node_1.layout.position[POSITION_LEFT] = 450; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1834,40 +1841,40 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.alignItems = CSSAlign.FLEX_END; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 200; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 800; - node_1.layout.width = 200; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 800; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 100; - node_1.layout.left = 900; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 900; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1882,40 +1889,40 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.alignItems = CSSAlign.FLEX_END; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 200; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 900; - node_1.layout.left = 800; - node_1.layout.width = 200; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 900; + node_1.layout.position[POSITION_LEFT] = 800; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 800; - node_1.layout.left = 900; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 800; + node_1.layout.position[POSITION_LEFT] = 900; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1929,41 +1936,41 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.alignItems = CSSAlign.FLEX_END; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 200; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); node_1.style.alignSelf = CSSAlign.CENTER; - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 800; - node_1.layout.width = 200; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 800; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 100; - node_1.layout.left = 450; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 450; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -1978,41 +1985,41 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.alignItems = CSSAlign.FLEX_END; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 200; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); node_1.style.alignSelf = CSSAlign.CENTER; - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 900; - node_1.layout.left = 800; - node_1.layout.width = 200; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 900; + node_1.layout.position[POSITION_LEFT] = 800; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 800; - node_1.layout.left = 450; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 800; + node_1.layout.position[POSITION_LEFT] = 450; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -2026,31 +2033,31 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.alignItems = CSSAlign.STRETCH; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 1000; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -2065,31 +2072,31 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.alignItems = CSSAlign.STRETCH; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 900; - node_1.layout.left = 0; - node_1.layout.width = 1000; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 900; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -2112,18 +2119,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -2147,18 +2154,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -2187,18 +2194,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 10; - node_0.layout.height = 10; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 10; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 10; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 5; - node_1.layout.left = 5; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 5; + node_1.layout.position[POSITION_LEFT] = 5; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -2228,18 +2235,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 10; - node_0.layout.height = 10; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 10; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 10; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 5; - node_1.layout.left = 5; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 5; + node_1.layout.position[POSITION_LEFT] = 5; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -2252,37 +2259,37 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.height = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.height = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 200; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 100; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -2296,37 +2303,37 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; - node_0.style.height = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.height = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 200; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = -200; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = -200; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -2345,10 +2352,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; } test("should layout for center", root_node, root_layout); @@ -2361,7 +2368,7 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.justifyContent = CSSJustify.FLEX_END; - node_0.style.height = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 1); { TestCSSNode node_1; @@ -2373,18 +2380,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 100; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -2399,7 +2406,7 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.justifyContent = CSSJustify.FLEX_END; - node_0.style.height = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 1); { TestCSSNode node_1; @@ -2411,18 +2418,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 10; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 10; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -2451,7 +2458,7 @@ public class LayoutEngineTest { node_2.setMargin(Spacing.START, 10); node_2.setMargin(Spacing.END, 10); node_2 = node_1.getChildAt(1); - node_2.style.height = 100; + node_2.style.dimensions[DIMENSION_HEIGHT] = 100; } } } @@ -2459,31 +2466,31 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 20; - node_0.layout.height = 120; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 20; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 120; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 20; - node_1.layout.height = 120; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 20; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 120; addChildren(node_1, 2); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 10; - node_2.layout.left = 10; - node_2.layout.width = 0; - node_2.layout.height = 0; + node_2.layout.position[POSITION_TOP] = 10; + node_2.layout.position[POSITION_LEFT] = 10; + node_2.layout.dimensions[DIMENSION_WIDTH] = 0; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 0; node_2 = node_1.getChildAt(1); - node_2.layout.top = 20; - node_2.layout.left = 20; - node_2.layout.width = 0; - node_2.layout.height = 100; + node_2.layout.position[POSITION_TOP] = 20; + node_2.layout.position[POSITION_LEFT] = 20; + node_2.layout.dimensions[DIMENSION_WIDTH] = 0; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 100; } } } @@ -2514,7 +2521,7 @@ public class LayoutEngineTest { node_2.setMargin(Spacing.START, 10); node_2.setMargin(Spacing.END, 10); node_2 = node_1.getChildAt(1); - node_2.style.height = 100; + node_2.style.dimensions[DIMENSION_HEIGHT] = 100; } } } @@ -2522,31 +2529,31 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 20; - node_0.layout.height = 120; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 20; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 120; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 20; - node_1.layout.height = 120; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 20; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 120; addChildren(node_1, 2); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 110; - node_2.layout.left = 10; - node_2.layout.width = 0; - node_2.layout.height = 0; + node_2.layout.position[POSITION_TOP] = 110; + node_2.layout.position[POSITION_LEFT] = 10; + node_2.layout.dimensions[DIMENSION_WIDTH] = 0; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 0; node_2 = node_1.getChildAt(1); - node_2.layout.top = 0; - node_2.layout.left = 20; - node_2.layout.width = 0; - node_2.layout.height = 100; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 20; + node_2.layout.dimensions[DIMENSION_WIDTH] = 0; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 100; } } } @@ -2571,18 +2578,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -2607,18 +2614,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 10; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 10; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 10; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 10; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -2644,18 +2651,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 10; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 10; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 10; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 10; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -2679,10 +2686,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 10; - node_0.layout.height = 10; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 10; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 10; } test("should layout node with padding", root_node, root_layout); @@ -2710,18 +2717,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 10; - node_0.layout.height = 10; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 10; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 10; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 5; - node_1.layout.left = 5; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 5; + node_1.layout.position[POSITION_LEFT] = 5; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -2756,18 +2763,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 20; - node_0.layout.height = 20; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 20; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 20; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 10; - node_1.layout.left = 10; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 10; + node_1.layout.position[POSITION_LEFT] = 10; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -2797,18 +2804,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 20; - node_0.layout.height = 20; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 20; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 20; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 20; - node_1.layout.height = 20; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 20; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 20; } } @@ -2844,18 +2851,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 120; - node_0.layout.height = 120; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 120; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 120; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 50; - node_1.layout.left = 50; - node_1.layout.width = 20; - node_1.layout.height = 20; + node_1.layout.position[POSITION_TOP] = 50; + node_1.layout.position[POSITION_LEFT] = 50; + node_1.layout.dimensions[DIMENSION_WIDTH] = 20; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 20; } } @@ -2890,26 +2897,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 32; - node_0.layout.height = 32; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 32; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 32; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 32; - node_1.layout.height = 32; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 32; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 32; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 16; - node_2.layout.left = 16; - node_2.layout.width = 0; - node_2.layout.height = 0; + node_2.layout.position[POSITION_TOP] = 16; + node_2.layout.position[POSITION_LEFT] = 16; + node_2.layout.dimensions[DIMENSION_WIDTH] = 0; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 0; } } } @@ -2923,17 +2930,17 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.positionLeft = 5; - node_0.style.positionTop = 5; + node_0.style.position[POSITION_LEFT] = 5; + node_0.style.position[POSITION_TOP] = 5; } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 5; - node_0.layout.left = 5; - node_0.layout.width = 0; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 5; + node_0.layout.position[POSITION_LEFT] = 5; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; } test("should layout node with top and left", root_node, root_layout); @@ -2946,7 +2953,7 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.justifyContent = CSSJustify.SPACE_AROUND; - node_0.style.height = 10; + node_0.style.dimensions[DIMENSION_HEIGHT] = 10; node_0.setPadding(Spacing.TOP, 5); addChildren(node_0, 1); { @@ -2958,18 +2965,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 10; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 10; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 7.5f; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 7.5f; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -2982,16 +2989,16 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.positionBottom = 5; + node_0.style.position[POSITION_BOTTOM] = 5; } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = -5; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = -5; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; } test("should layout node with bottom", root_node, root_layout); @@ -3003,17 +3010,17 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.positionTop = 10; - node_0.style.positionBottom = 5; + node_0.style.position[POSITION_TOP] = 10; + node_0.style.position[POSITION_BOTTOM] = 5; } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 10; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 10; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; } test("should layout node with both top and bottom", root_node, root_layout); @@ -3026,7 +3033,7 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 500; + node_0.style.dimensions[DIMENSION_WIDTH] = 500; addChildren(node_0, 3); { TestCSSNode node_1; @@ -3034,7 +3041,7 @@ public class LayoutEngineTest { node_1.style.flex = 1; node_1 = node_0.getChildAt(1); node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.width = 50; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; node_1 = node_0.getChildAt(2); node_1.style.flex = 1; } @@ -3043,28 +3050,28 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 500; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 500; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 250; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 250; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 250; - node_1.layout.width = 50; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 250; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; node_1 = node_0.getChildAt(2); - node_1.layout.top = 0; - node_1.layout.left = 250; - node_1.layout.width = 250; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 250; + node_1.layout.dimensions[DIMENSION_WIDTH] = 250; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3089,18 +3096,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3126,18 +3133,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 12; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 12; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3150,17 +3157,17 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.height = 5; + node_0.style.dimensions[DIMENSION_HEIGHT] = 5; node_0.setPadding(Spacing.BOTTOM, 20); } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 20; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 20; } test("should work with height smaller than paddingBottom", root_node, root_layout); @@ -3172,17 +3179,17 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 5; + node_0.style.dimensions[DIMENSION_WIDTH] = 5; node_0.setPadding(Spacing.LEFT, 20); } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 20; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 20; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; } test("should work with width smaller than paddingLeft", root_node, root_layout); @@ -3202,43 +3209,43 @@ public class LayoutEngineTest { { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.style.width = 400; + node_2.style.dimensions[DIMENSION_WIDTH] = 400; } node_1 = node_0.getChildAt(1); node_1.style.alignSelf = CSSAlign.STRETCH; - node_1.style.width = 200; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 400; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 400; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 400; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 400; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 0; - node_2.layout.left = 0; - node_2.layout.width = 400; - node_2.layout.height = 0; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 400; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 0; } node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3268,18 +3275,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 10; - node_0.layout.height = 10; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 10; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 10; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 5; - node_1.layout.left = 5; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 5; + node_1.layout.position[POSITION_LEFT] = 5; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3296,34 +3303,34 @@ public class LayoutEngineTest { { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.positionLeft = 10; - node_1.style.positionTop = 10; + node_1.style.position[POSITION_LEFT] = 10; + node_1.style.position[POSITION_TOP] = 10; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 10; - node_1.layout.left = 10; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 10; + node_1.layout.position[POSITION_LEFT] = 10; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3347,25 +3354,25 @@ public class LayoutEngineTest { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.positionLeft = 5; + node_1.style.position[POSITION_LEFT] = 5; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 40; - node_0.layout.height = 40; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 40; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 40; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 20; - node_1.layout.left = 5; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 20; + node_1.layout.position[POSITION_LEFT] = 5; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3384,25 +3391,25 @@ public class LayoutEngineTest { node_1 = node_0.getChildAt(0); node_1.style.positionType = CSSPositionType.ABSOLUTE; node_1.setMargin(Spacing.TOP, 5); - node_1.style.positionTop = 5; + node_1.style.position[POSITION_TOP] = 5; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 10; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 10; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3421,25 +3428,25 @@ public class LayoutEngineTest { node_1 = node_0.getChildAt(0); node_1.style.positionType = CSSPositionType.ABSOLUTE; node_1.setMargin(Spacing.LEFT, 5); - node_1.style.positionLeft = 5; + node_1.style.position[POSITION_LEFT] = 5; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 10; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 10; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3453,7 +3460,7 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.justifyContent = CSSJustify.SPACE_AROUND; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 2); { TestCSSNode node_1; @@ -3466,23 +3473,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 100; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; node_1 = node_0.getChildAt(1); - node_1.layout.top = 100; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3497,7 +3504,7 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.justifyContent = CSSJustify.SPACE_AROUND; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 2); { TestCSSNode node_1; @@ -3510,23 +3517,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 100; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; node_1 = node_0.getChildAt(1); - node_1.layout.top = 100; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3540,7 +3547,7 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 700; + node_0.style.dimensions[DIMENSION_WIDTH] = 700; addChildren(node_0, 1); { TestCSSNode node_1; @@ -3553,18 +3560,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 700; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 700; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 5; - node_1.layout.width = 695; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 5; + node_1.layout.dimensions[DIMENSION_WIDTH] = 695; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3579,7 +3586,7 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 700; + node_0.style.dimensions[DIMENSION_WIDTH] = 700; addChildren(node_0, 1); { TestCSSNode node_1; @@ -3592,18 +3599,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 700; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 700; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 695; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 695; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3617,7 +3624,7 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 700; + node_0.style.dimensions[DIMENSION_WIDTH] = 700; addChildren(node_0, 2); { TestCSSNode node_1; @@ -3632,23 +3639,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 700; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 700; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 347.5f; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 347.5f; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 347.5f; - node_1.layout.width = 352.5f; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 347.5f; + node_1.layout.dimensions[DIMENSION_WIDTH] = 352.5f; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3663,7 +3670,7 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 700; + node_0.style.dimensions[DIMENSION_WIDTH] = 700; addChildren(node_0, 2); { TestCSSNode node_1; @@ -3678,23 +3685,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 700; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 700; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 352.5f; - node_1.layout.width = 347.5f; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 352.5f; + node_1.layout.dimensions[DIMENSION_WIDTH] = 347.5f; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 352.5f; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 352.5f; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3708,7 +3715,7 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 700; + node_0.style.dimensions[DIMENSION_WIDTH] = 700; addChildren(node_0, 2); { TestCSSNode node_1; @@ -3723,23 +3730,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 700; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 700; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 347.5f; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 347.5f; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 352.5f; - node_1.layout.width = 347.5f; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 352.5f; + node_1.layout.dimensions[DIMENSION_WIDTH] = 347.5f; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3754,7 +3761,7 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 700; + node_0.style.dimensions[DIMENSION_WIDTH] = 700; addChildren(node_0, 2); { TestCSSNode node_1; @@ -3769,23 +3776,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 700; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 700; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 352.5f; - node_1.layout.width = 347.5f; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 352.5f; + node_1.layout.dimensions[DIMENSION_WIDTH] = 347.5f; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 347.5f; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 347.5f; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3798,12 +3805,12 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.height = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 300; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 600; + node_1.style.dimensions[DIMENSION_HEIGHT] = 600; node_1 = node_0.getChildAt(1); node_1.style.flex = 1; } @@ -3812,23 +3819,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 300; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 300; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 600; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 600; node_1 = node_0.getChildAt(1); - node_1.layout.top = 600; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 600; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3842,7 +3849,7 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 600; + node_0.style.dimensions[DIMENSION_WIDTH] = 600; addChildren(node_0, 1); { TestCSSNode node_1; @@ -3855,18 +3862,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 600; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 600; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3881,7 +3888,7 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 600; + node_0.style.dimensions[DIMENSION_WIDTH] = 600; addChildren(node_0, 1); { TestCSSNode node_1; @@ -3894,18 +3901,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 600; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 600; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 600; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 600; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3918,7 +3925,7 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.height = 500; + node_0.style.dimensions[DIMENSION_HEIGHT] = 500; addChildren(node_0, 2); { TestCSSNode node_1; @@ -3933,23 +3940,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 500; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 500; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 500; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 500; node_1 = node_0.getChildAt(1); - node_1.layout.top = 500; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 500; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -3973,10 +3980,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 10; - node_0.layout.height = 10; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 10; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 10; } test("should layout node with borderWidth", root_node, root_layout); @@ -3994,25 +4001,25 @@ public class LayoutEngineTest { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.positionTop = -1; + node_1.style.position[POSITION_TOP] = -1; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 1; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -4036,25 +4043,25 @@ public class LayoutEngineTest { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.positionLeft = 5; + node_1.style.position[POSITION_LEFT] = 5; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 2; - node_0.layout.height = 2; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 2; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 2; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 1; - node_1.layout.left = 6; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 1; + node_1.layout.position[POSITION_LEFT] = 6; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -4067,7 +4074,7 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 50; + node_0.style.dimensions[DIMENSION_WIDTH] = 50; addChildren(node_0, 1); { TestCSSNode node_1; @@ -4086,18 +4093,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 50; - node_0.layout.height = 40; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 50; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 40; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 20; - node_1.layout.width = 40; - node_1.layout.height = 40; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 20; + node_1.layout.dimensions[DIMENSION_WIDTH] = 40; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 40; } } @@ -4110,7 +4117,7 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = -31; + node_0.style.dimensions[DIMENSION_WIDTH] = -31; addChildren(node_0, 1); { TestCSSNode node_1; @@ -4122,18 +4129,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 5; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 5; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 5; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 5; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -4159,18 +4166,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -4197,18 +4204,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 1; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 1; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -4228,10 +4235,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 35; - node_0.layout.height = 18; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 35; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 18; } test("should layout node with just text", root_node, root_layout); @@ -4243,7 +4250,7 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 10; + node_0.style.dimensions[DIMENSION_WIDTH] = 10; node_0.setMeasureFunction(sTestMeasureFunction); node_0.context = "small"; } @@ -4251,10 +4258,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 10; - node_0.layout.height = 18; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 10; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 18; } test("should layout node with text and width", root_node, root_layout); @@ -4273,10 +4280,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 172; - node_0.layout.height = 18; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 172; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 18; } test("should layout node with text, padding and margin", root_node, root_layout); @@ -4288,7 +4295,7 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 300; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; addChildren(node_0, 1); { TestCSSNode node_1; @@ -4306,26 +4313,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 300; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 300; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 0; - node_2.layout.left = 0; - node_2.layout.width = 300; - node_2.layout.height = 0; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 300; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 0; } } } @@ -4344,7 +4351,7 @@ public class LayoutEngineTest { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.flexDirection = CSSFlexDirection.ROW; - node_1.style.width = 500; + node_1.style.dimensions[DIMENSION_WIDTH] = 500; addChildren(node_1, 1); { TestCSSNode node_2; @@ -4359,26 +4366,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 500; - node_0.layout.height = 18; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 500; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 18; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 500; - node_1.layout.height = 18; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 500; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 18; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 0; - node_2.layout.left = 0; - node_2.layout.width = 500; - node_2.layout.height = 18; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 500; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 18; } } } @@ -4398,7 +4405,7 @@ public class LayoutEngineTest { node_1 = node_0.getChildAt(0); node_1.style.direction = CSSDirection.RTL; node_1.style.flexDirection = CSSFlexDirection.ROW; - node_1.style.width = 500; + node_1.style.dimensions[DIMENSION_WIDTH] = 500; addChildren(node_1, 1); { TestCSSNode node_2; @@ -4413,26 +4420,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 500; - node_0.layout.height = 18; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 500; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 18; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 500; - node_1.layout.height = 18; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 500; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 18; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 0; - node_2.layout.left = 0; - node_2.layout.width = 500; - node_2.layout.height = 18; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 500; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 18; } } } @@ -4446,7 +4453,7 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 130; + node_0.style.dimensions[DIMENSION_WIDTH] = 130; addChildren(node_0, 1); { TestCSSNode node_1; @@ -4466,26 +4473,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 130; - node_0.layout.height = 36; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 130; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 36; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 130; - node_1.layout.height = 36; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 130; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 36; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 0; - node_2.layout.left = 0; - node_2.layout.width = 130; - node_2.layout.height = 36; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 130; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 36; } } } @@ -4499,7 +4506,7 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 200; addChildren(node_0, 1); { TestCSSNode node_1; @@ -4510,7 +4517,7 @@ public class LayoutEngineTest { { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.style.width = 130; + node_2.style.dimensions[DIMENSION_WIDTH] = 130; node_2.setMeasureFunction(sTestMeasureFunction); node_2.context = "loooooooooong with space"; } @@ -4520,26 +4527,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 36; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 36; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 36; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 36; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 0; - node_2.layout.left = 0; - node_2.layout.width = 130; - node_2.layout.height = 36; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 130; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 36; } } } @@ -4554,7 +4561,7 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.alignSelf = CSSAlign.FLEX_START; - node_0.style.width = 100; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; addChildren(node_0, 1); { TestCSSNode node_1; @@ -4568,18 +4575,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 100; - node_0.layout.height = 36; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 36; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 36; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 36; } } @@ -4593,7 +4600,7 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.alignSelf = CSSAlign.FLEX_START; - node_0.style.width = 100; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; node_0.setPadding(Spacing.LEFT, 10); node_0.setPadding(Spacing.TOP, 10); node_0.setPadding(Spacing.RIGHT, 10); @@ -4624,26 +4631,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 100; - node_0.layout.height = 76; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 76; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 20; - node_1.layout.left = 20; - node_1.layout.width = 100; - node_1.layout.height = 36; + node_1.layout.position[POSITION_TOP] = 20; + node_1.layout.position[POSITION_LEFT] = 20; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 36; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 0; - node_2.layout.left = 0; - node_2.layout.width = 100; - node_2.layout.height = 36; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 100; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 36; } } } @@ -4658,12 +4665,12 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.justifyContent = CSSJustify.SPACE_BETWEEN; - node_0.style.height = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 900; + node_1.style.dimensions[DIMENSION_HEIGHT] = 900; node_1 = node_0.getChildAt(1); } } @@ -4671,23 +4678,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 900; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 900; node_1 = node_0.getChildAt(1); - node_1.layout.top = 900; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 900; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -4702,12 +4709,12 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.justifyContent = CSSJustify.SPACE_BETWEEN; - node_0.style.height = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 900; + node_1.style.dimensions[DIMENSION_HEIGHT] = 900; node_1 = node_0.getChildAt(1); } } @@ -4715,23 +4722,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = -800; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 900; + node_1.layout.position[POSITION_TOP] = -800; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 900; node_1 = node_0.getChildAt(1); - node_1.layout.top = -800; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = -800; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -4746,30 +4753,30 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.ROW; node_0.style.justifyContent = CSSJustify.FLEX_END; - node_0.style.width = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 200; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 900; + node_1.style.dimensions[DIMENSION_WIDTH] = 900; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = -700; - node_1.layout.width = 900; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = -700; + node_1.layout.dimensions[DIMENSION_WIDTH] = 900; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -4785,30 +4792,30 @@ public class LayoutEngineTest { node_0.style.direction = CSSDirection.RTL; node_0.style.flexDirection = CSSFlexDirection.ROW; node_0.style.justifyContent = CSSJustify.FLEX_END; - node_0.style.width = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 200; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 900; + node_1.style.dimensions[DIMENSION_WIDTH] = 900; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 900; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 900; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -4826,7 +4833,7 @@ public class LayoutEngineTest { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.flexDirection = CSSFlexDirection.ROW; - node_1.style.width = 200; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; addChildren(node_1, 1); { TestCSSNode node_2; @@ -4846,26 +4853,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 58; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 58; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 58; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 58; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 20; - node_2.layout.left = 20; - node_2.layout.width = 172; - node_2.layout.height = 18; + node_2.layout.position[POSITION_TOP] = 20; + node_2.layout.position[POSITION_LEFT] = 20; + node_2.layout.dimensions[DIMENSION_WIDTH] = 172; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 18; } } } @@ -4885,7 +4892,7 @@ public class LayoutEngineTest { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.flexDirection = CSSFlexDirection.ROW; - node_1.style.width = 200; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; addChildren(node_1, 1); { TestCSSNode node_2; @@ -4905,26 +4912,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 58; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 58; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 58; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 58; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 20; - node_2.layout.left = 8; - node_2.layout.width = 172; - node_2.layout.height = 18; + node_2.layout.position[POSITION_TOP] = 20; + node_2.layout.position[POSITION_LEFT] = 8; + node_2.layout.dimensions[DIMENSION_WIDTH] = 172; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 18; } } } @@ -4942,7 +4949,7 @@ public class LayoutEngineTest { { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 200; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; addChildren(node_1, 1); { TestCSSNode node_2; @@ -4962,26 +4969,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 76; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 76; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 76; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 76; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 20; - node_2.layout.left = 20; - node_2.layout.width = 160; - node_2.layout.height = 36; + node_2.layout.position[POSITION_TOP] = 20; + node_2.layout.position[POSITION_LEFT] = 20; + node_2.layout.dimensions[DIMENSION_WIDTH] = 160; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 36; } } } @@ -4995,35 +5002,35 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 100; - node_0.style.height = 100; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.positionLeft = 0; - node_1.style.positionTop = 0; - node_1.style.positionRight = 0; - node_1.style.positionBottom = 0; + node_1.style.position[POSITION_LEFT] = 0; + node_1.style.position[POSITION_TOP] = 0; + node_1.style.position[POSITION_RIGHT] = 0; + node_1.style.position[POSITION_BOTTOM] = 0; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 100; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -5037,8 +5044,8 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.alignSelf = CSSAlign.FLEX_START; - node_0.style.width = 100; - node_0.style.height = 100; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; @@ -5054,23 +5061,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 100; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 25; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 25; node_1 = node_0.getChildAt(1); - node_1.layout.top = 25; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 75; + node_1.layout.position[POSITION_TOP] = 25; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 75; } } @@ -5085,8 +5092,8 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.alignSelf = CSSAlign.FLEX_START; - node_0.style.width = 100; - node_0.style.height = 100; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; @@ -5102,23 +5109,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 100; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 75; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 25; + node_1.layout.position[POSITION_TOP] = 75; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 25; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 75; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 75; } } @@ -5133,8 +5140,8 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.COLUMN_REVERSE; node_0.style.alignSelf = CSSAlign.FLEX_START; - node_0.style.width = 100; - node_0.style.height = 100; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; @@ -5150,23 +5157,23 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 100; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 100; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; node_1 = node_0.getChildAt(1); - node_1.layout.top = 100; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -5183,35 +5190,35 @@ public class LayoutEngineTest { { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 50; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.positionLeft = 0; - node_1.style.positionRight = 0; + node_1.style.position[POSITION_LEFT] = 0; + node_1.style.position[POSITION_RIGHT] = 0; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 50; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 50; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 50; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 100; - node_1.layout.left = 0; - node_1.layout.width = 50; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -5224,32 +5231,32 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.height = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.positionTop = 0; - node_1.style.positionBottom = 20; + node_1.style.position[POSITION_TOP] = 0; + node_1.style.position[POSITION_BOTTOM] = 20; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 80; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 80; } } @@ -5262,24 +5269,24 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 200; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 200; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.justifyContent = CSSJustify.CENTER; node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.positionLeft = 0; - node_1.style.positionTop = 0; - node_1.style.positionRight = 0; - node_1.style.positionBottom = 0; + node_1.style.position[POSITION_LEFT] = 0; + node_1.style.position[POSITION_TOP] = 0; + node_1.style.position[POSITION_RIGHT] = 0; + node_1.style.position[POSITION_BOTTOM] = 0; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.style.width = 100; - node_2.style.height = 100; + node_2.style.dimensions[DIMENSION_WIDTH] = 100; + node_2.style.dimensions[DIMENSION_HEIGHT] = 100; } } } @@ -5287,26 +5294,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 50; - node_2.layout.left = 0; - node_2.layout.width = 100; - node_2.layout.height = 100; + node_2.layout.position[POSITION_TOP] = 50; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 100; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 100; } } } @@ -5320,31 +5327,31 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.height = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.positionBottom = 0; + node_1.style.position[POSITION_BOTTOM] = 0; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 100; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -5357,31 +5364,31 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 100; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.positionRight = 0; + node_1.style.position[POSITION_RIGHT] = 0; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 100; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 100; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 100; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -5394,32 +5401,32 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.height = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.height = 10; - node_1.style.positionBottom = 0; + node_1.style.dimensions[DIMENSION_HEIGHT] = 10; + node_1.style.position[POSITION_BOTTOM] = 0; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 90; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 10; + node_1.layout.position[POSITION_TOP] = 90; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 10; } } @@ -5432,32 +5439,32 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 100; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.width = 10; - node_1.style.positionRight = 0; + node_1.style.dimensions[DIMENSION_WIDTH] = 10; + node_1.style.position[POSITION_RIGHT] = 0; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 100; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 90; - node_1.layout.width = 10; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 90; + node_1.layout.dimensions[DIMENSION_WIDTH] = 10; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -5475,26 +5482,26 @@ public class LayoutEngineTest { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.height = 10; - node_1.style.positionBottom = 0; + node_1.style.dimensions[DIMENSION_HEIGHT] = 10; + node_1.style.position[POSITION_BOTTOM] = 0; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = -10; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 10; + node_1.layout.position[POSITION_TOP] = -10; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 10; } } @@ -5512,26 +5519,26 @@ public class LayoutEngineTest { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.positionType = CSSPositionType.ABSOLUTE; - node_1.style.width = 10; - node_1.style.positionRight = 0; + node_1.style.dimensions[DIMENSION_WIDTH] = 10; + node_1.style.position[POSITION_RIGHT] = 0; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = -10; - node_1.layout.width = 10; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = -10; + node_1.layout.dimensions[DIMENSION_WIDTH] = 10; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -5556,18 +5563,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 1; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 1; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 1; } } @@ -5592,18 +5599,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = -3; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = -3; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -5628,18 +5635,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 20; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 20; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 20; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 20; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -5664,18 +5671,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 5; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 5; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; } } @@ -5688,12 +5695,12 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 800; + node_0.style.dimensions[DIMENSION_WIDTH] = 800; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.positionLeft = 5; + node_1.style.position[POSITION_LEFT] = 5; addChildren(node_1, 1); { TestCSSNode node_2; @@ -5705,26 +5712,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 800; - node_0.layout.height = 0; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 800; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 5; - node_1.layout.width = 800; - node_1.layout.height = 0; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 5; + node_1.layout.dimensions[DIMENSION_WIDTH] = 800; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 0; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 0; - node_2.layout.left = 0; - node_2.layout.width = 800; - node_2.layout.height = 0; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 800; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 0; } } } @@ -5740,47 +5747,47 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.ROW; node_0.style.flexWrap = CSSWrap.WRAP; - node_0.style.width = 100; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 40; - node_1.style.height = 10; + node_1.style.dimensions[DIMENSION_WIDTH] = 40; + node_1.style.dimensions[DIMENSION_HEIGHT] = 10; node_1 = node_0.getChildAt(1); - node_1.style.width = 40; - node_1.style.height = 10; + node_1.style.dimensions[DIMENSION_WIDTH] = 40; + node_1.style.dimensions[DIMENSION_HEIGHT] = 10; node_1 = node_0.getChildAt(2); - node_1.style.width = 40; - node_1.style.height = 10; + node_1.style.dimensions[DIMENSION_WIDTH] = 40; + node_1.style.dimensions[DIMENSION_HEIGHT] = 10; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 100; - node_0.layout.height = 20; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 20; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 40; - node_1.layout.height = 10; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 40; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 10; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 40; - node_1.layout.width = 40; - node_1.layout.height = 10; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 40; + node_1.layout.dimensions[DIMENSION_WIDTH] = 40; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 10; node_1 = node_0.getChildAt(2); - node_1.layout.top = 10; - node_1.layout.left = 0; - node_1.layout.width = 40; - node_1.layout.height = 10; + node_1.layout.position[POSITION_TOP] = 10; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 40; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 10; } } @@ -5796,47 +5803,47 @@ public class LayoutEngineTest { node_0.style.direction = CSSDirection.RTL; node_0.style.flexDirection = CSSFlexDirection.ROW; node_0.style.flexWrap = CSSWrap.WRAP; - node_0.style.width = 100; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 40; - node_1.style.height = 10; + node_1.style.dimensions[DIMENSION_WIDTH] = 40; + node_1.style.dimensions[DIMENSION_HEIGHT] = 10; node_1 = node_0.getChildAt(1); - node_1.style.width = 40; - node_1.style.height = 10; + node_1.style.dimensions[DIMENSION_WIDTH] = 40; + node_1.style.dimensions[DIMENSION_HEIGHT] = 10; node_1 = node_0.getChildAt(2); - node_1.style.width = 40; - node_1.style.height = 10; + node_1.style.dimensions[DIMENSION_WIDTH] = 40; + node_1.style.dimensions[DIMENSION_HEIGHT] = 10; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 100; - node_0.layout.height = 20; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 20; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 60; - node_1.layout.width = 40; - node_1.layout.height = 10; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 60; + node_1.layout.dimensions[DIMENSION_WIDTH] = 40; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 10; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 20; - node_1.layout.width = 40; - node_1.layout.height = 10; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 20; + node_1.layout.dimensions[DIMENSION_WIDTH] = 40; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 10; node_1 = node_0.getChildAt(2); - node_1.layout.top = 10; - node_1.layout.left = 60; - node_1.layout.width = 40; - node_1.layout.height = 10; + node_1.layout.position[POSITION_TOP] = 10; + node_1.layout.position[POSITION_LEFT] = 60; + node_1.layout.dimensions[DIMENSION_WIDTH] = 40; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 10; } } @@ -5850,37 +5857,37 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexWrap = CSSWrap.WRAP; - node_0.style.height = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.height = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 200; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 0; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 0; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 0; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 0; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -5893,8 +5900,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 100; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; node_0.style.maxWidth = 90; node_0.style.maxHeight = 190; } @@ -5902,10 +5909,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 90; - node_0.layout.height = 190; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 90; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 190; } test("should use max bounds", root_node, root_layout); @@ -5917,8 +5924,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 100; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; node_0.style.minWidth = 110; node_0.style.minHeight = 210; } @@ -5926,10 +5933,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 110; - node_0.layout.height = 210; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 110; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 210; } test("should use min bounds", root_node, root_layout); @@ -5941,8 +5948,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 100; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; node_0.style.maxWidth = 90; node_0.style.maxHeight = 190; node_0.style.minWidth = 110; @@ -5952,10 +5959,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 110; - node_0.layout.height = 210; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 110; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 210; } test("should use min bounds over max bounds", root_node, root_layout); @@ -5967,8 +5974,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 100; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; node_0.style.maxWidth = 80; node_0.style.maxHeight = 180; node_0.style.minWidth = 90; @@ -5978,10 +5985,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 90; - node_0.layout.height = 190; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 90; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 190; } test("should use min bounds over max bounds and natural width", root_node, root_layout); @@ -5993,8 +6000,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 100; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; node_0.style.minWidth = -10; node_0.style.minHeight = -20; } @@ -6002,10 +6009,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 100; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; } test("should ignore negative min bounds", root_node, root_layout); @@ -6017,8 +6024,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 100; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 100; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; node_0.style.maxWidth = -10; node_0.style.maxHeight = -20; } @@ -6026,10 +6033,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 100; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; } test("should ignore negative max bounds", root_node, root_layout); @@ -6052,10 +6059,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 40; - node_0.layout.height = 30; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 40; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 30; } test("should use padded size over max bounds", root_node, root_layout); @@ -6078,10 +6085,10 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 50; - node_0.layout.height = 40; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 50; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 40; } test("should use min size over padded size", root_node, root_layout); @@ -6094,8 +6101,8 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 300; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; @@ -6112,28 +6119,28 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 50; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 50; - node_1.layout.width = 200; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 50; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(2); - node_1.layout.top = 0; - node_1.layout.left = 250; - node_1.layout.width = 50; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 250; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -6148,8 +6155,8 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 300; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; @@ -6166,28 +6173,28 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 250; - node_1.layout.width = 50; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 250; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 50; - node_1.layout.width = 200; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 50; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(2); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 50; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -6201,8 +6208,8 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 300; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; @@ -6220,28 +6227,28 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 100; - node_1.layout.width = 100; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 100; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(2); - node_1.layout.top = 0; - node_1.layout.left = 200; - node_1.layout.width = 100; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 200; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -6256,8 +6263,8 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 300; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; @@ -6275,28 +6282,28 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 200; - node_1.layout.width = 100; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 200; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 100; - node_1.layout.width = 100; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 100; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(2); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -6310,8 +6317,8 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 300; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; @@ -6328,28 +6335,28 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 120; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 120; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 120; - node_1.layout.width = 60; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 120; + node_1.layout.dimensions[DIMENSION_WIDTH] = 60; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(2); - node_1.layout.top = 0; - node_1.layout.left = 180; - node_1.layout.width = 120; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 180; + node_1.layout.dimensions[DIMENSION_WIDTH] = 120; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -6364,8 +6371,8 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 300; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; @@ -6382,28 +6389,28 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 180; - node_1.layout.width = 120; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 180; + node_1.layout.dimensions[DIMENSION_WIDTH] = 120; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 120; - node_1.layout.width = 60; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 120; + node_1.layout.dimensions[DIMENSION_WIDTH] = 60; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(2); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 120; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 120; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -6417,8 +6424,8 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 300; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; @@ -6437,28 +6444,28 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 60; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 60; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 60; - node_1.layout.width = 60; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 60; + node_1.layout.dimensions[DIMENSION_WIDTH] = 60; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(2); - node_1.layout.top = 0; - node_1.layout.left = 120; - node_1.layout.width = 60; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 120; + node_1.layout.dimensions[DIMENSION_WIDTH] = 60; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -6473,8 +6480,8 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 300; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; @@ -6493,28 +6500,28 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 240; - node_1.layout.width = 60; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 240; + node_1.layout.dimensions[DIMENSION_WIDTH] = 60; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 180; - node_1.layout.width = 60; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 180; + node_1.layout.dimensions[DIMENSION_WIDTH] = 60; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(2); - node_1.layout.top = 0; - node_1.layout.left = 120; - node_1.layout.width = 60; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 120; + node_1.layout.dimensions[DIMENSION_WIDTH] = 60; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -6528,8 +6535,8 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 300; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; @@ -6548,28 +6555,28 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 120; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 120; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 120; - node_1.layout.width = 120; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 120; + node_1.layout.dimensions[DIMENSION_WIDTH] = 120; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(2); - node_1.layout.top = 0; - node_1.layout.left = 240; - node_1.layout.width = 120; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 240; + node_1.layout.dimensions[DIMENSION_WIDTH] = 120; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -6584,8 +6591,8 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 300; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; @@ -6604,28 +6611,28 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 3); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 180; - node_1.layout.width = 120; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 180; + node_1.layout.dimensions[DIMENSION_WIDTH] = 120; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 60; - node_1.layout.width = 120; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 60; + node_1.layout.dimensions[DIMENSION_WIDTH] = 120; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; node_1 = node_0.getChildAt(2); - node_1.layout.top = 0; - node_1.layout.left = -60; - node_1.layout.width = 120; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = -60; + node_1.layout.dimensions[DIMENSION_WIDTH] = 120; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -6638,8 +6645,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 300; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 1); { TestCSSNode node_1; @@ -6653,18 +6660,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 300; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 300; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -6677,8 +6684,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 300; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 1); { TestCSSNode node_1; @@ -6691,18 +6698,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 290; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 290; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -6715,8 +6722,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 300; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 1); { TestCSSNode node_1; @@ -6729,18 +6736,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 310; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 310; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; } } @@ -6761,34 +6768,34 @@ public class LayoutEngineTest { { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 200; - node_1.style.height = 300; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 300; node_1 = node_0.getChildAt(1); - node_1.style.width = 200; - node_1.style.height = 300; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 300; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 600; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 600; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 300; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 300; node_1 = node_0.getChildAt(1); - node_1.layout.top = 300; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 300; + node_1.layout.position[POSITION_TOP] = 300; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 300; } } @@ -6807,34 +6814,34 @@ public class LayoutEngineTest { { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 200; - node_1.style.height = 300; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 300; node_1 = node_0.getChildAt(1); - node_1.style.width = 200; - node_1.style.height = 300; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 300; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 100; - node_0.layout.height = 500; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 100; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 500; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 300; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 300; node_1 = node_0.getChildAt(1); - node_1.layout.top = 300; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 300; + node_1.layout.position[POSITION_TOP] = 300; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 300; } } @@ -6853,34 +6860,34 @@ public class LayoutEngineTest { { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 200; - node_1.style.height = 300; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 300; node_1 = node_0.getChildAt(1); - node_1.style.width = 200; - node_1.style.height = 300; + node_1.style.dimensions[DIMENSION_WIDTH] = 200; + node_1.style.dimensions[DIMENSION_HEIGHT] = 300; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 700; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 700; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 300; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 300; node_1 = node_0.getChildAt(1); - node_1.layout.top = 300; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 300; + node_1.layout.position[POSITION_TOP] = 300; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 300; } } @@ -6894,12 +6901,12 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.alignItems = CSSAlign.STRETCH; - node_0.style.width = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.style.maxWidth = 1100; node_1.style.maxHeight = 110; node_1.style.minWidth = 900; @@ -6910,18 +6917,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 100; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 100; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 1000; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -6935,12 +6942,12 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.alignItems = CSSAlign.STRETCH; - node_0.style.width = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.style.maxWidth = 900; node_1.style.maxHeight = 90; } @@ -6949,18 +6956,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 90; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 90; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 900; - node_1.layout.height = 90; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 900; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 90; } } @@ -6974,12 +6981,12 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.alignItems = CSSAlign.STRETCH; - node_0.style.width = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.style.minWidth = 1100; node_1.style.minHeight = 110; } @@ -6988,18 +6995,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 110; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 110; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 1100; - node_1.layout.height = 110; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 1100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 110; } } @@ -7013,12 +7020,12 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.style.minWidth = 100; node_1.style.minHeight = 110; } @@ -7027,18 +7034,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 110; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 110; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 110; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 110; } } @@ -7053,12 +7060,12 @@ public class LayoutEngineTest { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; node_0.style.flexDirection = CSSFlexDirection.ROW; - node_0.style.width = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.style.minWidth = 100; node_1.style.minHeight = 110; } @@ -7067,18 +7074,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 110; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 110; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 900; - node_1.layout.width = 100; - node_1.layout.height = 110; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 900; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 110; } } @@ -7091,8 +7098,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; @@ -7100,28 +7107,28 @@ public class LayoutEngineTest { node_1.style.positionType = CSSPositionType.ABSOLUTE; node_1.style.maxWidth = 500; node_1.style.maxHeight = 600; - node_1.style.positionLeft = 100; - node_1.style.positionTop = 100; - node_1.style.positionRight = 100; - node_1.style.positionBottom = 100; + node_1.style.position[POSITION_LEFT] = 100; + node_1.style.position[POSITION_TOP] = 100; + node_1.style.position[POSITION_RIGHT] = 100; + node_1.style.position[POSITION_BOTTOM] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 100; - node_1.layout.left = 100; - node_1.layout.width = 500; - node_1.layout.height = 600; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 100; + node_1.layout.dimensions[DIMENSION_WIDTH] = 500; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 600; } } @@ -7134,8 +7141,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 1000; - node_0.style.height = 1000; + node_0.style.dimensions[DIMENSION_WIDTH] = 1000; + node_0.style.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; @@ -7143,28 +7150,28 @@ public class LayoutEngineTest { node_1.style.positionType = CSSPositionType.ABSOLUTE; node_1.style.minWidth = 900; node_1.style.minHeight = 1000; - node_1.style.positionLeft = 100; - node_1.style.positionTop = 100; - node_1.style.positionRight = 100; - node_1.style.positionBottom = 100; + node_1.style.position[POSITION_LEFT] = 100; + node_1.style.position[POSITION_TOP] = 100; + node_1.style.position[POSITION_RIGHT] = 100; + node_1.style.position[POSITION_BOTTOM] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 1000; - node_0.layout.height = 1000; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 1000; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 1000; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 100; - node_1.layout.left = 100; - node_1.layout.width = 900; - node_1.layout.height = 1000; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 100; + node_1.layout.dimensions[DIMENSION_WIDTH] = 900; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 1000; } } @@ -7177,8 +7184,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 400; - node_0.style.height = 400; + node_0.style.dimensions[DIMENSION_WIDTH] = 400; + node_0.style.dimensions[DIMENSION_HEIGHT] = 400; addChildren(node_0, 1); { TestCSSNode node_1; @@ -7190,19 +7197,19 @@ public class LayoutEngineTest { node_1.setPadding(Spacing.BOTTOM, 10); node_1.setPadding(Spacing.START, 10); node_1.setPadding(Spacing.END, 10); - node_1.style.positionLeft = 100; - node_1.style.positionTop = 100; - node_1.style.positionRight = 100; - node_1.style.positionBottom = 100; + node_1.style.position[POSITION_LEFT] = 100; + node_1.style.position[POSITION_TOP] = 100; + node_1.style.position[POSITION_RIGHT] = 100; + node_1.style.position[POSITION_BOTTOM] = 100; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); node_2.style.positionType = CSSPositionType.ABSOLUTE; - node_2.style.positionLeft = 10; - node_2.style.positionTop = 10; - node_2.style.positionRight = 10; - node_2.style.positionBottom = 10; + node_2.style.position[POSITION_LEFT] = 10; + node_2.style.position[POSITION_TOP] = 10; + node_2.style.position[POSITION_RIGHT] = 10; + node_2.style.position[POSITION_BOTTOM] = 10; } } } @@ -7210,26 +7217,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 400; - node_0.layout.height = 400; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 400; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 400; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 100; - node_1.layout.left = 100; - node_1.layout.width = 200; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 100; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 10; - node_2.layout.left = 10; - node_2.layout.width = 180; - node_2.layout.height = 180; + node_2.layout.position[POSITION_TOP] = 10; + node_2.layout.position[POSITION_LEFT] = 10; + node_2.layout.dimensions[DIMENSION_WIDTH] = 180; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 180; } } } @@ -7243,8 +7250,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 400; - node_0.style.height = 400; + node_0.style.dimensions[DIMENSION_WIDTH] = 400; + node_0.style.dimensions[DIMENSION_HEIGHT] = 400; addChildren(node_0, 1); { TestCSSNode node_1; @@ -7262,19 +7269,19 @@ public class LayoutEngineTest { node_1.setBorder(Spacing.BOTTOM, 1); node_1.setBorder(Spacing.START, 1); node_1.setBorder(Spacing.END, 1); - node_1.style.positionLeft = 100; - node_1.style.positionTop = 100; - node_1.style.positionRight = 100; - node_1.style.positionBottom = 100; + node_1.style.position[POSITION_LEFT] = 100; + node_1.style.position[POSITION_TOP] = 100; + node_1.style.position[POSITION_RIGHT] = 100; + node_1.style.position[POSITION_BOTTOM] = 100; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); node_2.style.positionType = CSSPositionType.ABSOLUTE; - node_2.style.positionLeft = 10; - node_2.style.positionTop = 10; - node_2.style.positionRight = 10; - node_2.style.positionBottom = 10; + node_2.style.position[POSITION_LEFT] = 10; + node_2.style.position[POSITION_TOP] = 10; + node_2.style.position[POSITION_RIGHT] = 10; + node_2.style.position[POSITION_BOTTOM] = 10; } } } @@ -7282,26 +7289,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 400; - node_0.layout.height = 400; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 400; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 400; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 100; - node_1.layout.left = 100; - node_1.layout.width = 200; - node_1.layout.height = 200; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 100; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 11; - node_2.layout.left = 11; - node_2.layout.width = 178; - node_2.layout.height = 178; + node_2.layout.position[POSITION_TOP] = 11; + node_2.layout.position[POSITION_LEFT] = 11; + node_2.layout.dimensions[DIMENSION_WIDTH] = 178; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 178; } } } @@ -7315,8 +7322,8 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 400; - node_0.style.height = 400; + node_0.style.dimensions[DIMENSION_WIDTH] = 400; + node_0.style.dimensions[DIMENSION_HEIGHT] = 400; addChildren(node_0, 1); { TestCSSNode node_1; @@ -7333,10 +7340,10 @@ public class LayoutEngineTest { TestCSSNode node_2; node_2 = node_1.getChildAt(0); node_2.style.positionType = CSSPositionType.ABSOLUTE; - node_2.style.positionLeft = 10; - node_2.style.positionTop = 10; - node_2.style.positionRight = 10; - node_2.style.positionBottom = 10; + node_2.style.position[POSITION_LEFT] = 10; + node_2.style.position[POSITION_TOP] = 10; + node_2.style.position[POSITION_RIGHT] = 10; + node_2.style.position[POSITION_BOTTOM] = 10; } } } @@ -7344,26 +7351,26 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 400; - node_0.layout.height = 400; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 400; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 400; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 400; - node_1.layout.height = 400; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 400; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 400; addChildren(node_1, 1); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 10; - node_2.layout.left = 10; - node_2.layout.width = 380; - node_2.layout.height = 380; + node_2.layout.position[POSITION_TOP] = 10; + node_2.layout.position[POSITION_LEFT] = 10; + node_2.layout.dimensions[DIMENSION_WIDTH] = 380; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 380; } } } @@ -7378,8 +7385,8 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; - node_0.style.width = 200; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 200; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 2); { TestCSSNode node_1; @@ -7389,11 +7396,11 @@ public class LayoutEngineTest { { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.style.width = 50; - node_2.style.height = 50; + node_2.style.dimensions[DIMENSION_WIDTH] = 50; + node_2.style.dimensions[DIMENSION_HEIGHT] = 50; node_2 = node_1.getChildAt(1); - node_2.style.width = 50; - node_2.style.height = 50; + node_2.style.dimensions[DIMENSION_WIDTH] = 50; + node_2.style.dimensions[DIMENSION_HEIGHT] = 50; } node_1 = node_0.getChildAt(1); node_1.style.direction = CSSDirection.LTR; @@ -7402,11 +7409,11 @@ public class LayoutEngineTest { { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.style.width = 50; - node_2.style.height = 50; + node_2.style.dimensions[DIMENSION_WIDTH] = 50; + node_2.style.dimensions[DIMENSION_HEIGHT] = 50; node_2 = node_1.getChildAt(1); - node_2.style.width = 50; - node_2.style.height = 50; + node_2.style.dimensions[DIMENSION_WIDTH] = 50; + node_2.style.dimensions[DIMENSION_HEIGHT] = 50; } } } @@ -7414,50 +7421,50 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 2); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; addChildren(node_1, 2); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 0; - node_2.layout.left = 150; - node_2.layout.width = 50; - node_2.layout.height = 50; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 150; + node_2.layout.dimensions[DIMENSION_WIDTH] = 50; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 50; node_2 = node_1.getChildAt(1); - node_2.layout.top = 0; - node_2.layout.left = 100; - node_2.layout.width = 50; - node_2.layout.height = 50; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 100; + node_2.layout.dimensions[DIMENSION_WIDTH] = 50; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 50; } node_1 = node_0.getChildAt(1); - node_1.layout.top = 50; - node_1.layout.left = 0; - node_1.layout.width = 200; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 50; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 200; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; addChildren(node_1, 2); { TestCSSNode node_2; node_2 = node_1.getChildAt(0); - node_2.layout.top = 0; - node_2.layout.left = 0; - node_2.layout.width = 50; - node_2.layout.height = 50; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 0; + node_2.layout.dimensions[DIMENSION_WIDTH] = 50; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 50; node_2 = node_1.getChildAt(1); - node_2.layout.top = 0; - node_2.layout.left = 50; - node_2.layout.width = 50; - node_2.layout.height = 50; + node_2.layout.position[POSITION_TOP] = 0; + node_2.layout.position[POSITION_LEFT] = 50; + node_2.layout.dimensions[DIMENSION_WIDTH] = 50; + node_2.layout.dimensions[DIMENSION_HEIGHT] = 50; } } } @@ -7474,72 +7481,72 @@ public class LayoutEngineTest { node_0.style.flexDirection = CSSFlexDirection.ROW; node_0.style.justifyContent = CSSJustify.SPACE_BETWEEN; node_0.style.flexWrap = CSSWrap.WRAP; - node_0.style.width = 320; - node_0.style.height = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 320; + node_0.style.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 6); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(2); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(3); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(4); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(5); - node_1.style.width = 100; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 100; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 320; - node_0.layout.height = 200; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 320; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 200; addChildren(node_0, 6); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(1); - node_1.layout.top = 0; - node_1.layout.left = 110; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 110; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(2); - node_1.layout.top = 0; - node_1.layout.left = 220; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 220; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(3); - node_1.layout.top = 100; - node_1.layout.left = 0; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 0; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(4); - node_1.layout.top = 100; - node_1.layout.left = 110; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 110; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(5); - node_1.layout.top = 100; - node_1.layout.left = 220; - node_1.layout.width = 100; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 100; + node_1.layout.position[POSITION_LEFT] = 220; + node_1.layout.dimensions[DIMENSION_WIDTH] = 100; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; } } @@ -7552,7 +7559,7 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 200; node_0.setPadding(Spacing.LEFT, 5); node_0.setPadding(Spacing.RIGHT, 5); node_0.setPadding(Spacing.START, 15); @@ -7561,25 +7568,25 @@ public class LayoutEngineTest { { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 50; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 50; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 15; - node_1.layout.width = 170; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 15; + node_1.layout.dimensions[DIMENSION_WIDTH] = 170; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; } } @@ -7592,12 +7599,12 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 200; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.LEFT, 5); node_1.setMargin(Spacing.RIGHT, 5); node_1.setMargin(Spacing.START, 15); @@ -7608,18 +7615,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 50; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 50; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 15; - node_1.layout.width = 170; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 15; + node_1.layout.dimensions[DIMENSION_WIDTH] = 170; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; } } @@ -7632,7 +7639,7 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 200; node_0.setBorder(Spacing.LEFT, 5); node_0.setBorder(Spacing.RIGHT, 5); node_0.setBorder(Spacing.START, 15); @@ -7641,25 +7648,25 @@ public class LayoutEngineTest { { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 50; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 50; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 15; - node_1.layout.width = 170; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 15; + node_1.layout.dimensions[DIMENSION_WIDTH] = 170; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; } } @@ -7672,32 +7679,32 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 200; node_0.setPadding(Spacing.START, 15); node_0.setPadding(Spacing.END, 5); addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 50; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 50; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 15; - node_1.layout.width = 180; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 15; + node_1.layout.dimensions[DIMENSION_WIDTH] = 180; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; } } @@ -7711,32 +7718,32 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; - node_0.style.width = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 200; node_0.setPadding(Spacing.START, 15); node_0.setPadding(Spacing.END, 5); addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 50; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 50; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 5; - node_1.layout.width = 180; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 5; + node_1.layout.dimensions[DIMENSION_WIDTH] = 180; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; } } @@ -7749,12 +7756,12 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 200; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.START, 15); node_1.setMargin(Spacing.END, 5); } @@ -7763,18 +7770,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 50; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 50; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 15; - node_1.layout.width = 180; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 15; + node_1.layout.dimensions[DIMENSION_WIDTH] = 180; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; } } @@ -7787,13 +7794,13 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 200; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); node_1.style.direction = CSSDirection.RTL; - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.START, 15); node_1.setMargin(Spacing.END, 5); } @@ -7802,18 +7809,18 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 50; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 50; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 5; - node_1.layout.width = 180; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 5; + node_1.layout.dimensions[DIMENSION_WIDTH] = 180; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; } } @@ -7826,32 +7833,32 @@ public class LayoutEngineTest { TestCSSNode root_node = new TestCSSNode(); { TestCSSNode node_0 = root_node; - node_0.style.width = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 200; node_0.setBorder(Spacing.START, 15); node_0.setBorder(Spacing.END, 5); addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 50; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 50; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 15; - node_1.layout.width = 180; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 15; + node_1.layout.dimensions[DIMENSION_WIDTH] = 180; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; } } @@ -7865,32 +7872,32 @@ public class LayoutEngineTest { { TestCSSNode node_0 = root_node; node_0.style.direction = CSSDirection.RTL; - node_0.style.width = 200; + node_0.style.dimensions[DIMENSION_WIDTH] = 200; node_0.setBorder(Spacing.START, 15); node_0.setBorder(Spacing.END, 5); addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; } } TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 200; - node_0.layout.height = 50; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 200; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 50; addChildren(node_0, 1); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 0; - node_1.layout.left = 5; - node_1.layout.width = 180; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 0; + node_1.layout.position[POSITION_LEFT] = 5; + node_1.layout.dimensions[DIMENSION_WIDTH] = 180; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; } } @@ -7907,14 +7914,14 @@ public class LayoutEngineTest { node_0.style.alignContent = CSSAlign.STRETCH; node_0.style.alignItems = CSSAlign.FLEX_START; node_0.style.flexWrap = CSSWrap.WRAP; - node_0.style.width = 300; - node_0.style.height = 380; + node_0.style.dimensions[DIMENSION_WIDTH] = 300; + node_0.style.dimensions[DIMENSION_HEIGHT] = 380; addChildren(node_0, 15); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.style.width = 50; - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -7922,8 +7929,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 10); node_1.setMargin(Spacing.END, 10); node_1 = node_0.getChildAt(1); - node_1.style.width = 50; - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -7931,8 +7938,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 10); node_1.setMargin(Spacing.END, 10); node_1 = node_0.getChildAt(2); - node_1.style.width = 50; - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -7940,8 +7947,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 10); node_1.setMargin(Spacing.END, 10); node_1 = node_0.getChildAt(3); - node_1.style.width = 50; - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -7949,8 +7956,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 10); node_1.setMargin(Spacing.END, 10); node_1 = node_0.getChildAt(4); - node_1.style.width = 50; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -7959,8 +7966,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.END, 10); node_1 = node_0.getChildAt(5); node_1.style.alignSelf = CSSAlign.FLEX_START; - node_1.style.width = 50; - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -7968,8 +7975,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 10); node_1.setMargin(Spacing.END, 10); node_1 = node_0.getChildAt(6); - node_1.style.width = 50; - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -7977,8 +7984,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 10); node_1.setMargin(Spacing.END, 10); node_1 = node_0.getChildAt(7); - node_1.style.width = 50; - node_1.style.height = 100; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 100; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -7986,8 +7993,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 10); node_1.setMargin(Spacing.END, 10); node_1 = node_0.getChildAt(8); - node_1.style.width = 50; - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -7995,8 +8002,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 10); node_1.setMargin(Spacing.END, 10); node_1 = node_0.getChildAt(9); - node_1.style.width = 50; - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -8005,8 +8012,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.END, 10); node_1 = node_0.getChildAt(10); node_1.style.alignSelf = CSSAlign.FLEX_START; - node_1.style.width = 50; - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -8014,8 +8021,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 10); node_1.setMargin(Spacing.END, 10); node_1 = node_0.getChildAt(11); - node_1.style.width = 50; - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -8023,8 +8030,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 10); node_1.setMargin(Spacing.END, 10); node_1 = node_0.getChildAt(12); - node_1.style.width = 50; - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -8033,8 +8040,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.END, 10); node_1 = node_0.getChildAt(13); node_1.style.alignSelf = CSSAlign.FLEX_START; - node_1.style.width = 50; - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -8042,8 +8049,8 @@ public class LayoutEngineTest { node_1.setMargin(Spacing.START, 10); node_1.setMargin(Spacing.END, 10); node_1 = node_0.getChildAt(14); - node_1.style.width = 50; - node_1.style.height = 50; + node_1.style.dimensions[DIMENSION_WIDTH] = 50; + node_1.style.dimensions[DIMENSION_HEIGHT] = 50; node_1.setMargin(Spacing.LEFT, 10); node_1.setMargin(Spacing.TOP, 10); node_1.setMargin(Spacing.RIGHT, 10); @@ -8056,88 +8063,88 @@ public class LayoutEngineTest { TestCSSNode root_layout = new TestCSSNode(); { TestCSSNode node_0 = root_layout; - node_0.layout.top = 0; - node_0.layout.left = 0; - node_0.layout.width = 300; - node_0.layout.height = 380; + node_0.layout.position[POSITION_TOP] = 0; + node_0.layout.position[POSITION_LEFT] = 0; + node_0.layout.dimensions[DIMENSION_WIDTH] = 300; + node_0.layout.dimensions[DIMENSION_HEIGHT] = 380; addChildren(node_0, 15); { TestCSSNode node_1; node_1 = node_0.getChildAt(0); - node_1.layout.top = 10; - node_1.layout.left = 10; - node_1.layout.width = 50; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 10; + node_1.layout.position[POSITION_LEFT] = 10; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; node_1 = node_0.getChildAt(1); - node_1.layout.top = 10; - node_1.layout.left = 80; - node_1.layout.width = 50; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 10; + node_1.layout.position[POSITION_LEFT] = 80; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; node_1 = node_0.getChildAt(2); - node_1.layout.top = 10; - node_1.layout.left = 150; - node_1.layout.width = 50; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 10; + node_1.layout.position[POSITION_LEFT] = 150; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; node_1 = node_0.getChildAt(3); - node_1.layout.top = 10; - node_1.layout.left = 220; - node_1.layout.width = 50; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 10; + node_1.layout.position[POSITION_LEFT] = 220; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; node_1 = node_0.getChildAt(4); - node_1.layout.top = 92.5f; - node_1.layout.left = 10; - node_1.layout.width = 50; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 92.5f; + node_1.layout.position[POSITION_LEFT] = 10; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(5); - node_1.layout.top = 92.5f; - node_1.layout.left = 80; - node_1.layout.width = 50; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 92.5f; + node_1.layout.position[POSITION_LEFT] = 80; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; node_1 = node_0.getChildAt(6); - node_1.layout.top = 92.5f; - node_1.layout.left = 150; - node_1.layout.width = 50; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 92.5f; + node_1.layout.position[POSITION_LEFT] = 150; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; node_1 = node_0.getChildAt(7); - node_1.layout.top = 92.5f; - node_1.layout.left = 220; - node_1.layout.width = 50; - node_1.layout.height = 100; + node_1.layout.position[POSITION_TOP] = 92.5f; + node_1.layout.position[POSITION_LEFT] = 220; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 100; node_1 = node_0.getChildAt(8); - node_1.layout.top = 225; - node_1.layout.left = 10; - node_1.layout.width = 50; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 225; + node_1.layout.position[POSITION_LEFT] = 10; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; node_1 = node_0.getChildAt(9); - node_1.layout.top = 225; - node_1.layout.left = 80; - node_1.layout.width = 50; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 225; + node_1.layout.position[POSITION_LEFT] = 80; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; node_1 = node_0.getChildAt(10); - node_1.layout.top = 225; - node_1.layout.left = 150; - node_1.layout.width = 50; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 225; + node_1.layout.position[POSITION_LEFT] = 150; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; node_1 = node_0.getChildAt(11); - node_1.layout.top = 225; - node_1.layout.left = 220; - node_1.layout.width = 50; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 225; + node_1.layout.position[POSITION_LEFT] = 220; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; node_1 = node_0.getChildAt(12); - node_1.layout.top = 307.5f; - node_1.layout.left = 10; - node_1.layout.width = 50; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 307.5f; + node_1.layout.position[POSITION_LEFT] = 10; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; node_1 = node_0.getChildAt(13); - node_1.layout.top = 307.5f; - node_1.layout.left = 80; - node_1.layout.width = 50; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 307.5f; + node_1.layout.position[POSITION_LEFT] = 80; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; node_1 = node_0.getChildAt(14); - node_1.layout.top = 307.5f; - node_1.layout.left = 150; - node_1.layout.width = 50; - node_1.layout.height = 50; + node_1.layout.position[POSITION_TOP] = 307.5f; + node_1.layout.position[POSITION_LEFT] = 150; + node_1.layout.dimensions[DIMENSION_WIDTH] = 50; + node_1.layout.dimensions[DIMENSION_HEIGHT] = 50; } } diff --git a/src/transpile.js b/src/transpile.js index 32727bfe..e343ac51 100644 --- a/src/transpile.js +++ b/src/transpile.js @@ -261,6 +261,7 @@ function transpileAnnotatedJStoC(jsCode) { .replace(/node\./g, 'node->') .replace(/child\./g, 'child->') .replace(/parent\./g, 'parent->') + .replace(/var\/\*\(c\)!([^*]+)\*\//g, '$1') .replace(/var\/\*([^\/]+)\*\//g, '$1') .replace(/ === /g, ' == ') .replace(/ !== /g, ' != ')