Skip to content

hmtl: Add a test for an autofocus issue with <dialog>#19151

Merged
domenic merged 3 commits intomasterfrom
tkent-dialog-autofocus-twice
Nov 7, 2019
Merged

hmtl: Add a test for an autofocus issue with <dialog>#19151
domenic merged 3 commits intomasterfrom
tkent-dialog-autofocus-twice

Conversation

@tkent-google
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compact and to the point, nice test. LGTM % nit

promise_test(async () => {
const dialog = document.querySelector('dialog');
dialog.show();
assert_equals(document.activeElement, dialog.querySelector('[autofocus]'));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add descriptions so that you tell which assert failed if there's a failure?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@foolip
Copy link
Copy Markdown
Member

foolip commented Sep 19, 2019

Spec change is whatwg/html#4918.

domenic pushed a commit to whatwg/html that referenced this pull request Nov 7, 2019
When the dialog focusing steps are called, we prevent further
autofocusing for the document. This fixes #4788.

Tests: web-platform-tests/wpt#19151
@domenic domenic merged commit 64fff8f into master Nov 7, 2019
@domenic domenic deleted the tkent-dialog-autofocus-twice branch November 7, 2019 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants