Autofocus the search field on the index page.
Autofocus can be annoying for power users or people with special needs. If we're going to do this, please use the HTML5 autofocus attribute instead.
What is the benefit of using the autofocus attribute in this case? What about browsers that do not support HTML5?
Dive Into HTML5 explains the problems with script-based autofocus and provides a polyfill:
Which is in fact the same as the original patch posted on the trac ticket, which I rejected in large part because of the direct use of getElementById which I didn't think was fully portable.
Done, now it uses the 'autofocus' attribute with JS as fallback.
…ribed at http://diveintohtml5.info/forms.html#autofocus.
@tomhughes The polyfill script focuses the input only if the autofocus attribute isn't supported. If it is supported, it does nothing, thus preserving the benefits of that approach.
Yes I know that, just saying I didn't realise the benefit - ie that there was a real gain in using the attribute where it is available.