Attr Interface Deprecation

Kellen Holmes <[email protected]>
Newsgroups gmane.comp.web.dom.general
Message-ID <CAOLZSt9PNUNsv=+gPpVeFXZq8LSnw7u-2B8UjeSW=Y0pX2Z+Mw@mail.gmail.com>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.