W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2013

Attr Interface Deprecation

From: Kellen Holmes <kellen.holmes@gmail.com>
Date: Mon, 22 Jul 2013 10:39:03 -0400
Message-ID: <CAOLZSt9PNUNsv=+gPpVeFXZq8LSnw7u-2B8UjeSW=Y0pX2Z+Mw@mail.gmail.com>
To: www-dom@w3.org
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?

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:37:03 UTC