RE: Node.getAttributes and 2 typos

>Why it is defined on Node and not Element is another question.

Very deliberate. We wanted the DOM to be fully operable without requiring
that folks downcast from Node. Casts are surprisingly expensive in some
environments, and can be a distraction even when they aren't.

In theory, if you have Node, NodeList, and NamedNodeMap you can retrieve or
modify anything in your main document tree. I've seen some minimalist
subsets of the DOM built on that basis. Of course they weren't
DOM-compliant, but they _were_ DOM-compatable; anything that worked on them
would work on a "real" DOM, though of course the reverse isn't true.

(Is it worth adding this to the FAQ, is it documented in our design
principles somewhere, or is it unnecessary trivia?)

Joe Kesselman  / IBM Research

Received on Tuesday, 17 July 2001 09:05:55 UTC