Closed Bug 1848196 Opened 2 years ago Closed 2 years ago

Tabbing with the keyboard to focus into <embed>s does not work

Categories

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

defect

Tracking

()

VERIFIED FIXED
118 Branch
Tracking Status
firefox118 --- verified
firefox119 --- verified

People

(Reporter: twisniewski, Assigned: masayuki)

Details

Attachments

(3 files)

Attached file testcase-sub.html

This is possible on Chromium and WebKit 176 (as of https://bugs.webkit.org/show_bug.cgi?id=259420 landing).

I'll attach WebKit's test-case, which makes the problem obvious when testing manually by tabbing multiple times to see if the embed's inputs get focus.

Component: DOM: Navigation → DOM: UI Events & Focus Handling

In HTMLEmbedElement::IsHTMLFocusable(), the default tab index is set to -1 because HTMLEmbedElement does not override TabIndexDefault() different from HTMLObjectElement.

Assignee: nobody → masayuki
Severity: -- → S3
Status: NEW → ASSIGNED

Like <object>, <embed> can load another document. However,
HTMLEmbedElement does not override Element::TabIndexDefault() and that
causes HTMLEmbedElement::IsHTMLFocusable() set the tab index to -1 so
it's skipped during the tab navigation.

Okay, making <embed>.tabIndex return 0 only after loading a subdocument works.

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/1bbf9fc4d2dc Make the default tab index of `<embed>` which loaded a document to `0` r=NeilDeakin,dom-core,farre
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
QA Whiteboard: [qa-118b-p2]

Reproducible on a 2023-08-10 Nightly build on Windows 10.
Verified as fixed on Firefox 118.0b3(20230831180026) and Nightly 119.0a1(20230831214652) on Windows 10, macOS 12, Ubuntu 22.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-118b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: