double flex and position absolute

This commit is contained in:
Christopher Chedeau
2014-04-22 10:21:17 -07:00
parent a18bc27c6b
commit 5922c88f84
2 changed files with 13 additions and 2 deletions

View File

@@ -216,7 +216,7 @@ var computeLayout = (function() {
}
for (var/*int*/ i = 0; i < node.children.length; ++i) {
var/*css_node_t**/ child = node.children[i];
if (getFlex(child)) {
if (getPositionType(child) === 'relative' && getFlex(child)) {
child.layout[dim[mainAxis]] = flexibleMainDim +
getPadding(child, leading[mainAxis]) +
getPadding(child, trailing[mainAxis]);

View File

@@ -669,7 +669,18 @@ describe('Layout', function() {
);
});
it('should layout node with double flex and position absolute', function() {
testLayout(
{style: {height: 500}, children: [
{style: {flex: 1}},
{style: {flex: 1, position: 'absolute'}}
]},
{width: 0, height: 500, top: 0, left: 0, children: [
{width: 0, height: 500, top: 0, left: 0},
{width: 0, height: 0, top: 500, left: 0},
]}
)
});
it('should layout randomly', function() {