Closed Bug 1878753 Opened 5 months ago Closed 4 months ago

autofocus and elem.focus() don't work for image map 'area' elements

Categories

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

defect

Tracking

()

VERIFIED FIXED
124 Branch
Tracking Status
firefox124 --- verified

People

(Reporter: dholbert, Assigned: sefeng)

References

Details

Attachments

(3 files)

STR:

  1. Load attached testcase.
  2. (optional) Press Enter.

EXPECTED RESULTS:

  • You should see a circular focus-ring drawn over the yellow image.
  • When you press enter, that should activate the focused area's link, which you can confirm by seeing a # get added to the URL shown in your URLbar.

ACTUAL RESULTS:

  • No focus area is drawn.
  • If you press enter, nothing happens.

ADDITIONAL NOTE:
The image/area seems to get sort-of autofocused, because if you press Tab after loading the testcase, you can see that focus moves to "after-textfield" (which implies that the thing just before that textfield was previously focused). And then if you press Shift-Tab to move back, you can see that the image correctly gains focus (at which point pressing enter works correctly).

Attachment #9378388 - Attachment description: testcase 1 → testcase 1, using `autofocus`

Chromium and WebKit give EXPECTED RESULTS.
Firefox Nightly 124.0a1 (2024-02-02) (64-bit) gives ACTUAL RESULTS.

Summary: autofocus and elem.focus() don't work for imagemap 'area' elements → autofocus and elem.focus() don't work for image map 'area' elements
See Also: → 1878755

Sean, have you looked at this stuff recently?

Severity: -- → S3
Flags: needinfo?(sefeng)
Assignee: nobody → sefeng
Attachment #9378781 - Attachment description: WIP: Bug 1878753 - Fix focus gets incorrectly cleared by PresShell::FixUpFocus if the focus is on area element → Bug 1878753 - Fix focus gets incorrectly cleared by PresShell::FixUpFocus if the focus is on area element r=emilio
Status: NEW → ASSIGNED
Pushed by sefeng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/689c94c41471
Fix focus gets incorrectly cleared by PresShell::FixUpFocus if the focus is on area element r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/44476 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
Upstream PR merged by moz-wptsync-bot
Upstream PR merged by moz-wptsync-bot
Flags: needinfo?(sefeng)
Flags: qe-verify+

Reproduced the issue with Firefox 124.0a1 (2024-02-05) on Windows 10x64. After following the steps from comment 0 the focus is not displayed and nothing happens after pressing the Enter key.
The issue is verified fixed with Firefox 124.0b2 on Windows 10x64, macOS 13 and Ubuntu 23.1. The focus is displayed after loading the test case and a # is added to the link after pressing the Enter key.

Status: RESOLVED → VERIFIED
Has STR: --- → yes
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: