Closed Bug 1615732 Opened 4 years ago Closed 4 years ago

`mousedown` events for Control + left-mouse-button report different `button` value than other browsers on Mac

Categories

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

Unspecified
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: edgar, Assigned: edgar)

References

(Blocks 2 open bugs, Regressed 1 open bug)

Details

Attachments

(7 files)

Steps to reproduce:
Open https://jsfiddle.net/7d4r61p8/1/, press and hold the control button and click the left mouse button.

Actual results:
Firefox shows mousedown, button=2, buttons=1, ctrlKey=true.

Expected results:
All other browsers (Safari, Chrome, Edge) show mousedown, button=0, buttons=1, ctrlKey=true.

Blocks: 1504210
Assignee: nobody → echen

Try result looks good, however, we need to modify the front end code, given that it only checks button to decide whether we should show popup or context-menu, see https://searchfox.org/mozilla-central/rev/cc0f9906505d0ffa0d3a29a80142379e21cb5fb2/browser/components/customizableui/content/panelUI.js#383.

On Mac, ctrl-click will send a context menu event from the widget, so we don't
want to bring up the panel when ctrl key is pressed.

On Mac, ctrl-click will send a context menu event from the widget, so we don't
want to bring up the panel when ctrl key is pressed.

On Mac, ctrl-click will send a context menu event from the widget, so we don't
want to bring up the panel when ctrl key is pressed.

On Mac, ctrl-click will send a context menu event from the widget, so we don't
want to bring up the panel when ctrl key is pressed.

Attachment #9136643 - Attachment description: Bug 1615732 - Don't handle click event on Mac when ctrl key is pressed; → Bug 1615732 - Don't handle xul command event on Mac if it is dispatched from mouse event with ctrl key is pressed;
Attachment #9136643 - Attachment description: Bug 1615732 - Don't handle xul command event on Mac if it is dispatched from mouse event with ctrl key is pressed; → Bug 1615732 - Don't dispatch xul command event on Mac if it is from mouse event with ctrl key is pressed;
Pushed by echen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fa861e50f198
Don't treat control-left-click on mac as a right-click; r=masayuki
https://hg.mozilla.org/integration/autoland/rev/fcd441a2a860
Don't show page action panel on Mac when ctrl key is pressed; r=Gijs
https://hg.mozilla.org/integration/autoland/rev/f648cf0653a7
Don't show menu panel on Mac when ctrl key is pressed; r=Gijs
https://hg.mozilla.org/integration/autoland/rev/d7c5824d4579
Don't show download panel on Mac when ctrl key is pressed; r=Gijs
https://hg.mozilla.org/integration/autoland/rev/bbcb173e6c44
Don't show menu on Mac when ctrl key is pressed; r=NeilDeakin
https://hg.mozilla.org/integration/autoland/rev/297d82b338dc
Don't handle click event on Mac when ctrl key is pressed; r=Gijs
https://hg.mozilla.org/integration/autoland/rev/031b8abf43a8
Don't dispatch xul command event on Mac if it is from mouse event with ctrl key is pressed; r=Gijs,NeilDeakin

Backed out for bc failures on browser_ext_pageAction_click_types.js.

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&resultStatus=testfailed%2Cbusted%2Cexception&revision=031b8abf43a88d5fee5f46fc5ded61a140069122&selectedJob=296488201

Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=296488201&repo=autoland

Backout link: https://hg.mozilla.org/integration/autoland/rev/0f304cbe484384efcebe5451887fc88ff6e7386a

task 2020-04-06T20:33:55.236Z] 20:33:55     INFO - TEST-PASS | browser/components/extensions/test/browser/browser_ext_pageAction_click_types.js | No unnecessary modifiers for exactly one key on event - 
[task 2020-04-06T20:33:55.236Z] 20:33:55     INFO - TEST-PASS | browser/components/extensions/test/browser/browser_ext_pageAction_click_types.js | Correct modifier on click event - 
[task 2020-04-06T20:33:55.236Z] 20:33:55     INFO - Buffered messages finished
[task 2020-04-06T20:33:55.236Z] 20:33:55     INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_pageAction_click_types.js | Test timed out - 
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_pageAction_click_types.js | no tasks awaiting on messages - Got ["onClick"], expected []
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - Stack trace:
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - chrome://mochikit/content/browser-test.js:test_is:1320
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:ExtensionTestUtils.loadExtension/<:36
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - chrome://mochikit/content/browser-test.js:nextTest:570
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - chrome://mochikit/content/browser-test.js:timeoutFn:1183
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - setTimeout handler*chrome://mochikit/content/browser-test.js:Tester_execTest:1130
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:925
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:918
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_pageAction_click_types.js | Extension left running at test shutdown - 
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - Stack trace:
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - chrome://mochikit/content/browser-test.js:test_ok:1292
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:ExtensionTestUtils.loadExtension/<:117
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - chrome://mochikit/content/browser-test.js:nextTest:570
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - chrome://mochikit/content/browser-test.js:timeoutFn:1183
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - setTimeout handler*chrome://mochikit/content/browser-test.js:Tester_execTest:1130
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:925
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:918
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - GECKO(1650) | MEMORY STAT | vsize 8179MB | residentFast 702MB | heapAllocated 218MB
[task 2020-04-06T20:33:55.242Z] 20:33:55     INFO - TEST-OK | browser/components/extensions/test/browser/browser_ext_pageAction_click_types.js | took 90109ms
Flags: needinfo?(echen)
Pushed by echen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/73a09ded8610
Don't treat control-left-click on mac as a right-click; r=masayuki
https://hg.mozilla.org/integration/autoland/rev/0927b858db99
Don't show page action panel on Mac when ctrl key is pressed; r=Gijs
https://hg.mozilla.org/integration/autoland/rev/1110754652d1
Don't show menu panel on Mac when ctrl key is pressed; r=Gijs
https://hg.mozilla.org/integration/autoland/rev/b122d93502a9
Don't show download panel on Mac when ctrl key is pressed; r=Gijs
https://hg.mozilla.org/integration/autoland/rev/6921c42c9682
Don't show menu on Mac when ctrl key is pressed; r=NeilDeakin
https://hg.mozilla.org/integration/autoland/rev/69785d2dfbf2
Don't handle click event on Mac when ctrl key is pressed; r=Gijs
https://hg.mozilla.org/integration/autoland/rev/d8726d18021e
Don't dispatch xul command event on Mac if it is from mouse event with ctrl key is pressed; r=Gijs,NeilDeakin
Regressions: 1385882
Regressions: 1630828
Blocks: 1630959
Regressions: 1638872
Regressions: 1703208
Depends on: 1703518
Regressions: 1706970
Depends on: 1708680
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: