Re: [css3-selectors] Elements that can have :focus pseudo-class

On Nov 17, 2008, at 5:57 PM, L. David Baron wrote:

> On Monday 2008-11-17 17:46 -0800, Brad Kemper wrote:
>> On Nov 17, 2008, at 3:50 PM, Boris Zbarsky <bzbarsky@MIT.EDU> wrote:
>>> I don't think :root:focus is the right way to do this.  Again,  
>>> because
>>> it already means something, and its behavior would change all of a
>>> sudden.
>>
>> Does it mean anything that makes a difference? Are you concerned that
>> people will have rules in their stylesheets with :root:focus where it
>> doesn't currently have any effect? Isn't :root supposed to always  
>> refer
>
> I think the concern is that people have ":focus" in their style
> sheets (not ":root:focus"), so changing when ":focus" matches the
> root element will have undesired results.

Ah, that makes sense. Thank you L. David for explaining it so clearly.

Is there any chance of getting something into the CSS3 Selectors  
module (in Last Call status) about the window/viewport having focus? I  
suggest the following in 6.6.5, right before the description of  
":root" (I'm not a big fan of using the @ symbol for this):

:window pseudo-class

The :window pseudo-class represents the element that is the viewport  
containing the document. In HTML 4, this is the window or frame object  
of the DOM. There can be only one valid :window pseudo-class per  
selector pattern, as it represents only the most immediate ancestor  
window object.

Examples:

:window body { background: red; }
:window:focus body { background: green; }

/* Cannot determine frame parentage: */
:window:window body { /* selects nothing: */ }
:window :window body { /* selects nothing: */ }

Received on Tuesday, 18 November 2008 17:00:04 UTC