From e7366bf41f68cfe07e9ea03fc4a398baecbae651 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 4 Feb 2017 09:41:13 +0000 Subject: Initial conversion from MediaWiki, 20170204 --- libdom/the_mutationevent_generation.mdwn | 96 ++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 libdom/the_mutationevent_generation.mdwn (limited to 'libdom/the_mutationevent_generation.mdwn') diff --git a/libdom/the_mutationevent_generation.mdwn b/libdom/the_mutationevent_generation.mdwn new file mode 100644 index 0000000..ae00db3 --- /dev/null +++ b/libdom/the_mutationevent_generation.mdwn @@ -0,0 +1,96 @@ +[[!meta title="LibDOM/The MutationEvent generation"]] +[[!meta author="Struggleyb"]] +[[!meta date="2009-08-09T10:20:48Z"]] + + +[[!toc]] + +Events with Methods Generate them +--------------------------------- + + + DOMSubtreeModified: + + + DOMNodeRemovedFromDocument: + Node.replaceChild + Node.removeChild + Element.removeAttribute + Element.setAttributeNode + Element.removeAttributeNode + Element.removeAttributeNS + Element.setAttributeNodeNS + + DOMNodeInsertedIntoDocument: + Node.insertBefore + Node.replaceChild + Node.appendChild + Element.setAttribute + Element.setAttributeNode + Element.setAttributeNS + Element.setAttributeNodeNS + + DOMNodeInserted: + Node.insertBefore + Node.replaceChild + Node.appendChild + Element.setAttribute + Element.setAttributeNode + Element.setAttributeNS + Element.setAttributeNodeNS + + DOMNodeRemoved: + Node.replaceChild + Node.removeChild + Element.removeAttribute + Element.setAttributeNode + Element.removeAttributeNode + Element.removeAttributeNS + Element.setAttributeNodeNS + + DOMAttrModified: + Element.setAttribute + Element.removeAttribute + Element.setAttributeNode + Element.removeAttributeNode + Element.setAttributeNS + Element.removeAttributeNS + Element.setAttributeNodeNS + + DOMCharacterDataModified: + Node.nodeValue + CharacterData.data + CharacterData.appendData + CharacterData.deleteData + CharacterData.insertData + CharacterData.replaceData + ProcessingInstruction.data + +#### Some Event Generation Order consideration + +As above, some changes of DOM caused by certain API can emit multiple +Events. In some situation, the DOM spec define the order of the events. +For example, when an Attr is removed from an element, the implementation +should send the following events as the following order: + + DOMNodeRemoved + DOMAttrModified + DOMSubtreeModified + +But in other situation, the events order are not specified. For example, +when an Attr is added to an element, the implement should may send: + + DOMNodeInserted + DOMAttrModified + DOMSubtreeModified + +or + + DOMAttrModified + DOMNodeInserted + DOMSubtreeModified + +The point here is, the DOMAttrModified and DOMNodeInserted can be +dispatched in any order, but the DOMSubtreeModified event should always +the last event after bunch of events. + -- cgit v1.2.3