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

Re: Opera's Proposal for :context Selector

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Fri, 11 Jul 2008 01:48:13 +0200
To: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Cc: www-style <www-style@w3.org>
Message-ID: <fi6d74pun7042gqrfms83slnim2u6pemio@hive.bjoern.hoehrmann.de>

* Lachlan Hunt wrote:
>> If we do this, we should say that selectors are evaluated in a context,
>> and that the context optionally consists of (among things like default
>> namespace and namespace bindings) an element called the context element
>> and the context element and only the context element matches :context.
>
>Yes, that is basically how it works.  Note that :context does not 
>necessary match the context node, as defined in the proposal.  Rather, 
>it matches a specific element node that is determined based upon what 
>the context node is.

I am saying you should identify the context element directly, rather
than say the object you call querySelector on is the "context node".

>The methods in Selectors API are defined to apply to Document, 
>DocumentFragment and Element nodes.  So, defining behaviour for at least 
>those cases is essential.  Defining behaviour in the case of all other 
>nodes is just making sure there's no holes left behind.

So define that there is no context element for DocumentFragments.
There are so many ways, current and future, to do this, there is no
need to be able to do this with the CSS Query API.

>With the way I was defining the behaviour, I needed a way to refer to 
>the set of elements which could be matched by the the given selector. 
>Rephrasing it in another way, perhaps based on your above suggestion 
>could also work.

That would be better.
-- 
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 Thursday, 10 July 2008 23:48:51 GMT

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