Open Bug 1714515 Opened 4 years ago Updated 4 years ago

Right-clicking disabled back/forward buttons causes navigation context menu to briefly appear and disappear (it shouldn't appear at all)

Categories

(Firefox :: Menus, defect, P5)

Firefox 91
defect

Tracking

()

Tracking Status
firefox89 --- affected
firefox90 --- affected
firefox91 --- affected

People

(Reporter: aminomancer, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0

Steps to reproduce:

Observed on my normal profile but also reproduced on a brand new profile, 91.0a1 (build 20210601213358) on Windows 10.

  • Open a new tab such that the back/forward navigation buttons in the navbar are disabled.
  • Right click one of them.
  • Might take a few clicks, it flickers so quickly you might miss it half the time.

Actual results:

  • The navigation context menu, with only one menuitem, (the current page) briefly flashes.
  • Then as fast as it opened, it closes.

Expected results:

  • The back/forward buttons' callbacks should not invoke the popup open method until after checking the number of web progress items.
  • Or better yet, since the disabled state of the back/forward buttons is changed automatically by web progress and tab switch listeners, click events should simply not be consumed if the buttons are disabled, just like toolbarKeyNav stops you from "focusing" the buttons when they're disabled. It's weird though because I was under the impression that the disabled attribute should automatically block the event callbacks, no?
  • At the same time, I think hovering the disabled menuitems should still open a tooltip. So not all interaction should be blocked, just click/focus/command.

I guess the disabled attribute doesn't stop the contextmenu event, I tried right-clicking the disabled screenshot button and it opened the toolbar context menu without any hitch. So maybe the gClickAndHoldListenersOnElement._mousedownHandler should have something like if (aEvent.button == 2 && aEvent.currentTarget.disabled) aEvent.preventDefault()

Reproduced on the latest versions of Firefox Nightly 91.0a1 (2021-06-08), beta 90.0b4 and release 89.0.

Setting up flags and adding a component for this issue in order to get the dev team involved.
If you feel it's an incorrect one please feel free to change it to a more appropriate one.
Setting up a severity of S3.

Performing a mozregression I've found the following : 2021-06-08T16:25:45.915000: DEBUG : Found commit message:
Backed out changeset 140002ffa867 (bug 1695807) for causing reftest failures.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Component: Untriaged → Menus
Ever confirmed: true
Severity: S3 → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.