W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2013

RE: [DOM4] Short and Efficent DOM Traversal

From: François REMY <francois.remy.dev@outlook.com>
Date: Sun, 28 Jul 2013 04:43:40 +0200
Message-ID: <DUB120-W423AAC13318A98A5CAAB3BA5540@phx.gbl>
To: Ojan Vafai <ojan@chromium.org>
CC: DOM WG <www-dom@w3.org>, "public-webapps@w3.org" <public-webapps@w3.org>
> From: ojan@chromium.org
> An alternate proposal: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-July/040264.html. 
> var iterator = document.querySelectorAll("abc").asIterator();

You make the assumption I want to walk in the forward direction and do not want to start from a specific node. In my case, I want to start from a node and find the next/previous one (in DOM order) that matches some condition, so your solution isn't any useful to me.

Also, the concept of lazy list that doesn't get computed looks slightly weird to me, because qSA/getEB* are static list so they would need to be computed as soon as you make any DOM change, even if it just happens the list only exists in memory because the GC didn't collect it. Honestly, I don't see how that could work, except if calling .iterator() destroys the list (ie: make it empty if it had been computed, remove it from the compute queue otherwise) but this seems fragile to me. 		 	   		  
Received on Sunday, 28 July 2013 02:44:10 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:37:03 UTC