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

2013-07-28 Thread Jonas Sicking
On Sun, Jul 28, 2013 at 1:59 PM, Ojan Vafai wrote: > On Sun, Jul 28, 2013 at 11:10 AM, Boris Zbarsky wrote: >> >> 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.

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

2013-07-28 Thread Ojan Vafai
On Sun, Jul 28, 2013 at 11:10 AM, Boris Zbarsky wrote: > 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 > pre

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

2013-07-28 Thread Boris Zbarsky
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 th

Re: [whatwg] iterators intead of live NodeLists WAS: Proposal: Adding methods like getElementById and getElementsByTagName to DocumentFragments

2013-07-28 Thread James Greene
I think it makes sense, too. That said, if the goal is to REPLACE the NodeIterator and TreeWalker APIs completely, it wouldn't be all that valuable for me as my most common use case has always been to get TEXT NODES from under a root node based on some CSS filtering of its ancestor nodes. If the pr

Re: [whatwg] iterators intead of live NodeLists WAS: Proposal: Adding methods like getElementById and getElementsByTagName to DocumentFragments

2013-07-28 Thread Tab Atkins Jr.
I strongly agree with the use-case, and think some feature for this would be very helpful. [Mixing up your emails for reply convenience.] On Sat, Jul 27, 2013 at 11:25 AM, Ojan Vafai wrote: > On Sat, Jul 27, 2013 at 10:58 AM, Ojan Vafai wrote: >> var iterator = document.querySelectorAll('div').i