(final DomNode domNode)
| 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 |
no test coverage detected