Closed Bug 2067629 Opened 4 days ago Closed 7 hours ago

showPopover({ source }) drops the popover from forward sequential focus navigation when source is a text input or contenteditable

Categories

(Core :: DOM: Core & HTML, defect)

Firefox 155
Desktop
Windows 11
defect

Tracking

()

RESOLVED FIXED
157 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox-esr153 --- affected
firefox155 --- wontfix
firefox156 --- fix-optional
firefox157 --- fixed

People

(Reporter: birtles, Assigned: ltenenbaum, NeedInfo)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

Attached file Repro

Steps to reproduce:

  1. Open attached test case.
  2. Press Tab.

Actual results:

Focus moves to the "after" button. The "in popover" button is skipped.

Expected results:

Focus moves to the "in popover" button, as it does in Chrome.

Two separate things should each put it there: the popover follows its source in DOM order, and per spec a popover's contents are visited immediately after its source.

Notes:

  • Changing <input id="source"> -> <button id="source"> works
  • Changing <input id="source"> -> <div id="source" tabindex="0"> works
  • Changing <input id="source"> -> <div id="source" contenteditable="true"> fails, and additionally Shift+Tab from "after" DOES land on "in popover". So the popover is present in the backward order while absent from the forward one.
  • Changing showPopover({ source }) -> showPopover() works. Naming a source is what removes the popover from the position it would otherwise hold in DOM order.
  • Changing popover="manual" -> popover="auto" no difference
  • Moving the popover after the "after" button still fails with a text-entry source, still works with a button source.

Regression range:

  • 143.0 fails for every source type (bug 1984004)
  • 144.0 works for every source type (bug 1984004's fix)
  • 154.0.1 / 155 works for <button> and tabindex; fails for <input> and contenteditable
Regressed by: 1955857

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

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

For more information, please visit BugBot documentation.

Oh, the problem is that <input> has a UA shadow root which takes priority over the popover since that's how it works for non-UA shadow roots: https://html.spec.whatwg.org/#associated-focus-navigation-owner.
So probably we need to separately deal with the cases of UA vs non-UA shadow roots.

Assignee: nobody → ltenenbaum
Status: NEW → ASSIGNED
Flags: needinfo?(ltenenbaum)
Attached file test.html

Here is another similar case which we aren't handling correctly currently: if the popover invoker has children, then they are never visited in sequential focus navigation. Well maybe the right solution here is that when we get to a popover invoker, we should visit the popover, then visit its children or shadow root. That seems to be approximately what Chrome does, although they visit the shadow root before the popover… (The spec says we should use shadow-including tree order to decide which to visit first, but I don't think the position of the popover in the tree should affect its position in focus navigation. Maybe worth filing a spec issue about that: https://github.com/whatwg/html/issues/12871.)

Can we get this bug triaged please? (s/p setting)

Flags: needinfo?(ltenenbaum)
Severity: -- → S3
Flags: needinfo?(ltenenbaum)
Pushed by ltenenbaum@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d9a41916fb5f https://hg.mozilla.org/integration/autoland/rev/35945c4c75ca Include popover invoker children/shadow root in sequential focus navigation. r=edgar
Status: ASSIGNED → RESOLVED
Closed: 7 hours ago
Resolution: --- → FIXED
Target Milestone: --- → 157 Branch

The patch landed in nightly and beta is affected, along with ESR.
:ltenenbaum, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(ltenenbaum)

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

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

Attachment

General

Created:
Updated:
Size: