W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2008

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

From: Ian Hickson <ian@hixie.ch>
Date: Sat, 8 Nov 2008 17:45:02 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0811081731570.1237@hixie.dreamhostps.com>
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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:07 UTC