MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / after

Method after

src/main/java/org/htmlunit/javascript/host/dom/Node.java:1035–1050  ·  view source on GitHub ↗

Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent, just after this ChildNode. @param context the context @param thisObj this object @param args the arguments @param function the function

(final Context context, final Scriptable thisObj, final Object[] args,
            final Function function)

Source from the content-addressed store, hash-verified

1033 * @param function the function
1034 */
1035 protected static void after(final Context context, final Scriptable thisObj, final Object[] args,
1036 final Function function) {
1037 final DomNode thisDomNode = ((Node) thisObj).getDomNodeOrDie();
1038 final DomNode parentNode = thisDomNode.getParentNode();
1039 final DomNode nextSibling = thisDomNode.getNextSibling();
1040 for (final Object arg : args) {
1041 final Node node = toNodeOrTextNode((Node) thisObj, arg);
1042 final DomNode newNode = node.getDomNodeOrDie();
1043 if (nextSibling == null) {
1044 parentNode.appendChild(newNode);
1045 }
1046 else {
1047 nextSibling.insertBefore(newNode);
1048 }
1049 }
1050 }
1051
1052 /**
1053 * Inserts a set of Node objects or string objects after the last child of the Element.

Callers 7

afterMethod · 0.95
afterMethod · 0.95
afterMethod · 0.95
clearExpiredMethod · 0.45
addCookieMethod · 0.45
dateRangeMethod · 0.45
timeRangeMethod · 0.45

Implementers 1

DomNodesrc/main/java/org/htmlunit/html/DomNod

Calls 6

getParentNodeMethod · 0.95
getNextSiblingMethod · 0.95
toNodeOrTextNodeMethod · 0.95
appendChildMethod · 0.95
insertBeforeMethod · 0.95
getDomNodeOrDieMethod · 0.45

Tested by

no test coverage detected