Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autofocus test port #16780

Closed
wants to merge 4 commits into from
Closed

Autofocus test port #16780

wants to merge 4 commits into from

Conversation

domenic
Copy link
Member

@domenic domenic commented May 10, 2019

Supercedes #9440.

@annevk, I am hoping you and @tkent-google can be my review-buddies for these things.

This test fails in Firefox and Safari:

  • Firefox does not move focus from the div. That seems bad.
  • Safari puts focus on the body. I have no idea why it would do that.

I think of the three behaviors, the spec/Chrome behavior is the most reasonable, so I'd like to merge this and file bugs. Let me know if folks disagree. /cc @smaug---- @cdumez.

@domenic
Copy link
Member Author

domenic commented May 10, 2019

Ah, buttons are just not programmatically focusable in Safari. I will use textboxes.

Edit: that doesn't make a difference; Safari still doesn't autofocus. They seem to fail a lot of sibling web platform tests...

@domenic
Copy link
Member Author

domenic commented May 10, 2019

Filed https://bugs.webkit.org/show_bug.cgi?id=197794 for the Safari not firing select bug (the prequisite test here). I'll hold off on filing autofocus bugs until we have more eyes on the test.

@tkent-google
Copy link
Contributor

  • Firefox does not move focus from the div. That seems bad.

Firefox might think the explicit focus() for the div matches to the following condition in the specification though it's not a user indication.
IMO Firefox's behavior is understandable. Ignoring autofocus would be safer because the focus() might have been executed by a user indication.

  1. If the user has indicated (for example, by starting to type in a form control) that they do not wish focus to be changed, then optionally return.

I know Firefox also ignores autofocus if the page is loaded with a fragment. crbug.com/382901

@domenic
Copy link
Member Author

domenic commented May 20, 2019

@annevk, maybe @smaug----, what do you think we should do here? I guess the "optionally return" steps, by a strict reading, make most testing of autofocus="" impossible.

@tkent-google
Copy link
Contributor

I filed a specification issue: whatwg/html#4645

@gsnedders gsnedders closed this Jan 24, 2020
@gsnedders gsnedders deleted the autofocus-test-port branch January 24, 2020 18:02
@gsnedders gsnedders restored the autofocus-test-port branch January 24, 2020 18:42
@Hexcles Hexcles reopened this Jan 24, 2020
@domenic
Copy link
Member Author

domenic commented Oct 25, 2021

Overtaken by whatwg/html#4763 and associated test PR.

@domenic domenic closed this Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants