/src/main/java/org/htmlunit/html/impl/SimpleRange.java
while ( childNodes.getLength( ) == 0) {
while ( childNodes.getLength ( ) > 0 ) {
setStart(newNode, 0); } private static void insertNodeOrDocFragment(final DomNode parent, final DomNode newNode, final DomNode refNode) { if (newNode instanceof DocumentFragment) { final DocumentFragment fragment = (DocumentFragment) newNode; final NodeList childNodes = fragment.getChildNodes(); <extra_id_0> final Node item = childNodes.item(0); parent.insertBefore(item, refNode); } } else { parent.insertBefore(newNode, refNode);