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

Re: Opera's Proposal for :context Selector

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Thu, 10 Jul 2008 23:54:40 +0200
Message-ID: <48768520.6080701@lachy.id.au>
To: Andrew Fedoniouk <news@terrainformatica.com>
Cc: www-style <www-style@w3.org>

Andrew Fedoniouk wrote:
> Lachlan Hunt wrote:
>> http://lists.w3.org/Archives/Public/www-archive/2008Jul/att-0019/Overview.html 
> Lachlan, why not to use existing :root pseudo-class for that?

Because Selectors defines :root as:

| The :root pseudo-class represents an element that is the root of the
| document. In HTML 4, this is always the HTML element.

Therefore, reusing :root for this would require redefining it for a 
purpose it was not originally intended for.

> el = container.selectChild(":root > div");
> Standard CSS does lookups from the root element so :root is the root 
> node of the document tree
> and if you are querying subtree of some element then this element is the 
> root for the lookup purposes.

It may be the root of the subtree, but it is not the document's root 
element, which is what :root matches.

> That is if you querying in depth of subtree. When you query parent chain 
> for the parent then :root is the document
> root node:
> el = container.selectParent(":root > body > div");
> will find parent of the element that is root/body/div.

I do not understand what you are trying to say.  What are the 
selectChild() and selectParent() methods you are demonstrating her? 
Where are they defined?  It might be easier if you provided example 
markup to go with the examples, but it would be even easier if you would 
stick with the APIs already being defined in Selectors API.


Lachlan Hunt - Opera Software
Received on Thursday, 10 July 2008 21:55:19 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:38 UTC