This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
There are currently at least 2 ways to set initial focus upon document load. The document itself can define an element to (scroll to and) focus by using the autofocus attribute [1] (limited to form elements). The user can define the element to (scroll to and) focus by using a URL fragment identifier [2]. The specification does not define order of processing autofocus and fragment identifiers. Blink [3] prefers the autofocus attribute. Gecko [4] and WebKit [5] prefer :target but show bugs in doing so. Trident (IE11) prefers :target without bugs. In my opinion Microsoft got this one right. A URL fragment identifier can be argued to be user-input, where autofocus is a document's default state. User input should be more important. I propose to add a note to the autofocus [1] spec saying that fragment identifiers [2] have precedence. [1] http://www.w3.org/html/wg/drafts/html/master/forms.html#autofocusing-a-form-control:-the-autofocus-attribute [2] http://www.w3.org/html/wg/drafts/html/master/browsers.html#scroll-to-fragid [3] https://code.google.com/p/chromium/issues/detail?id=382901 [4] https://bugzilla.mozilla.org/show_bug.cgi?id=840187 [5] https://bugs.webkit.org/show_bug.cgi?id=140963
Re-prioritizing per implementer feedback but noting this us simply editorial.
HTML5.1 Bugzilla Bug Triage: Moved to Github issue: https://github.com/w3c/html/issues/277 To file additional issues please use the W3C HTML5 Issue tracker: https://github.com/w3c/html/issues/new Thanks!