[whatwg] comment on autofocus attribute from Web Forms 2.0 spec

On Mon, 16 Jun 2008, Adele Peterson wrote:
>
> In HTML5, focus() and blur() are now defined on HTMLElement instead of 
> being restricted to specific form elements.
> 
> In Web Forms 2.0, the autofocus attribute is defined for "any form 
> control (except hidden and output controls)".  It seems like it would 
> make more sense to allow autofocus to be on any HTMLElement, and have it 
> follow the same focusable rules that focus() follows.

While I think this would make sense from a consistency point of view, I 
don't think we want to encourage people to autofocus elements that are not 
built-in controls. The .focus() method is there because otherwise there's 
no way to focus the elements, but autofocus is just a convenience.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Saturday, 8 November 2008 09:45:02 UTC