[whatwg] Proposal: Adding methods like getElementById and getElementsByTagName to DocumentFragments

Boris Zbarsky bzbarsky at MIT.EDU
Sun Jul 28 11:10:16 PDT 2013


On 7/27/13 10:58 AM, Ojan Vafai wrote:
> var iterator = document.querySelectorAll('div').iterator(); <--- does
> some magic to not precompute the whole list

Well, so... not precompute but make it some sort of live, or not 
precompute but represent a frozen set of nodes?

What should happen with this situation:

   var list = document.querySelectorAll('div');
   var iterator = list.iterator();

Should the list of nodes be precomputed in this case?

Basically, the magic sounds like it's ... very magical.  Magical enough 
that authors would have a tough time with this setup, even ignoring 
implementation concerns.

-Boris



More information about the whatwg mailing list