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

Re: [SelectorsAPI] Selector detection needed?

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Mon, 07 Apr 2008 17:28:14 +0200
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Cc: www-style@w3.org
Message-ID: <isekv3tvartiti7m97f2k5ksrerdavh515@hive.bjoern.hoehrmann.de>

* 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" ???

If I want to use them in a query, I would not test anything at all, the
implementation already does that when performing the query. I would not
use this to determine which selectors are supported in style sheets or,
say, in combination with XBL, because that may well vary, so the only
real use case for this I could come up with is a

  Your Browser supports these selectors with the CSS Query API:

    ...
    E > F [ok]
    E + F [no]
    ...

For which I would naturally call the methods on an empty document or
an isolated element. Quite frankly even then this is a lot nicer then
doing something like

  if (document.supportsSelector(DocumentSelector.CSS_TYPE_SELECTOR) &&
      document.supportsSelector(DocumentSelector.CSS_CHILD_COMBINER))
    ...

As has been suggested initially in this thread.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Monday, 7 April 2008 15:35:31 GMT

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