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

Method fireAddition

src/main/java/org/htmlunit/html/DomNode.java:1052–1084  ·  view source on GitHub ↗
(final DomNode domNode)

Source from the content-addressed store, hash-verified

1050 }
1051
1052 private void fireAddition(final DomNode domNode) {
1053 final boolean wasAlreadyAttached = domNode.isAttachedToPage();
1054 domNode.attachedToPage_ = isAttachedToPage();
1055
1056 final SgmlPage page = getPage();
1057 if (domNode.attachedToPage_) {
1058 // trigger events
1059 if (null != page && page.isHtmlPage()) {
1060 ((HtmlPage) page).notifyNodeAdded(domNode);
1061 }
1062
1063 // a node that is already "complete" (ie not being parsed) and not yet attached
1064 if (!domNode.isBodyParsed() && !wasAlreadyAttached) {
1065 if (domNode.getFirstChild() != null) {
1066 for (final Iterator<DomNode> iterator =
1067 domNode.new DescendantDomNodesIterator(); iterator.hasNext();) {
1068 final DomNode child = iterator.next();
1069 child.attachedToPage_ = true;
1070 child.onAllChildrenAddedToPage(true);
1071 }
1072 }
1073 domNode.onAllChildrenAddedToPage(true);
1074 }
1075 }
1076
1077 if (this instanceof DomDocumentFragment) {
1078 onAddedToDocumentFragment();
1079 }
1080
1081 if (page == null || page.isDomChangeListenerInUse()) {
1082 fireNodeAdded(this, domNode);
1083 }
1084 }
1085
1086 /**
1087 * Indicates if the current node is being parsed. This means that the opening tag has already been

Callers 3

appendChildMethod · 0.95
insertBeforeMethod · 0.95
moveBeforeMethod · 0.95

Calls 12

isAttachedToPageMethod · 0.95
getPageMethod · 0.95
isHtmlPageMethod · 0.95
hasNextMethod · 0.95
nextMethod · 0.95
fireNodeAddedMethod · 0.95
notifyNodeAddedMethod · 0.80
isBodyParsedMethod · 0.80
getFirstChildMethod · 0.45

Tested by

no test coverage detected