Closed Bug 1794850 Opened 2 years ago Closed 2 years ago

Menu items in toolbar panels start blinking when you right-click them, **only after** they've been tabbed across

Categories

(Firefox :: Toolbars and Customization, defect, P1)

defect

Tracking

()

VERIFIED FIXED
108 Branch
Tracking Status
firefox108 --- verified
firefox109 --- verified

People

(Reporter: dholbert, Assigned: emilio)

References

Details

Attachments

(1 file)

(not entirely sure whether this is a DOM focus-handling bug, vs. a frontend bug, vs. a style system bug, vs. something else. Starting off in Toolbars&Customization, and CC'ing some folks who might have thoughts)

STR:

  1. Use "Customize Toolbar" to place the History menu-button (looks like a little clock) on your toolbar.

  2. Click the History icon on your toolbar (the one you just placed) to open its menu, and mouse over the bottom option, called "Manage History". Right click it and verify that there's no visual effect from that right-click action.

  3. Now, with the menu still open, press "Tab" to cycle through that menu's options. Make sure that "Tab" traverses across that final "Manage History" option (though you can leave it focusing some other menu item).

  4. Close and reopen the menu (e.g. by clicking elsewhere and clicking the toolbar icon again.)

  5. Once again, mouse over "Manage HIstory" and right-click. What happens?

EXPECTED RESULTS:
No visual change for the right-click action, just as in step 2.

ACTUAL RESULTS:
The menu item flashes (showing its :active styling I think), just as it would if I left-clicked it.

It seems that tabbing across this menu item causes some persistent change that makes it flash its active style when right-clicked, despite the fact that the right-click action doesn't actually activate it in any way.

I can dig, but it's the DOM state which doesn't change before tabbing, but changes after (verified via setInterval(() => console.log(toolbarbutton.matches(":active")), ...)...

Flags: needinfo?(emilio)

So this is kind of a XUL / front-end interaction quirk. What sets the content state is this line. But why is it different if you've tabbed already or not? That's because of this code which lazily sets tabindex="-1" on the element, making it focusable.

So:

  • Maybe all buttons should be focusable like HTML buttons?
  • Maybe we should just not set the :active state?

I don't know why the context menu event would focus the closest ancestor. Olli this goes back to the focus manager and bug 605242 etc... Do you have opinions?

Flags: needinfo?(emilio) → needinfo?(smaug)

Doesn't match HTML behavior, and our UI is inconsistent on whether some
elements triggering context menus are focusable or not.

Remove one semi-random source of :active state changes.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dbb66b295ab2
Remove nsXULPopupListener::FireFocusOnTargetContent. r=smaug
Severity: -- → S3
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
Flags: qe-verify+

Reproduced on a 2022-10-12 Nightly build on Ubuntu 22 with the STR from Comment 0. Verified as fixed on Firefox 108.0b4(build ID: 20221120185746) and Nightly 109.0a1(build ID: 20221120214001) on Ubuntu 22. Could not reproduce on macOS nor Windows.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

Clearing this old leftover needinfo.

Flags: needinfo?(smaug)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: