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

Re: Opera's Proposal for :context Selector

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Fri, 11 Jul 2008 11:36:25 -0700
Message-ID: <4877A829.9040606@terrainformatica.com>
To: Lachlan Hunt <lachlan.hunt@lachy.id.au>
CC: Brad Kemper <brkemper@comcast.net>, www-style <www-style@w3.org>

Lachlan Hunt wrote:
> Brad Kemper wrote:
>> Since querySelector() is still experimental, it can still be changed. 
>> Could the CSS WG say that in the case of selectors that are used in 
>> fragments such as this, that :root refers to the root of the 
>> fragment, in this case the element represented by "foo"? So in that 
>> case the following should do what you want:
>> foo.querySelector(":root div");
> I do not understand the where desire to reuse :root for this is coming 
> from, nor why introducing a new pseudo-class to address the problem 
> instead is in any way bad?
Consider this case
        <p id="foo"><span>...</span></p>

And  foo.querySelector("div span");

Question is: would you expect this function to return anything?
If yes then  *all* selectors inside scoped style sheets *must* be
prepended with the :context. Not quite useful.

element.querySelector() *must* work as if the element is the :root so
is isolated from the rest of the tree.
Otherwise you will get unpredictable errors that is very hard to
catch - in different environments/contexts element.querySelector() will 
different results. Too bad.

Andrew Fedoniouk.

Received on Friday, 11 July 2008 18:37:15 UTC

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