Closed Bug 1913611 Opened 1 year ago Closed 1 year ago

The buttons property of contextmenu events is always 0 on Windows/Linux

Categories

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

Firefox 129
Desktop
All
defect

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox129 --- wontfix
firefox130 --- fixed
firefox131 --- fixed

People

(Reporter: michael_773, Assigned: masayuki)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

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

Steps to reproduce:

An addon I have has a feature where I can press right click while holding left click to trigger things to happen. This is generally called a rocker gesture.

Prior to today, event.buttons was 1 whenever I did this, indicating left click was held.

Pasting this line into the console is enough to reproduce the effect.

document.addEventListener("contextmenu", event => console.log(event.buttons));

Actual results:

event.buttons returns 0 when I press right click while holding left click.

Expected results:

event.buttons should be 1 when I press right click while holding left click.

Component: Untriaged → DOM: UI Events & Focus Handling
Product: Firefox → Core
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Unspecified → Windows
Hardware: Unspecified → Desktop
Summary: The buttons property of contextmenu events is always 0. → The buttons property of contextmenu events is always 0 on Windows

Ah, this is a regression of bug 1675847.

Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Keywords: regression
Regressed by: 1675847

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

Linux build also has same bug, but macOS build does not.

OS: Windows → All
Summary: The buttons property of contextmenu events is always 0 on Windows → The buttons property of contextmenu events is always 0 on Windows/Linux

They do it only when given event class is expected one but they don't include
ePointerEventClass which is newly used for eContextMenu event since
bug 1675847.

Attachment #9419902 - Attachment description: Bug 1913611 - Make `ModifierKeyState::InitInputEvent` and `KeymapWrapper::InitInputEvent` set `WidgetMouseEventBase::mButtons` r=smaug! → Bug 1913611 - Make `ModifierKeyState::InitInputEvent` and `KeymapWrapper::InitInputEvent` set `WidgetMouseEventBase::mButtons` of `eContextMenu` r=smaug!
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/2ce2b8c89f13 Make `ModifierKeyState::InitInputEvent` and `KeymapWrapper::InitInputEvent` set `WidgetMouseEventBase::mButtons` of `eContextMenu` r=smaug
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch

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

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox130 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(masayuki)

Comment on attachment 9419902 [details]
Bug 1913611 - Make ModifierKeyState::InitInputEvent and KeymapWrapper::InitInputEvent set WidgetMouseEventBase::mButtons of eContextMenu r=smaug!

Beta/Release Uplift Approval Request

  • User impact if declined: Web apps which refer MouseEvent.buttons of click/auxclick/contextmenu may not work on Windows and Linux. However, it's rare to refer it due to detecting chorded buttons operation of pointing device.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Just added to make the value initialized when the event is WidgetPointerEvent class which is newly used for click/autclick/contextmenu events (which were WidgetMouseEvent before).
  • String changes made/needed:
  • Is Android affected?: No
Flags: needinfo?(masayuki)
Attachment #9419902 - Flags: approval-mozilla-beta?
Flags: in-testsuite+

Comment on attachment 9419902 [details]
Bug 1913611 - Make ModifierKeyState::InitInputEvent and KeymapWrapper::InitInputEvent set WidgetMouseEventBase::mButtons of eContextMenu r=smaug!

Approved for 130.0rc1.

Attachment #9419902 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: