web-platform-tests / web-platform-tests/rfcs
Initial focus assumption for tests
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 110
- Forks
- 90
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/web-platform-tests/wpt/commit/bef892c489 replaced window.open() + polling for opening testharness windows with the WebDriver "New Window" command, which doesn't run focusing steps. This inadvertently broke tests that implicitly relied on initial focus, such as:
- https://crrev.com/c/6341204
- https://wpt.fyi/results/navigation-api/focus-reset/change-focus-again-in-blur-during-intercept.html?label=master&label=experimental&aligned&view=interop&q=label%3Ainterop-2025-navigation
- web-platform-tests/wpt#56270
I think we should clarify and maybe document what (if any) initial focus target WPT guarantees. If we decide not to guarantee anything, each test will need to set up its own initial focus target.
As a point of comparison, the Marionette testharness implementation currently provides focus=True, which means "the opened window will be focused" (similar to the pre-bef892c489 WebDriver behavior).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked WebDriver New Window change, the assumptions documentation at web-platform-tests.org/writing-tests/assumptions.html, and the Marionette testharness implementation referenced in the issue. Compare the affected focus-dependent tests and determine whether WPT guarantees an initial focus target or requires each test to establish one. Done means the policy is decided and clearly documented, with affected tests aligned to that decision.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation, testing
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100