Closed Bug 2049307 Opened 8 days ago Closed 7 days ago

Incorrect tab focus after clicking internal link

Categories

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

Firefox 152
defect

Tracking

()

VERIFIED FIXED
154 Branch
Tracking Status
relnote-firefox --- 152+
firefox-esr140 --- unaffected
firefox152 --- verified
firefox153 --- verified
firefox154 --- verified

People

(Reporter: jakea, Assigned: ltenenbaum)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

https://random-stuff.jakearchibald.com/bug-repros/fragment-focus/

  1. Click "click me" - paragraph should highlight
  2. Press tab to move focus position

The link after the highlighted paragraph should receive focus. In 152 the other link gets focus.

Regressed in: https://hg-edge.mozilla.org/integration/autoland/rev/da409e4fc87748a2e40333b969d4b25eb51aeba3

https://bugzilla.mozilla.org/show_bug.cgi?id=2034851

Regressed by: 2034851

Set release status flags based on info from the regressing bug 2034851

:ltenenbaum, since you are the author of the regressor, bug 2034851, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(ltenenbaum)

Hmm the <a> is blurred after PresShell::GoToAnchor, so even though GoToAnchor sets the selection which clears the starting point, it gets set to the <a> immediately after. But we can fix this by clearing the starting point again after step 6 here. I suspect the reason other browsers don't have this issue is that they are correctly running step 6 before step 7, but we do it out of order intentionally (https://github.com/whatwg/html/issues/7759).

Severity: -- → S3
Flags: needinfo?(ltenenbaum)
Assignee: nobody → ltenenbaum
Status: NEW → ASSIGNED
Pushed by ltenenbaum@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/6d46630b8a71 https://hg.mozilla.org/integration/autoland/rev/592a06561a8a Reset focus navigation starting point after running focusing steps for fragment navigation. r=layout-reviewers,emilio

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/60802 for changes under testing/web-platform/tests

Status: ASSIGNED → RESOLVED
Closed: 7 days ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch
Attachment #9600081 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Quite annoying bug with sequential focus navigation (tab/shift+tab)
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: See comment 0 in the bug
  • Risk associated with taking this patch: low
  • Explanation of risk level: Change is very small and should only affect sequential focus navigation
  • String changes made/needed?: N/A
  • Is Android affected?: yes
Flags: qe-verify+

Putting as wontfix in release for now- if we get lots of reports of this I'm happy to request uplift there too though (the patch is very low-risk).

Upstream PR merged by moz-wptsync-bot

QA Whiteboard: [uplift][qa-ver-needed-c154/b153]
Attachment #9600081 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

I have reproduced this issue using Firefox 153.0a1 (build from 2026.05.20) on Windows 11 and macOS 10.15.
I can confirm this issue is fixed, I verified using latest nightly Firefox 154.0a1 and Firefox 153.0b4 (build from treeherder) on Windows 11, macOS 10.15 and Ubuntu 22.

Status: RESOLVED → VERIFIED
QA Whiteboard: [uplift][qa-ver-needed-c154/b153] → [uplift][qa-ver-done-c154/b153]
Flags: qe-verify+
Duplicate of this bug: 2049283
Duplicate of this bug: 2050428

firefox-release Uplift Approval Request

  • User impact if declined/Reason for urgency: Focus navigation (tab/shift+tab) bug. We have received several bug reports about this already (and the patch is very low-risk)
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: See comment 0 in the bug
  • Risk associated with taking this patch: low
  • Explanation of risk level: Very small change, should only affect sequential focus navigation
  • String changes made/needed?: N/A
  • Is Android affected?: yes
Attachment #9602565 - Flags: approval-mozilla-release?
Flags: qe-verify+
Flags: in-testsuite+
Attachment #9602565 - Flags: approval-mozilla-release? → approval-mozilla-release+

Added to the 152.0.4 relnotes.

I can confirm this issue is fixed, I verified on Firefox 152.0.4 on Windows 11, macOS 10.15 and Ubuntu 22.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: