move extractLayoutNode out of layout.js

This commit is contained in:
Christopher Chedeau
2014-04-27 12:37:26 -07:00
parent a0ffafe37d
commit 490a7c74d5
2 changed files with 14 additions and 20 deletions

View File

@@ -51,8 +51,20 @@ var layoutTestUtils = (function() {
node.children.forEach(fillNodes);
}
function extractNodes(node) {
var layout = node.layout;
delete node.layout;
if (node.children.length > 0) {
layout.children = node.children.map(extractNodes);
} else {
delete node.children;
}
return layout;
}
fillNodes(rootNode);
return realComputeLayout(rootNode);
realComputeLayout(rootNode);
return extractNodes(rootNode);
}
function computeDOMLayout(node) {