/** * {@inheritDoc} */ @Override public String asXml() { final StringBuilder sb = new StringBuilder(); for (final DomNode node : getChildren()) { sb.append(node.asXml()); } return sb.toString(); }
/** * {@inheritDoc} */ @Override public String asXml() { final StringBuilder sb = new StringBuilder(); for (final DomNode node : getChildren()) { sb.append(node.asXml()); } return sb.toString(); }
/** * {@inheritDoc} */ @Override public Node insertBefore(final Node newChild, final Node refChild) { if (newChild instanceof DomDocumentFragment) { final DomDocumentFragment fragment = (DomDocumentFragment) newChild; for (final DomNode child : fragment.getChildren()) { insertBefore(child, refChild); } } else { if (refChild == null) { appendChild(newChild); } else { if (refChild.getParentNode() != this) { throw new DOMException(DOMException.NOT_FOUND_ERR, "Reference node is not a child of this node."); } ((DomNode) refChild).insertBefore((DomNode) newChild); } } return newChild; }
/** * {@inheritDoc} */ @Override public Node insertBefore(final Node newChild, final Node refChild) { if (newChild instanceof DomDocumentFragment) { final DomDocumentFragment fragment = (DomDocumentFragment) newChild; for (final DomNode child : fragment.getChildren()) { insertBefore(child, refChild); } } else { if (refChild == null) { appendChild(newChild); } else { if (refChild.getParentNode() != this) { throw new DOMException(DOMException.NOT_FOUND_ERR, "Reference node is not a child of this node."); } ((DomNode) refChild).insertBefore((DomNode) newChild); } } return newChild; }
/** * {@inheritDoc} */ @Override public DomNode appendChild(final Node node) { if (node == this) { Context.throwAsScriptRuntimeEx(new Exception("Can not add not to itself " + this)); return this; } final DomNode domNode = (DomNode) node; if (domNode.isAncestorOf(this)) { Context.throwAsScriptRuntimeEx(new Exception("Can not add (grand)parent to itself " + this)); } if (domNode instanceof DomDocumentFragment) { final DomDocumentFragment fragment = (DomDocumentFragment) domNode; for (final DomNode child : fragment.getChildren()) { appendChild(child); } } else { // clean up the new node, in case it is being moved if (domNode.getParentNode() != null) { domNode.detach(); } basicAppend(domNode); fireAddition(domNode); } return domNode; }
/** * {@inheritDoc} */ @Override public DomNode appendChild(final Node node) { if (node == this) { Context.throwAsScriptRuntimeEx(new Exception("Can not add not to itself " + this)); return this; } final DomNode domNode = (DomNode) node; if (domNode.isAncestorOf(this)) { Context.throwAsScriptRuntimeEx(new Exception("Can not add (grand)parent to itself " + this)); } if (domNode instanceof DomDocumentFragment) { final DomDocumentFragment fragment = (DomDocumentFragment) domNode; for (final DomNode child : fragment.getChildren()) { appendChild(child); } } else { // clean up the new node, in case it is being moved if (domNode.getParentNode() != null) { domNode.detach(); } basicAppend(domNode); fireAddition(domNode); } return domNode; }
/** * {@inheritDoc} */ public DomNode appendChild(final Node node) { final DomNode domNode = (DomNode) node; if (domNode instanceof DomDocumentFragment) { final DomDocumentFragment fragment = (DomDocumentFragment) domNode; for (final DomNode child : fragment.getChildren()) { appendChild(child); } } else { // clean up the new node, in case it is being moved if (domNode != this && domNode.getParentNode() != null) { domNode.remove(); } // move the node basicAppend(domNode); if (domNode.getStartLineNumber() == -1) { // dynamically added node, not parsed domNode.onAddedToPage(); domNode.onAllChildrenAddedToPage(true); } // trigger events if (!(this instanceof DomDocumentFragment) && (getPage() instanceof HtmlPage)) { ((HtmlPage) getPage()).notifyNodeAdded(domNode); } fireNodeAdded(this, domNode); } return domNode; }
/** * {@inheritDoc} */ public DomNode appendChild(final Node node) { final DomNode domNode = (DomNode) node; if (domNode instanceof DomDocumentFragment) { final DomDocumentFragment fragment = (DomDocumentFragment) domNode; for (final DomNode child : fragment.getChildren()) { appendChild(child); } } else { // clean up the new node, in case it is being moved if (domNode != this && domNode.getParentNode() != null) { domNode.remove(); } // move the node basicAppend(domNode); if (domNode.getStartLineNumber() == -1) { // dynamically added node, not parsed domNode.onAddedToPage(); domNode.onAllChildrenAddedToPage(true); } // trigger events if (!(this instanceof DomDocumentFragment) && (getPage() instanceof HtmlPage)) { ((HtmlPage) getPage()).notifyNodeAdded(domNode); } fireNodeAdded(this, domNode); } return domNode; }
/** * {@inheritDoc} */ public DomNode appendChild(final Node node) { final DomNode domNode = (DomNode) node; if (domNode instanceof DomDocumentFragment) { final DomDocumentFragment fragment = (DomDocumentFragment) domNode; for (final DomNode child : fragment.getChildren()) { appendChild(child); } } else { // clean up the new node, in case it is being moved if (domNode != this && domNode.getParentNode() != null) { domNode.remove(); } // move the node basicAppend(domNode); if (domNode.getStartLineNumber() == -1) { // dynamically added node, not parsed domNode.onAddedToPage(); domNode.onAllChildrenAddedToPage(true); } // trigger events if (!(this instanceof DomDocumentFragment) && (getPage() instanceof HtmlPage)) { ((HtmlPage) getPage()).notifyNodeAdded(domNode); } fireNodeAdded(this, domNode); } return domNode; }
for (final DomNode child : fragment.getChildren()) { insertBeforeImpl(new Object[] {child.getScriptableObject(), refChildObject});
for (final DomNode child : fragment.getChildren()) { insertBeforeImpl(new Object[] {child.getScriptableObject(), refChildObject});
for (final DomNode child : fragment.getChildren()) { if (!isNodeInsertable((Node) child.getScriptableObject())) { throw ScriptRuntime.constructError("ReferenceError",
for (final DomNode child : fragment.getChildren()) { if (!isNodeInsertable((Node) child.getScriptableObject())) { throw ScriptRuntime.constructError("ReferenceError",
if (newChildNode instanceof DomDocumentFragment) { final DomDocumentFragment fragment = (DomDocumentFragment) newChildNode; for (final DomNode child : fragment.getChildren()) { jsxFunction_insertBefore(new Object[] {child.getScriptObject(), refChildObject});
if (newChildNode instanceof DomDocumentFragment) { final DomDocumentFragment fragment = (DomDocumentFragment) newChildNode; for (final DomNode child : fragment.getChildren()) { jsxFunction_insertBefore(new Object[] {child.getScriptObject(), refChildObject});
if (newChildNode instanceof DomDocumentFragment) { final DomDocumentFragment fragment = (DomDocumentFragment) newChildNode; for (final DomNode child : fragment.getChildren()) { jsxFunction_insertBefore(new Object[] {child.getScriptObject(), refChildObject});
for (final DomNode child : fragment.getChildren()) { jsxFunction_insertBefore(new Object[] {child.getScriptObject(), refChildObject});