Java源码示例:com.sun.org.apache.xerces.internal.dom.events.MutationEventImpl
示例1
/**
* A method to be called when a character data node has been modified
*/
void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) {
if (mutationEvents) {
if (!replace) {
// MUTATION POST-EVENTS:
LCount lc =
LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED);
if (lc.total > 0) {
MutationEvent me = new MutationEventImpl();
me.initMutationEvent(
MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED,
true, false, null,
oldvalue, value, null, (short) 0);
dispatchEvent(node, me);
}
// Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
// if required. (Common to most kinds of mutation)
dispatchAggregateEvents(node, savedEnclosingAttr);
} // End mutation postprocessing
}
}
示例2
/**
* A method to be called when an attribute node has been removed
*/
void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) {
// We can't use the standard dispatchAggregate, since it assumes
// that the Attr is still attached to an owner. This code is
// similar but dispatches to the previous owner, "element".
if (mutationEvents) {
// If we have to send DOMAttrModified (determined earlier),
// do so.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
MutationEventImpl me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
true, false, attr,
attr.getNodeValue(), null, name,
MutationEvent.REMOVAL);
dispatchEvent(oldOwner, me);
}
// We can hand off to process DOMSubtreeModified, though.
// Note that only the Element needs to be informed; the
// Attr's subtree has not been changed by this operation.
dispatchAggregateEvents(oldOwner, null, null, (short) 0);
}
}
示例3
/**
* A method to be called when a character data node has been modified
*/
void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) {
if (mutationEvents) {
if (!replace) {
// MUTATION POST-EVENTS:
LCount lc =
LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED);
if (lc.total > 0) {
MutationEvent me = new MutationEventImpl();
me.initMutationEvent(
MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED,
true, false, null,
oldvalue, value, null, (short) 0);
dispatchEvent(node, me);
}
// Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
// if required. (Common to most kinds of mutation)
dispatchAggregateEvents(node, savedEnclosingAttr);
} // End mutation postprocessing
}
}
示例4
/**
* A method to be called when an attribute node has been removed
*/
void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) {
// We can't use the standard dispatchAggregate, since it assumes
// that the Attr is still attached to an owner. This code is
// similar but dispatches to the previous owner, "element".
if (mutationEvents) {
// If we have to send DOMAttrModified (determined earlier),
// do so.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
MutationEventImpl me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
true, false, attr,
attr.getNodeValue(), null, name,
MutationEvent.REMOVAL);
dispatchEvent(oldOwner, me);
}
// We can hand off to process DOMSubtreeModified, though.
// Note that only the Element needs to be informed; the
// Attr's subtree has not been changed by this operation.
dispatchAggregateEvents(oldOwner, null, null, (short) 0);
}
}
示例5
/**
* A method to be called when a character data node has been modified
*/
void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) {
if (mutationEvents) {
if (!replace) {
// MUTATION POST-EVENTS:
LCount lc =
LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED);
if (lc.total > 0) {
MutationEvent me = new MutationEventImpl();
me.initMutationEvent(
MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED,
true, false, null,
oldvalue, value, null, (short) 0);
dispatchEvent(node, me);
}
// Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
// if required. (Common to most kinds of mutation)
dispatchAggregateEvents(node, savedEnclosingAttr);
} // End mutation postprocessing
}
}
示例6
/**
* A method to be called when an attribute node has been removed
*/
void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) {
// We can't use the standard dispatchAggregate, since it assumes
// that the Attr is still attached to an owner. This code is
// similar but dispatches to the previous owner, "element".
if (mutationEvents) {
// If we have to send DOMAttrModified (determined earlier),
// do so.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
MutationEventImpl me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
true, false, attr,
attr.getNodeValue(), null, name,
MutationEvent.REMOVAL);
dispatchEvent(oldOwner, me);
}
// We can hand off to process DOMSubtreeModified, though.
// Note that only the Element needs to be informed; the
// Attr's subtree has not been changed by this operation.
dispatchAggregateEvents(oldOwner, null, null, (short) 0);
}
}
示例7
/**
* A method to be called when a character data node has been modified
*/
void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) {
if (mutationEvents) {
if (!replace) {
// MUTATION POST-EVENTS:
LCount lc =
LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED);
if (lc.total > 0) {
MutationEvent me = new MutationEventImpl();
me.initMutationEvent(
MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED,
true, false, null,
oldvalue, value, null, (short) 0);
dispatchEvent(node, me);
}
// Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
// if required. (Common to most kinds of mutation)
dispatchAggregateEvents(node, savedEnclosingAttr);
} // End mutation postprocessing
}
}
示例8
/**
* A method to be called when an attribute node has been removed
*/
void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) {
// We can't use the standard dispatchAggregate, since it assumes
// that the Attr is still attached to an owner. This code is
// similar but dispatches to the previous owner, "element".
if (mutationEvents) {
// If we have to send DOMAttrModified (determined earlier),
// do so.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
MutationEventImpl me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
true, false, attr,
attr.getNodeValue(), null, name,
MutationEvent.REMOVAL);
dispatchEvent(oldOwner, me);
}
// We can hand off to process DOMSubtreeModified, though.
// Note that only the Element needs to be informed; the
// Attr's subtree has not been changed by this operation.
dispatchAggregateEvents(oldOwner, null, null, (short) 0);
}
}
示例9
/**
* A method to be called when a character data node has been modified
*/
void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) {
if (mutationEvents) {
if (!replace) {
// MUTATION POST-EVENTS:
LCount lc =
LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED);
if (lc.total > 0) {
MutationEvent me = new MutationEventImpl();
me.initMutationEvent(
MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED,
true, false, null,
oldvalue, value, null, (short) 0);
dispatchEvent(node, me);
}
// Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
// if required. (Common to most kinds of mutation)
dispatchAggregateEvents(node, savedEnclosingAttr);
} // End mutation postprocessing
}
}
示例10
/**
* A method to be called when an attribute node has been removed
*/
void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) {
// We can't use the standard dispatchAggregate, since it assumes
// that the Attr is still attached to an owner. This code is
// similar but dispatches to the previous owner, "element".
if (mutationEvents) {
// If we have to send DOMAttrModified (determined earlier),
// do so.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
MutationEventImpl me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
true, false, attr,
attr.getNodeValue(), null, name,
MutationEvent.REMOVAL);
dispatchEvent(oldOwner, me);
}
// We can hand off to process DOMSubtreeModified, though.
// Note that only the Element needs to be informed; the
// Attr's subtree has not been changed by this operation.
dispatchAggregateEvents(oldOwner, null, null, (short) 0);
}
}
示例11
/**
* A method to be called when a character data node has been modified
*/
void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) {
if (mutationEvents) {
if (!replace) {
// MUTATION POST-EVENTS:
LCount lc =
LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED);
if (lc.total > 0) {
MutationEvent me = new MutationEventImpl();
me.initMutationEvent(
MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED,
true, false, null,
oldvalue, value, null, (short) 0);
dispatchEvent(node, me);
}
// Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
// if required. (Common to most kinds of mutation)
dispatchAggregateEvents(node, savedEnclosingAttr);
} // End mutation postprocessing
}
}
示例12
/**
* A method to be called when an attribute node has been removed
*/
void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) {
// We can't use the standard dispatchAggregate, since it assumes
// that the Attr is still attached to an owner. This code is
// similar but dispatches to the previous owner, "element".
if (mutationEvents) {
// If we have to send DOMAttrModified (determined earlier),
// do so.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
MutationEventImpl me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
true, false, attr,
attr.getNodeValue(), null, name,
MutationEvent.REMOVAL);
dispatchEvent(oldOwner, me);
}
// We can hand off to process DOMSubtreeModified, though.
// Note that only the Element needs to be informed; the
// Attr's subtree has not been changed by this operation.
dispatchAggregateEvents(oldOwner, null, null, (short) 0);
}
}
示例13
/**
* A method to be called when a character data node has been modified
*/
void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) {
if (mutationEvents) {
if (!replace) {
// MUTATION POST-EVENTS:
LCount lc =
LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED);
if (lc.total > 0) {
MutationEvent me = new MutationEventImpl();
me.initMutationEvent(
MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED,
true, false, null,
oldvalue, value, null, (short) 0);
dispatchEvent(node, me);
}
// Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
// if required. (Common to most kinds of mutation)
dispatchAggregateEvents(node, savedEnclosingAttr);
} // End mutation postprocessing
}
}
示例14
/**
* A method to be called when an attribute node has been removed
*/
void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) {
// We can't use the standard dispatchAggregate, since it assumes
// that the Attr is still attached to an owner. This code is
// similar but dispatches to the previous owner, "element".
if (mutationEvents) {
// If we have to send DOMAttrModified (determined earlier),
// do so.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
MutationEventImpl me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
true, false, attr,
attr.getNodeValue(), null, name,
MutationEvent.REMOVAL);
dispatchEvent(oldOwner, me);
}
// We can hand off to process DOMSubtreeModified, though.
// Note that only the Element needs to be informed; the
// Attr's subtree has not been changed by this operation.
dispatchAggregateEvents(oldOwner, null, null, (short) 0);
}
}
示例15
/**
* A method to be called when a character data node has been modified
*/
void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) {
if (mutationEvents) {
if (!replace) {
// MUTATION POST-EVENTS:
LCount lc =
LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED);
if (lc.total > 0) {
MutationEvent me = new MutationEventImpl();
me.initMutationEvent(
MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED,
true, false, null,
oldvalue, value, null, (short) 0);
dispatchEvent(node, me);
}
// Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
// if required. (Common to most kinds of mutation)
dispatchAggregateEvents(node, savedEnclosingAttr);
} // End mutation postprocessing
}
}
示例16
/**
* A method to be called when an attribute node has been removed
*/
void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) {
// We can't use the standard dispatchAggregate, since it assumes
// that the Attr is still attached to an owner. This code is
// similar but dispatches to the previous owner, "element".
if (mutationEvents) {
// If we have to send DOMAttrModified (determined earlier),
// do so.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
MutationEventImpl me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
true, false, attr,
attr.getNodeValue(), null, name,
MutationEvent.REMOVAL);
dispatchEvent(oldOwner, me);
}
// We can hand off to process DOMSubtreeModified, though.
// Note that only the Element needs to be informed; the
// Attr's subtree has not been changed by this operation.
dispatchAggregateEvents(oldOwner, null, null, (short) 0);
}
}
示例17
/**
* A method to be called when a character data node has been modified
*/
void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) {
if (mutationEvents) {
if (!replace) {
// MUTATION POST-EVENTS:
LCount lc =
LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED);
if (lc.total > 0) {
MutationEvent me = new MutationEventImpl();
me.initMutationEvent(
MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED,
true, false, null,
oldvalue, value, null, (short) 0);
dispatchEvent(node, me);
}
// Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
// if required. (Common to most kinds of mutation)
dispatchAggregateEvents(node, savedEnclosingAttr);
} // End mutation postprocessing
}
}
示例18
/**
* A method to be called when an attribute node has been removed
*/
void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) {
// We can't use the standard dispatchAggregate, since it assumes
// that the Attr is still attached to an owner. This code is
// similar but dispatches to the previous owner, "element".
if (mutationEvents) {
// If we have to send DOMAttrModified (determined earlier),
// do so.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
MutationEventImpl me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
true, false, attr,
attr.getNodeValue(), null, name,
MutationEvent.REMOVAL);
dispatchEvent(oldOwner, me);
}
// We can hand off to process DOMSubtreeModified, though.
// Note that only the Element needs to be informed; the
// Attr's subtree has not been changed by this operation.
dispatchAggregateEvents(oldOwner, null, null, (short) 0);
}
}
示例19
/**
* A method to be called when a character data node has been modified
*/
void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) {
if (mutationEvents) {
if (!replace) {
// MUTATION POST-EVENTS:
LCount lc =
LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED);
if (lc.total > 0) {
MutationEvent me = new MutationEventImpl();
me.initMutationEvent(
MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED,
true, false, null,
oldvalue, value, null, (short) 0);
dispatchEvent(node, me);
}
// Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
// if required. (Common to most kinds of mutation)
dispatchAggregateEvents(node, savedEnclosingAttr);
} // End mutation postprocessing
}
}
示例20
/**
* A method to be called when an attribute node has been removed
*/
void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) {
// We can't use the standard dispatchAggregate, since it assumes
// that the Attr is still attached to an owner. This code is
// similar but dispatches to the previous owner, "element".
if (mutationEvents) {
// If we have to send DOMAttrModified (determined earlier),
// do so.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
MutationEventImpl me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
true, false, attr,
attr.getNodeValue(), null, name,
MutationEvent.REMOVAL);
dispatchEvent(oldOwner, me);
}
// We can hand off to process DOMSubtreeModified, though.
// Note that only the Element needs to be informed; the
// Attr's subtree has not been changed by this operation.
dispatchAggregateEvents(oldOwner, null, null, (short) 0);
}
}
示例21
/**
* A method to be called when a character data node has been modified
*/
void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) {
if (mutationEvents) {
if (!replace) {
// MUTATION POST-EVENTS:
LCount lc =
LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED);
if (lc.total > 0) {
MutationEvent me = new MutationEventImpl();
me.initMutationEvent(
MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED,
true, false, null,
oldvalue, value, null, (short) 0);
dispatchEvent(node, me);
}
// Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
// if required. (Common to most kinds of mutation)
dispatchAggregateEvents(node, savedEnclosingAttr);
} // End mutation postprocessing
}
}
示例22
/**
* A method to be called when an attribute node has been removed
*/
void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) {
// We can't use the standard dispatchAggregate, since it assumes
// that the Attr is still attached to an owner. This code is
// similar but dispatches to the previous owner, "element".
if (mutationEvents) {
// If we have to send DOMAttrModified (determined earlier),
// do so.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
MutationEventImpl me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
true, false, attr,
attr.getNodeValue(), null, name,
MutationEvent.REMOVAL);
dispatchEvent(oldOwner, me);
}
// We can hand off to process DOMSubtreeModified, though.
// Note that only the Element needs to be informed; the
// Attr's subtree has not been changed by this operation.
dispatchAggregateEvents(oldOwner, null, null, (short) 0);
}
}
示例23
/**
* NON-DOM INTERNAL: Pre-mutation context check, in
* preparation for later generating DOMAttrModified events.
* Determines whether this node is within an Attr
* @param node node to get enclosing attribute for
* @return either a description of that Attr, or null if none such.
*/
protected void saveEnclosingAttr(NodeImpl node) {
savedEnclosingAttr = null;
// MUTATION PREPROCESSING AND PRE-EVENTS:
// If we're within the scope of an Attr and DOMAttrModified
// was requested, we need to preserve its previous value for
// that event.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
NodeImpl eventAncestor = node;
while (true) {
if (eventAncestor == null)
return;
int type = eventAncestor.getNodeType();
if (type == Node.ATTRIBUTE_NODE) {
EnclosingAttr retval = new EnclosingAttr();
retval.node = (AttrImpl) eventAncestor;
retval.oldvalue = retval.node.getNodeValue();
savedEnclosingAttr = retval;
return;
}
else if (type == Node.ENTITY_REFERENCE_NODE)
eventAncestor = eventAncestor.parentNode();
else if (type == Node.TEXT_NODE)
eventAncestor = eventAncestor.parentNode();
else
return;
// Any other parent means we're not in an Attr
}
}
}
示例24
/**
* NON-DOM INTERNAL: Pre-mutation context check, in
* preparation for later generating DOMAttrModified events.
* Determines whether this node is within an Attr
* @param node node to get enclosing attribute for
* @return either a description of that Attr, or null if none such.
*/
protected void saveEnclosingAttr(NodeImpl node) {
savedEnclosingAttr = null;
// MUTATION PREPROCESSING AND PRE-EVENTS:
// If we're within the scope of an Attr and DOMAttrModified
// was requested, we need to preserve its previous value for
// that event.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
NodeImpl eventAncestor = node;
while (true) {
if (eventAncestor == null)
return;
int type = eventAncestor.getNodeType();
if (type == Node.ATTRIBUTE_NODE) {
EnclosingAttr retval = new EnclosingAttr();
retval.node = (AttrImpl) eventAncestor;
retval.oldvalue = retval.node.getNodeValue();
savedEnclosingAttr = retval;
return;
}
else if (type == Node.ENTITY_REFERENCE_NODE)
eventAncestor = eventAncestor.parentNode();
else if (type == Node.TEXT_NODE)
eventAncestor = eventAncestor.parentNode();
else
return;
// Any other parent means we're not in an Attr
}
}
}
示例25
/**
* NON-DOM INTERNAL: Pre-mutation context check, in
* preparation for later generating DOMAttrModified events.
* Determines whether this node is within an Attr
* @param node node to get enclosing attribute for
* @return either a description of that Attr, or null if none such.
*/
protected void saveEnclosingAttr(NodeImpl node) {
savedEnclosingAttr = null;
// MUTATION PREPROCESSING AND PRE-EVENTS:
// If we're within the scope of an Attr and DOMAttrModified
// was requested, we need to preserve its previous value for
// that event.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
NodeImpl eventAncestor = node;
while (true) {
if (eventAncestor == null)
return;
int type = eventAncestor.getNodeType();
if (type == Node.ATTRIBUTE_NODE) {
EnclosingAttr retval = new EnclosingAttr();
retval.node = (AttrImpl) eventAncestor;
retval.oldvalue = retval.node.getNodeValue();
savedEnclosingAttr = retval;
return;
}
else if (type == Node.ENTITY_REFERENCE_NODE)
eventAncestor = eventAncestor.parentNode();
else if (type == Node.TEXT_NODE)
eventAncestor = eventAncestor.parentNode();
else
return;
// Any other parent means we're not in an Attr
}
}
}
示例26
/**
* NON-DOM INTERNAL: Pre-mutation context check, in
* preparation for later generating DOMAttrModified events.
* Determines whether this node is within an Attr
* @param node node to get enclosing attribute for
* @return either a description of that Attr, or null if none such.
*/
protected void saveEnclosingAttr(NodeImpl node) {
savedEnclosingAttr = null;
// MUTATION PREPROCESSING AND PRE-EVENTS:
// If we're within the scope of an Attr and DOMAttrModified
// was requested, we need to preserve its previous value for
// that event.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
NodeImpl eventAncestor = node;
while (true) {
if (eventAncestor == null)
return;
int type = eventAncestor.getNodeType();
if (type == Node.ATTRIBUTE_NODE) {
EnclosingAttr retval = new EnclosingAttr();
retval.node = (AttrImpl) eventAncestor;
retval.oldvalue = retval.node.getNodeValue();
savedEnclosingAttr = retval;
return;
}
else if (type == Node.ENTITY_REFERENCE_NODE)
eventAncestor = eventAncestor.parentNode();
else if (type == Node.TEXT_NODE)
eventAncestor = eventAncestor.parentNode();
else
return;
// Any other parent means we're not in an Attr
}
}
}
示例27
/**
* NON-DOM INTERNAL: Pre-mutation context check, in
* preparation for later generating DOMAttrModified events.
* Determines whether this node is within an Attr
* @param node node to get enclosing attribute for
* @return either a description of that Attr, or null if none such.
*/
protected void saveEnclosingAttr(NodeImpl node) {
savedEnclosingAttr = null;
// MUTATION PREPROCESSING AND PRE-EVENTS:
// If we're within the scope of an Attr and DOMAttrModified
// was requested, we need to preserve its previous value for
// that event.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
NodeImpl eventAncestor = node;
while (true) {
if (eventAncestor == null)
return;
int type = eventAncestor.getNodeType();
if (type == Node.ATTRIBUTE_NODE) {
EnclosingAttr retval = new EnclosingAttr();
retval.node = (AttrImpl) eventAncestor;
retval.oldvalue = retval.node.getNodeValue();
savedEnclosingAttr = retval;
return;
}
else if (type == Node.ENTITY_REFERENCE_NODE)
eventAncestor = eventAncestor.parentNode();
else if (type == Node.TEXT_NODE)
eventAncestor = eventAncestor.parentNode();
else
return;
// Any other parent means we're not in an Attr
}
}
}
示例28
/**
* NON-DOM INTERNAL: Pre-mutation context check, in
* preparation for later generating DOMAttrModified events.
* Determines whether this node is within an Attr
* @param node node to get enclosing attribute for
* @return either a description of that Attr, or null if none such.
*/
protected void saveEnclosingAttr(NodeImpl node) {
savedEnclosingAttr = null;
// MUTATION PREPROCESSING AND PRE-EVENTS:
// If we're within the scope of an Attr and DOMAttrModified
// was requested, we need to preserve its previous value for
// that event.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
NodeImpl eventAncestor = node;
while (true) {
if (eventAncestor == null)
return;
int type = eventAncestor.getNodeType();
if (type == Node.ATTRIBUTE_NODE) {
EnclosingAttr retval = new EnclosingAttr();
retval.node = (AttrImpl) eventAncestor;
retval.oldvalue = retval.node.getNodeValue();
savedEnclosingAttr = retval;
return;
}
else if (type == Node.ENTITY_REFERENCE_NODE)
eventAncestor = eventAncestor.parentNode();
else if (type == Node.TEXT_NODE)
eventAncestor = eventAncestor.parentNode();
else
return;
// Any other parent means we're not in an Attr
}
}
}
示例29
/**
* NON-DOM INTERNAL: Pre-mutation context check, in
* preparation for later generating DOMAttrModified events.
* Determines whether this node is within an Attr
* @param node node to get enclosing attribute for
* @return either a description of that Attr, or null if none such.
*/
protected void saveEnclosingAttr(NodeImpl node) {
savedEnclosingAttr = null;
// MUTATION PREPROCESSING AND PRE-EVENTS:
// If we're within the scope of an Attr and DOMAttrModified
// was requested, we need to preserve its previous value for
// that event.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
NodeImpl eventAncestor = node;
while (true) {
if (eventAncestor == null)
return;
int type = eventAncestor.getNodeType();
if (type == Node.ATTRIBUTE_NODE) {
EnclosingAttr retval = new EnclosingAttr();
retval.node = (AttrImpl) eventAncestor;
retval.oldvalue = retval.node.getNodeValue();
savedEnclosingAttr = retval;
return;
}
else if (type == Node.ENTITY_REFERENCE_NODE)
eventAncestor = eventAncestor.parentNode();
else if (type == Node.TEXT_NODE)
eventAncestor = eventAncestor.parentNode();
else
return;
// Any other parent means we're not in an Attr
}
}
}
示例30
/**
* NON-DOM INTERNAL: Pre-mutation context check, in
* preparation for later generating DOMAttrModified events.
* Determines whether this node is within an Attr
* @param node node to get enclosing attribute for
* @return either a description of that Attr, or null if none such.
*/
protected void saveEnclosingAttr(NodeImpl node) {
savedEnclosingAttr = null;
// MUTATION PREPROCESSING AND PRE-EVENTS:
// If we're within the scope of an Attr and DOMAttrModified
// was requested, we need to preserve its previous value for
// that event.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
NodeImpl eventAncestor = node;
while (true) {
if (eventAncestor == null)
return;
int type = eventAncestor.getNodeType();
if (type == Node.ATTRIBUTE_NODE) {
EnclosingAttr retval = new EnclosingAttr();
retval.node = (AttrImpl) eventAncestor;
retval.oldvalue = retval.node.getNodeValue();
savedEnclosingAttr = retval;
return;
}
else if (type == Node.ENTITY_REFERENCE_NODE)
eventAncestor = eventAncestor.parentNode();
else if (type == Node.TEXT_NODE)
eventAncestor = eventAncestor.parentNode();
else
return;
// Any other parent means we're not in an Attr
}
}
}