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

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

>> It is useful in JavaScript to have the event listening attributes  
>> on the BODY tag
>
> It's "useful" in the sense that it predates the existence of  
> addEventListener.

It is useful in the sense that in the absence of addEventListener, it  
was a reasonable way at the time of abstracting where in the HTML the  
focus would be handled. And since pseudo-classes also do not involve  
addEventListener (or require scripting), and since there is no  
selector for selecting the window, it (the BODY element) would also be  
a reasonable (and familiar) place to us to use a focus pseudo-class.

>> since there is no WINDOW element to use with selectors.
>
> I don't see what this has to do with JavaScript.

Well, it has nothing to do with "addEventListener", which is a bit of  
JavaScript you brought up. It has to do with not re-inventing the  
wheel, and using an abstraction that is already familiar, due to the  
old way of attaching events to the BODY.

Received on Monday, 17 November 2008 17:56:09 UTC