Re: New DOM Level 2 Working Draft

>So why not just use parentNode like everything else does?

Because an Attr is not a child. Parent/child was defined to be a bidirectional
relationship; if you can get to something via getParent, you can get back via
getFirstChild/getNextSibling. Since the latter relationship doesn't hold for
Attrs, the former really isn't applicable either. Hence the new, one-way,
relationship.

I suppose one could argue that getOwningElement() should be available on nodes
other than Attr, and on those nodes should equate to getParent. Nobody has
submitted a use case for that.

______________________________________
Joe Kesselman  / IBM Research

Received on Monday, 27 September 1999 12:22:44 UTC