Attr Interface Deprecation

I'm trying to get an understanding of why in DOM 4 the Attr interface no
longer inherits from the Node interface.

Previously, I often found it useful to be able to enumerate all nodes in a
document (including Attributes), and then be able to "polymorphically" use
various perform operations on Node.nodeValue or dispatch to specialized
functions based on Node.nodeType.

In the new spec, I am forced to either create wrapper interfaces or
dispatch based on instance type, rather than the integer representation of
type (which, in my opinion, a bit cleaner and more consistent). Also, I can
no longer treat nodes that have a meaningful Node.nodeValue the same as
Attributes in code paths that only care about the nodeValue.

So, I guess my question is: can you provide the rationale for such a change
(I am mostly curious, to get a better understanding)? And, is there a
better way to work around this change than the solutions I mentioned?

Regards,
Kellen Holmes

Received on Wednesday, 24 July 2013 17:08:56 UTC