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

On Nov 16, 2008, at 12:34 PM, Boris Zbarsky wrote:

>> So why would you think it would be less desirable to have  
>> the :focus pseudo-element work in a consistent manner?
>
> Did I ever say that?  Please read what I _did_ say again, carefully.

I have. You implied that window:focus should not be used to indicate a  
focused viewport, because in the DOM it is actually the window object  
that has focus. Ergo, even though body:focus WOULD BE consistent with  
the old, traditional, and familiar way of adding a focus event handler  
to the window via an attribute of the BODY tag, you don't like it  
because it lacks DOM purity. You also derisively suggested that I was  
confused about the difference between the window element of the DOM  
(for which there is no way of specifying focus rules in CSS) and the  
BODY element of HTML mark-up (which does have an actual tag that can  
accept a focus handler).

>> Is there another way of doing this that will select the focused  
>> viewport?
>
> There is not, but perhaps there should be.

What syntax would you prefer then? I kind of like "body:focus", for  
reasons I have explained, but perhaps you have a solution you prefer  
more?

Received on Monday, 17 November 2008 18:27:04 UTC