use of org.loboevolution.html.dom.domimpl.DocumentFragmentImpl in project LoboEvolution by LoboEvolution.
the class RBlockViewport method layoutChildren.
private void layoutChildren(NodeImpl node) {
final NodeListImpl nodeList = node.getNodeList();
if (nodeList != null) {
nodeList.forEach(nd -> {
final NodeImpl child = (NodeImpl) nd;
final NodeType nodeType = child.getNodeType();
switch(nodeType) {
case TEXT_NODE:
layoutText(child);
break;
case ELEMENT_NODE:
this.currentLine.addStyleChanger(new RStyleChanger(child));
final String nodeName = child.getNodeName().toUpperCase();
MarkupLayout ml = RLayout.elementLayout.get(HTMLTag.get(nodeName));
if (ml == null) {
ml = miscLayout;
}
ml.layoutMarkup(this, (HTMLElementImpl) child);
this.currentLine.addStyleChanger(new RStyleChanger(node));
break;
case DOCUMENT_FRAGMENT_NODE:
final DocumentFragmentImpl fragment = (DocumentFragmentImpl) child;
fragment.getNodeList().forEach(fragNode -> {
final NodeImpl fragChild = (NodeImpl) fragNode;
layoutChildren(fragChild);
});
break;
case COMMENT_NODE:
case PROCESSING_INSTRUCTION_NODE:
default:
break;
}
});
}
}
Aggregations