W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1999

Re: DOM L2 comments, various

From: <keshlam@us.ibm.com>
Date: Tue, 5 Oct 1999 11:26:37 -0400
To: Arnaud Le Hors <lehors@w3.org>
cc: www-dom@w3.org
Message-ID: <85256801.0054D748.00@D51MTA03.pok.ibm.com>
> If instanceof(Attr) returns true, it'd better be an Attr node,
> or your users will get very confused.

I"m completely undecided as to whether that should be considered a bug or not.
It depends on an assumption about whether or not an API is a contract
guaranteeing that behavior will be supported, or stating how that behavior
behaves if this instance supports it, and I think there are legitimate design
spaces for both. Since the DOM doesn't make a statement either way, I wouldn't
count on instanceof() to distinguish node types, and I generally advise users to
avoid doing so, since there's a good alternative (nodeType) which _is_ promised
to Do The Right Thing.



______________________________________
Joe Kesselman  / IBM Research
Received on Tuesday, 5 October 1999 11:26:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:46 GMT