setup automated testing for padding

This commit is contained in:
Christopher Chedeau
2014-04-15 18:04:11 -07:00
parent 930c4dc700
commit 9db106a71c
2 changed files with 31 additions and 14 deletions

View File

@@ -24,24 +24,32 @@ function computeLayout(node) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
function getMargin(location, node) {
var key = 'margin' + capitalizeFirst(location);
function getSpacing(type, location, node) {
var key = type + capitalizeFirst(location);
if (key in node.style) {
return node.style[key];
}
key = 'margin' + capitalizeFirst(axis[location]);
key = type + capitalizeFirst(axis[location]);
if (key in node.style) {
return node.style[key];
}
if ('margin' in node.style) {
if (type in node.style) {
return node.style.margin;
}
return 0;
}
function getMargin(location, node) {
return getSpacing('margin', location, node);
}
function getPadding(location, node) {
return getSpacing('padding', location, node);
}
function getJustifyContent(node) {
if ('justifyContent' in node.style) {
return node.style.justifyContent;