Re: [SelectorsAPI] Selector detection needed?

On Mon, 07 Apr 2008 14:54:17 +0200, Daniel Glazman  
<> 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

Received on Monday, 7 April 2008 13:00:35 UTC