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

2013-08-13 Thread Ryosuke Niwa
On Jul 28, 2013, at 10:29 AM, James Greene james.m.gre...@gmail.com wrote: 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

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 o...@chromium.org wrote: On Sat, Jul 27, 2013 at 10:58 AM, Ojan Vafai o...@chromium.org wrote: var iterator =

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

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

2013-07-27 Thread Ojan Vafai
Realized this should probably be a new thread... On Sat, Jul 27, 2013 at 10:58 AM, Ojan Vafai o...@chromium.org wrote: On Thu, Jul 25, 2013 at 1:42 PM, Jonas Sicking jo...@sicking.cc wrote: On Thu, Jul 25, 2013 at 9:05 AM, Boris Zbarsky bzbar...@mit.edu wrote: On 7/24/13 10:42 PM, Jussi

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

2013-07-27 Thread James Greene
Isn't that what the NodeIterator and TreeWalker APIs are for? Sincerely, James Greene On Jul 27, 2013 1:25 PM, Ojan Vafai o...@chromium.org wrote: Realized this should probably be a new thread... On Sat, Jul 27, 2013 at 10:58 AM, Ojan Vafai o...@chromium.org wrote: On Thu, Jul 25, 2013

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

2013-07-27 Thread Ojan Vafai
There are many places where we expose SequenceNode or NodeList that can't easily be replaced with hand-rolled DOM walking (e.g. getNamedFlows). You could imagine NodeIterator taking a SequenceNode/NodeList as an argument to it's constructor instead of adding an iterator method, but I find the