[whatwg] getElementsByCSSSelector

Jim Ley jim.ley at gmail.com
Sat Jan 14 10:07:30 PST 2006


On 1/14/06, liorean <liorean at gmail.com> wrote:
> On 14/01/06, Jim Ley <jim.ley at gmail.com> wrote:
> > Could you explain some use cases?
>
> For the very same reason you might want DOM to provide an XPATH
> engine, TreeWalkers or NodeIterators - To get efficient host-native
> filtering of the node tree. In this case, filtering based on a scheme
> used in related technologies. Preferably returning a DOMCollection
> instead of a static array or matches.

The use case for Regular Expressions are clear - I want to detect if a
string is something that is probably a date in a particular format
etc.  The equivalent for a DOM is not clear - if your argument is
purely efficiency - which could be a good one certainly - then you
still need use cases that justify the underlying technique - I want a
nodelist of all things in a document which match a particular CSS
class is not an obvious one to me - every use case I can see for it is
better to simply change the CSS class itself.

Jim.



More information about the whatwg mailing list