Re: Opera's Proposal for :context Selector

On Jul 14, 2008, at 12:21 AM, Lachlan Hunt wrote:

>
> Brad Kemper wrote:
>> On Jul 13, 2008, at 3:59 PM, Lachlan Hunt wrote:
>>> foo.querySelector(":context div div")
>> But wouldn't (or couldn't) that second one be the same as this:
>> foo.querySelector(":root div div")
>> Then the first one would include divs that were ancestors and/or  
>> descendants of the "foo" fragment.
>
> No.  I already clearly explained several times why :root cannot and  
> will not be redefined.
>
> http://lists.w3.org/Archives/Public/www-style/2008Jul/0197.html
> http://lists.w3.org/Archives/Public/www-style/2008Jul/0203.html
> http://lists.w3.org/Archives/Public/www-style/2008Jul/0221.html

No, you've just repeated that this is a new idea to add to the working  
draft. Like this:

> 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.

Yes, so? In what way is this an argument against its new use to  
describe the root of fragments of HTML (instead of the root of the  
document) when such fragments are suitably isolated from the document,  
as in the JavaScript examples?

The ":root" pseudo-element is one of the most useless constructions  
for HTML ever devised, and this new idea gives it a new chance of  
actually being useful. And avoids introducing a new, very-limited-use  
pseudo-element.
> No, because that would change the way selectors are evaluated  
> against elements, and which ancestor elements are looked at....

> As currently defined and as it is being implemented by browsers...
Yes, it would be a change. That is what we are discussing. I still  
don't hear an argument against it.
> If :root were redefined as you suggest, then so would this would  
> need to as well: foo.querySelector("body :root div");

Yes, so? Being able to insert ":root" between two other selectors is a  
strength, not a weakness. Its not like allowing that would break any  
Web pages other than those experimenting with querySelector. So what's  
actually wrong with having it that way?
> But that is also another reason why :root needs to continue matching  
> the document's root element, rather than the contextual root.

No, its not. Its not a reason at all, just a statement.

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

I do not understand the resistance to reuse :root for this is coming  
from, nor why it is so important to invent a new pseudo-class when a  
very small clarification to this special use of an existing one is  
perfectly adequate, and simple to understand?
> Another problem with redefining :root is that if some browsers ship  
> support querySelector with the new handilng of :root, and others  
> with the current meaning, then that will create interoperability  
> issues because :root will match entirely different elements.
Isn't that why we are discussing it now? Isn't querySelector still in  
Working Draft status[1]? This is not a meaningful argument. Of course  
when an experimental feature is changed, then documents based on it  
will not work the same when the draft is changed. That is an intrinsic  
difference between a WD and a Recommendation. You seem to be saying  
that the spec is frozen for even small changes, simply because there  
is a working draft.



[1] http://www.w3.org/TR/selectors-api/

Received on Monday, 14 July 2008 15:54:08 UTC