position: absolute should respect cross padding
This commit is contained in:
@@ -276,6 +276,8 @@ var computeLayout = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
child.layout[pos[crossAxis]] += leadingCrossDim;
|
child.layout[pos[crossAxis]] += leadingCrossDim;
|
||||||
|
} else {
|
||||||
|
child.layout[pos[crossAxis]] += getPadding(node, leading[crossAxis]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -535,6 +535,17 @@ describe('Layout', function() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should layout node with specified width', function() {
|
||||||
|
testLayout(
|
||||||
|
{style: {padding: 5}, children: [
|
||||||
|
{style: {position: 'absolute'}}
|
||||||
|
]},
|
||||||
|
{width: 10, height: 10, top: 0, left: 0, children: [
|
||||||
|
{width: 0, height: 0, top: 5, left: 5}
|
||||||
|
]}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('should layout randomly', function() {
|
it('should layout randomly', function() {
|
||||||
function RNG(seed) {
|
function RNG(seed) {
|
||||||
this.state = seed;
|
this.state = seed;
|
||||||
@@ -556,9 +567,6 @@ describe('Layout', function() {
|
|||||||
}
|
}
|
||||||
function randEnum(node, chance, attribute, enumValues) {
|
function randEnum(node, chance, attribute, enumValues) {
|
||||||
if (rng.nextFloat() < chance) {
|
if (rng.nextFloat() < chance) {
|
||||||
if (attribute === 'position') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
node.style[attribute] = enumValues[Math.floor(rng.nextFloat() * enumValues.length)];
|
node.style[attribute] = enumValues[Math.floor(rng.nextFloat() * enumValues.length)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user