// "Local" events (non-aggregated)
if ((mutationMask&MUTATION_LOCAL) != 0) {
// New child is told it was inserted, and where
LCount lc = LCount.lookup(MutationEventImpl.DOM_NODE_INSERTED);
if (lc.captures+lc.bubbles+lc.defaults>0) {
MutationEvent me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl.DOM_NODE_INSERTED,
true,false,this,null,
null,null,(short)0);
newInternal.dispatchEvent(me);
}
// If within the Document, tell the subtree it's been added
// to the Doc.
lc=LCount.lookup(
MutationEventImpl.DOM_NODE_INSERTED_INTO_DOCUMENT);
if (lc.captures+lc.bubbles+lc.defaults>0) {
NodeImpl eventAncestor=this;
if (enclosingAttr!=null)
eventAncestor=
(NodeImpl)(enclosingAttr.node.getOwnerElement());
if (eventAncestor!=null) { // Might have been orphan Attr
NodeImpl p=eventAncestor;
while (p!=null) {
eventAncestor=p; // Last non-null ancestor
// In this context, ancestry includes
// walking back from Attr to Element
if (p.getNodeType()==ATTRIBUTE_NODE) {
p=(ElementImpl)((AttrImpl)p).getOwnerElement();
}
else {
p=p.parentNode();
}
}
if (eventAncestor.getNodeType()==Node.DOCUMENT_NODE) {
MutationEvent me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl
.DOM_NODE_INSERTED_INTO_DOCUMENT,
false,false,null,null,
null,null,(short)0);
dispatchEventToSubtree(newInternal,me);
}