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

Re: Comments on the use of exceptions...

From: John Cowan <cowan@locke.ccil.org>
Date: Thu, 20 Aug 1998 17:16:07 -0400
Message-ID: <35DC9217.1B2177C5@locke.ccil.org>
To: DOM List <www-dom@w3.org>
Mike Champion wrote:

> When looping over all child nodes, or all nodes returned by
> getElementsByTag name, we DO NOT want to force the user to call the size()
> [or whatever we ended up calling it; sorry I'm in a hurry ...] method to
> figure out how far to loop, because that might force the implementation to
> travel all the relevant Nodes and count them.

Not only that, but there is no assurance that the user's cached value
of NodeList.length is still correct, since new Nodes may have been
added to the tree.  So looping from 0 to length-1 is downright
incorrect.

-- 
John Cowan	http://www.ccil.org/~cowan		cowan@ccil.org
	You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.
	You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.
		Clear all so!  'Tis a Jute.... (Finnegans Wake 16.5)
Received on Thursday, 20 August 1998 17:16:19 GMT

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