- From: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
- Date: Sat, 25 Feb 2012 02:22:09 +0100
- To: "Marat Tanalin|tanalin.com" <mtanalin@yandex.ru>
- Cc: Ian Hickson <ian@hixie.ch>, Danny Ayers <danny.ayers@gmail.com>, HTML WG <public-html@w3.org>
Marat Tanalin|tanalin.com, Sat, 25 Feb 2012 01:42:42 +0400: > 25.02.2012, 00:19, "Ian Hickson" <ian@hixie.ch>: > Autofocus is actually one of HTML5 features that can be most easily > implemented with JavaScript, and I personally use it by default in > _each_ form that needs autofocusing (feedback forms, admin > interfaces, etc.). Autofocus is simpler to define for form elements than for non-form elements, for a very simple reason: For form elements, it is already known what 'setting focus' means. But for non-form elements, then only Internet Explorer has a sensible implementation: * CSS wise: Provided the element's is scrollable, then the element reacts to *:focus{background:Red} * Keyboard navigation: Setting focus to a scrollable element means that the element becomes keyboard scrollable via the usual means - on a desktop computer, typically via the space key. The CSS is only implemented in IE. The keyboard navigation is implemented in Webkit and IE, last I checked. In Firefox it can be achieved via a hack. In Opera I don't think it is possible to hack it. When I think about it, this issue should be split in 3: 1. The autofocus issue 2. The 'what focus means for scrollable non-form elements' issue. 3. The 'what focus means for *non*-scrollable non-forms elements' issue. Regarding the 3rd point, then that is at least an issue in Webkit: https://bugs.webkit.org/show_bug.cgi?id=17450 -- Leif Halvard Silli
Received on Saturday, 25 February 2012 01:22:42 UTC