Closed Bug 1775451 Opened 2 years ago Closed 2 years ago

Problem with navigation with keyboard use - Accesibility

Categories

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

Unspecified
All
defect

Tracking

()

RESOLVED FIXED
104 Branch
Tracking Status
firefox-esr91 --- wontfix
firefox-esr102 --- wontfix
firefox101 --- wontfix
firefox102 --- wontfix
firefox103 --- wontfix
firefox104 --- fixed

People

(Reporter: marek.zdybel, Assigned: emilio)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0

Steps to reproduce:

Here is reproduced bug from production:
https://jsfiddle.net/mzdybel/sya5tzfv/95/
Only under Firefox bug is executed.
Try to navigate with keyboard.
After focus with tab key "skip-panel: language" element user are moved to the top of page...

Actual results:

The skip-link element which switched position:absolute to position:static on focus, when user presses TAB key is correctly focused, correctly positioned and visible, but the page jumped to the previous position of that element, not to the current position. As if focus occurs before styles are applied. Surely that is the case in reality, but other browsers do apply styles before and page jump don't happen.

This is also reproducible also on MacOS.
I'm setting a component in order to get the development involved in reviewing this issue.
Feel free to re-set the component if this does not seem the most suitable one.

Thank you for reporting!

Status: UNCONFIRMED → NEW
Component: Untriaged → Layout: Positioned
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → Core
Version: Firefox 101 → Trunk
Attached file Reduced test-case.

What's the use-case to move the .sr-only content to the top and only putting it on its static position on focus?

The issue is that we scroll-into-view right before changing the focus state, while other browsers do it right after.

Flags: needinfo?(marek.zdybel)
Component: Layout: Positioned → DOM: UI Events & Focus Handling

This matches other browsers.

The scroll event is dispatched async, so
the test would mostly pass without the patch, actually, except for the
fact that we wouldn't scroll. So without the patch the test times out.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0a4ba27058a9
Scroll into view after changing focus state, not before. r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/34601 for changes under testing/web-platform/tests

Backed out for causing mochitest failures on test_imestate.html

Another log Fail 2: https://treeherder.mozilla.org/logviewer?job_id=382611529&repo=autoland
Failure line 2: TEST-UNEXPECTED-FAIL | dom/tests/mochitest/general/test_focus_scrollchildframe.html | Scrolled child frame into view

Log 3: https://treeherder.mozilla.org/logviewer?job_id=382612649&repo=autoland
Line 3: TEST-UNEXPECTED-FAIL | layout/forms/test/test_bug446663.html | assertion count 2 is more than expected 0 assertions

Flags: needinfo?(emilio)
Upstream PR was closed without merging
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/84e1b52befea
Scroll into view after changing focus state, not before. r=smaug
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: