W3C home > Mailing lists > Public > www-style@w3.org > April 2008

Re: [SelectorsAPI] Selector detection needed?

From: Anne van Kesteren <annevk@opera.com>
Date: Mon, 07 Apr 2008 14:59:36 +0200
To: "Daniel Glazman" <daniel.glazman@disruptive-innovations.com>, "Bjoern Hoehrmann" <derhoermi@gmx.net>
Cc: "Nicholas C. Zakas" <html@nczonline.net>, www-style@w3.org
Message-ID: <op.t88rpmgv64w2qv@annevk-t60.oslo.opera.com>

On Mon, 07 Apr 2008 14:54:17 +0200, Daniel Glazman  
<daniel.glazman@disruptive-innovations.com> wrote:
> Oh come on. So to test if the childhood combinator ">" is implemented,
> you would query the elements matching a selector like "a > b" ???
> That's a steamroller to kill a fly ! Performance-wise, it's just a
> nightmare ; time-wise in a large document, it's a second nightmare ;
> in terms of footprint, you should pick up a selector generating no
> results for the query.
>
> Björn, that is certainly one of the ugliest hacks ever proposed here...

There's no reason you couldn't do it on an empty document  
(document.implementation.createDocument() iirc). It's also not clear what  
advantage there is trying to feature detect first. As we know from  
hasFeature() and all similar mechanisms, user agents lie because of  
unknown bugs, because they need to get some page to work, et cetera.


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Monday, 7 April 2008 13:00:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:04 GMT