Skip to content

Fix focus related failures due to URL bar being focused on launch#56270

Merged
annevk merged 4 commits intoweb-platform-tests:masterfrom
ogarai:url_bar_focus
Dec 16, 2025
Merged

Fix focus related failures due to URL bar being focused on launch#56270
annevk merged 4 commits intoweb-platform-tests:masterfrom
ogarai:url_bar_focus

Conversation

@ogarai
Copy link
Contributor

@ogarai ogarai commented Nov 25, 2025

Chromium-based browsers automatically focus the URL bar on launch which can prevent focus events from firing. Fix this by ensuring the page has focus first.

Chromium-based browsers automatically focus the URL bar on launch which
can prevent focus events from firing. Fix this by ensuring the page has
focus first and in some cases simply change the expectation to use
document.activeElement instead.

Signed-off-by: Orko Garai <orko@igalia.com>
Signed-off-by: Orko Garai <orko@igalia.com>
@ogarai
Copy link
Contributor Author

ogarai commented Nov 26, 2025

FWIW I'm also looking at making a change via command line flag to not autofocus the URL bar when starting chrome from WPT tests:

If that solution is preferred over this, I can cancel this change.

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

Looks more reasonable now. I'm assuming this doesn't regress the tests in any browser. I hope you checked for that.

@ogarai
Copy link
Contributor Author

ogarai commented Dec 1, 2025

Looks more reasonable now. I'm assuming this doesn't regress the tests in any browser. I hope you checked for that.

Yes, tested firefox, chromium and webkit, if that's okay.

@ogarai
Copy link
Contributor Author

ogarai commented Dec 12, 2025

Can this be merged?

@annevk annevk merged commit 744d45b into web-platform-tests:master Dec 16, 2025
26 checks passed
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.

4 participants

Comments