diff --git a/gentest/gentest.js b/gentest/gentest.js index 0ef07f49..56e6957a 100755 --- a/gentest/gentest.js +++ b/gentest/gentest.js @@ -93,8 +93,20 @@ function setupTestTree(node, nodeName, parentName, index) { ]; for (var style in node.style) { + + // Skip position info for root as it messes up tests + if (node.declaredStyle[style] === "" && + (style == 'position' || + style == 'left' || + style == 'top' || + style == 'right' || + style == 'bottom' || + style == 'width' || + style == 'height')) { + continue; + } + if (node.style[style] !== getDefaultStyleValue(style)) { - var TODO = ''; switch (style) { case 'direction': lines.push('CSSNodeSetDirection(' + nodeName + ', ' + @@ -337,6 +349,7 @@ function calculateTree(root) { height: child.offsetHeight, children: calculateTree(child), style: getCSSLayoutStyle(child), + declaredStyle: child.style, }); } diff --git a/tests/CSSLayoutFlexBasisTest.cpp b/tests/CSSLayoutFlexBasisTest.cpp index 4bdaef3b..2fe8e344 100644 --- a/tests/CSSLayoutFlexBasisTest.cpp +++ b/tests/CSSLayoutFlexBasisTest.cpp @@ -30,14 +30,10 @@ TEST(CSSLayoutTest, flex_basis) { const CSSNodeRef root_child0 = CSSNodeNew(); CSSNodeStyleSetFlexGrow(root_child0, 1); CSSNodeStyleSetFlexBasis(root_child0, 100); - CSSNodeStyleSetWidth(root_child0, 200); - CSSNodeStyleSetHeight(root_child0, 100); CSSNodeInsertChild(root, root_child0, 0); const CSSNodeRef root_child1 = CSSNodeNew(); CSSNodeStyleSetFlexGrow(root_child1, 1); - CSSNodeStyleSetWidth(root_child1, 100); - CSSNodeStyleSetHeight(root_child1, 100); CSSNodeInsertChild(root, root_child1, 1); CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR); @@ -55,4 +51,4 @@ TEST(CSSLayoutTest, flex_basis) { ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1)); ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1)); ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1)); -} + }