initial support for text layout

This commit is contained in:
Christopher Chedeau
2014-04-26 12:16:27 -07:00
parent 6fdd724820
commit c06f48c45f
5 changed files with 21 additions and 4 deletions

View File

@@ -65,6 +65,9 @@ var layoutTestUtils = (function() {
(node.children || []).forEach(function(child) {
renderNode(div, child);
});
if (node.style.text) {
div.innerText = node.style.text;
}
return div;
}
@@ -81,7 +84,9 @@ var layoutTestUtils = (function() {
var children = [];
for (var child = div.firstChild; child; child = child.nextSibling) {
children.push(buildLayout(rect, child));
if (child.nodeType !== 3 /* textNode */) {
children.push(buildLayout(rect, child));
}
}
if (children.length) {
result.children = children;