{
// Child is told that it is about to be removed
lc=LCount.lookup(MutationEventImpl.DOM_NODE_REMOVED);
if(lc.captures+lc.bubbles+lc.defaults>0)
{
MutationEvent me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl.DOM_NODE_REMOVED,
true,false,this,null,
null,null,(short)0);
oldInternal.dispatchEvent(me);
}
// If within Document, child's subtree is informed that it's
// losing that status
lc=LCount.lookup(
MutationEventImpl.DOM_NODE_REMOVED_FROM_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
{
for(NodeImpl p=eventAncestor.parentNode();
p!=null;
p=p.parentNode())
{
eventAncestor=p; // Last non-null ancestor
}
if(eventAncestor.getNodeType()==Node.DOCUMENT_NODE)
{
MutationEvent me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl
.DOM_NODE_REMOVED_FROM_DOCUMENT,
false,false,
null,null,null,null,(short)0);
dispatchEventToSubtree(oldInternal,me);
}