W3C home > Mailing lists > Public > public-html@w3.org > July 2009

Re: Clarification on "live NodeList"

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 10 Jul 2009 11:12:55 -0700
Message-ID: <4A5784A7.8070508@mit.edu>
To: Andrew Fedoniouk <news@terrainformatica.com>
CC: HTML WG <public-html@w3.org>
Andrew Fedoniouk wrote:
> Do you know any existing code that relies on liveness of NodeLists?

I don't have pointers offhand, but sites out there do things like:

var list = document.getElementsByTagName("something");
while (list.length) {
   list[0].parentNode.removeChild(list[0]);
}

> Boris, do you know any real page that will stop working if NodeList will 
> be replaced by StaticNodeList in getElementsByTagName(), 

Like I said, I don't have links offhand.  I've seen the code pattern 
above in the wild while looking at pages that had other issues in Gecko, 
though.

> getElementsByClassName() or getElementsBySelector (...CSS selector...)?

querySelectorAll doesn't return a live nodelist.

-Boris
Received on Friday, 10 July 2009 18:13:41 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:48 UTC