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)
| 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. |
no test coverage detected