support border and position absolute for cross axis

This commit is contained in:
Christopher Chedeau
2014-04-22 11:44:19 -07:00
parent b6f3bbc3b8
commit a22194b6c0
2 changed files with 13 additions and 0 deletions

View File

@@ -307,6 +307,7 @@ var computeLayout = (function() {
} else { } else {
if (isPosDefined(child, leading[crossAxis])) { if (isPosDefined(child, leading[crossAxis])) {
child.layout[pos[crossAxis]] = getPosition(child, leading[crossAxis]) + child.layout[pos[crossAxis]] = getPosition(child, leading[crossAxis]) +
getBorder(node, leading[crossAxis]) +
getMargin(child, leading[crossAxis]); getMargin(child, leading[crossAxis]);
} else { } else {
child.layout[pos[crossAxis]] += getPaddingAndBorder(node, leading[crossAxis]); child.layout[pos[crossAxis]] += getPaddingAndBorder(node, leading[crossAxis]);

View File

@@ -700,6 +700,18 @@ describe('Layout', function() {
) )
}); });
it('should layout node with borderWidth and position: absolute, top. cross axis', function() {
testLayout(
{style: {borderWidth: 1}, children: [
{style: {left: 5, position: 'absolute'}}
]},
{width: 2, height: 2, top: 0, left: 0, children: [
{width: 0, height: 0, top: 1, left: 6}
]}
)
});
it('should layout randomly', function() { it('should layout randomly', function() {