margin
This commit is contained in:
@@ -36,6 +36,7 @@ function computeDOMLayout(node) {
|
||||
var div = document.createElement('div');
|
||||
transferPx(div, node, 'width');
|
||||
transferPx(div, node, 'height');
|
||||
transferPx(div, node, 'margin');
|
||||
parent.appendChild(div);
|
||||
(node.children || []).forEach(function(child) {
|
||||
renderNode(div, child);
|
||||
@@ -135,5 +136,13 @@ describe('Layout', function() {
|
||||
}]
|
||||
});
|
||||
});
|
||||
|
||||
it('should layout node with margin', function() {
|
||||
testLayout({
|
||||
style: {width: 100, height: 200, margin: 10}
|
||||
}, {
|
||||
width: 100, height: 200, top: 10, left: 10
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user