When is it appropriate to add the HTML5 attribute "autofocus" to a page?

For usability reasons, it may be useful to autofocus on an item such as the search entry form in a search page.

When the main purpose of a page is to search for or add content, it may be appropriate to assume that this is what you want to do and help you access it as quickly as possible.

In Drupal 8, we have trouble solving this problem here:
https://drupal.org/node/2096347

Note that this is not just a Drupal problem, but something we are looking at.

There are very good descriptions:

  • http://www.brucelawson.co.uk/2009/the-accessibility-of-html-5-autofocus/
  • http://webaim.org/blog/future-web-accessibility-html5-input-extensions/
  • https://stackoverflow.com/questions/2180645/is-automatiquement-assigning-focus-bad-for-accessibility/2180679#2180679

Unfortunately, there are no guidelines for knowing when to use HTML5 autofocus properly.

As @Jared says, "Will your users know that they are going to a page with a form and that it is necessary to read a descriptive text before filling in the form? I am a screen reader user and he can be annoying to have I do not understand why your attention is in the Google search field if it bothers me.If my attention was automatically placed in the answer field, every time I consulted a question about Stackoverflow, I would be annoyed because I should have my screen reader leave the form field and go to the top of the page. "

But is it enough?

We want to examine the ease of use and accessibility of autofocus. The page must meet the requirements of WCAG 2.0 AA.