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

Method basicInsertBefore

src/main/java/org/htmlunit/html/DomNode.java:1035–1050  ·  view source on GitHub ↗

Inserts the specified node into this node's parent's children right before this node, assuming the specified node is clean (doesn't have preexisting relationships to other nodes). @param node the node to insert before this node

(final DomNode node)

Source from the content-addressed store, hash-verified

1033 * @param node the node to insert before this node
1034 */
1035 private void basicInsertBefore(final DomNode node) {
1036 // try to make the node setup as complete as possible
1037 // before the node is reachable
1038 node.setPage(page_);
1039 node.parent_ = parent_;
1040 node.previousSibling_ = previousSibling_;
1041 node.nextSibling_ = this;
1042
1043 if (parent_.firstChild_ == this) {
1044 parent_.firstChild_ = node;
1045 }
1046 else {
1047 previousSibling_.nextSibling_ = node;
1048 }
1049 previousSibling_ = node;
1050 }
1051
1052 private void fireAddition(final DomNode domNode) {
1053 final boolean wasAlreadyAttached = domNode.isAttachedToPage();

Callers 2

insertBeforeMethod · 0.95
moveBeforeMethod · 0.95

Calls 1

setPageMethod · 0.80

Tested by

no test coverage detected