[DOM L3 Events] Mutation Events and Attr Nodes

In IE9's implementation of DOMNodeRemoved/DOMNodeInserted, we are not implementing the capability described in the current editor's draft, which states that a conforming user-agent should fire these two events when Attr nodes are removed/added to an element [1] [2], also referenced in [3] [4]:

"A user agent must dispatch this event when a node has been added as a child of another node or, ---- in case of Attr nodes, has been added to an Element. ----"

I note that other user agents also do not implement this functionality for Attr nodes, despite having support for these events.

In addition, the DOMAttrModified event itself covers the notification of Attr additions and removals via it's "attrChange" property (ADDITION = 2, REMOVAL = 3).

Given the general lack of support from other user agents, and a plausible workaround using DOMAttrModified (for those user agents that support this event), I'd recommend that we allow a user agent that wants to implement the mutation events (despite their deprecation status), to avoid implementing the above functionality for Attr nodes.

I'd like to see some spec text that states something to the effect of: DOM L2 Events previously required DOMNodeRemoved/Inserted to fire when Attr nodes were added to an Element, however this requirement no longer applies in DOM L3 Events for user agents that implement these [DOMNodeRemoved/Inserted/etc.] mutation events.

-Travis

[1] http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-DOMNodeInserted 
[2] http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-DOMNodeRemoved 
[3] http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-DOMNodeRemovedFromDocument
[4] http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-DOMNodeInsertedIntoDocument

Received on Thursday, 15 July 2010 16:08:12 UTC