Closed Bug 1811129 Opened 2 years ago Closed 11 months ago

Implement new dialog initial focus algorithm

Categories

(Core :: DOM: UI Events & Focus Handling, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: jarhar, Assigned: sefeng)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36

Expected results:

We are speccing a new initial focus steps for the dialog element here: https://github.com/whatwg/html/pull/8199
Tests are here: https://github.com/web-platform-tests/wpt/pull/36831

The Bugbug bot thinks this bug should belong to the 'Core::DOM: UI Events & Focus Handling' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: UI Events & Focus Handling
Product: Firefox → Core
Assignee: nobody → sefeng

The main changes of the new algorithm are

  • Make the dialog focusing steps look at sequentially focusable elements instead of any focusable element.
  • Make the dialog element itself get focus if it has the autofocus attribute set.
  • Make the dialog element itself get focus as a fallback instead of focus being "reset" to the body element.

Spec PR (merged): https://github.com/whatwg/html/pull/8199

Pushed by sefeng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cbf5ea1b17d2
Implement the new dialog initial focus algorithm r=emilio

Backed out for causing failures on modal-dialog-backdrop-opacity.html, content-visibility-with-top-layer-006.html, browser_quicksuggest_onboardingDialog.js

Backout link

Push with failures - Wr
Push with failures - wpt
Push with failures - bc

Failure log - Wr
Failure log - wpt
Failure log - bc

Flags: needinfo?(sefeng)

Given the <dialog> itself becomes focusable, the expected focusing
order has been changed.

Pushed by sefeng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/94d3ff1570f4
Implement the new dialog initial focus algorithm r=emilio
https://hg.mozilla.org/integration/autoland/rev/f41311ee4ade
Update quicksuggestOnboarding.html to reflect the latest <dialog> focusing algorithm changes r=adw
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/41289 for changes under testing/web-platform/tests
Flags: needinfo?(sefeng)
Status: UNCONFIRMED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
Upstream PR merged by moz-wptsync-bot
Regressions: 1856109
Regressions: 1859346
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: