Re: Clarification on "live NodeList"

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