This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 9548 - autofocus attribute should be ignored after the load event
Summary: autofocus attribute should be ignored after the load event
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-17 15:44 UTC by Mounir Lamouri
Modified: 2010-10-04 14:48 UTC (History)
7 users (show)

See Also:


Attachments

Description Mounir Lamouri 2010-04-17 15:44:24 UTC
As far as i know, the autofocus attribute has been introduced to help focusing an element during the page load. To focus an element after the page load, the javascript focus() method should be enough.
At the moment, inserting an element into the document with the autofocus attribute specified can be used to prevent using focus(). It has the exact same behavior and it may be undesirable for some users.

Ignoring the autofocus attribute after the load event (or the 'DOMContentLoaded' event) would be a good way to prevent abuse of the autofocus attribute.

Note: if bug 9547 is accepted, the issue would be less important but still present.
Comment 1 Ian 'Hixie' Hickson 2010-08-20 19:23:59 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: Doing this would prevent people from using autofocus in documents that load in content onload, which would be unfortunate. We should predicate the usefulness of features on whether people load content synchronously as part of the document source or asynchronously from a separate source (e.g. localStorage).