The buttons property of contextmenu events is always 0 on Windows/Linux
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
| 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)
|
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
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.
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
Indeed, but it's odd, we initialize .buttons as expected...
https://searchfox.org/mozilla-central/rev/e51b2630b44a8836a7ff35a876a2d8b555041d4a/widget/windows/nsWindow.cpp#5424,5454-5457
https://searchfox.org/mozilla-central/rev/e51b2630b44a8836a7ff35a876a2d8b555041d4a/widget/windows/nsWindow.cpp#4282
https://searchfox.org/mozilla-central/rev/e51b2630b44a8836a7ff35a876a2d8b555041d4a/widget/windows/KeyboardLayout.cpp#887,896,912-913,915-916,918-919
It could be a limitation of Windows.
| Assignee | ||
Comment 2•1 year ago
|
||
Ah, this is a regression of bug 1675847.
Comment 3•1 year ago
|
||
Set release status flags based on info from the regressing bug 1675847
| Assignee | ||
Comment 4•1 year ago
|
||
Linux build also has same bug, but macOS build does not.
| Assignee | ||
Comment 5•1 year ago
|
||
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.
Updated•1 year ago
|
Updated•1 year ago
|
Comment 7•1 year ago
|
||
| bugherder | ||
Comment 8•1 year ago
|
||
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-firefox130towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 9•1 year ago
|
||
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.buttonsofclick/auxclick/contextmenumay 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
WidgetPointerEventclass which is newly used forclick/autclick/contextmenuevents (which wereWidgetMouseEventbefore). - String changes made/needed:
- Is Android affected?: No
Updated•1 year ago
|
Comment 10•1 year ago
|
||
Comment on attachment 9419902 [details]
Bug 1913611 - Make ModifierKeyState::InitInputEvent and KeymapWrapper::InitInputEvent set WidgetMouseEventBase::mButtons of eContextMenu r=smaug!
Approved for 130.0rc1.
Updated•1 year ago
|
Comment 11•1 year ago
|
||
| uplift | ||
Description
•