diff --git a/browser/components/customizableui/test/browser_character_encoding_ctrl_click.js b/browser/components/customizableui/test/browser_character_encoding_ctrl_click.js index d2f2684eebbc..57f49f3db5ab 100644 --- a/browser/components/customizableui/test/browser_character_encoding_ctrl_click.js +++ b/browser/components/customizableui/test/browser_character_encoding_ctrl_click.js @@ -4,15 +4,6 @@ "use strict"; add_task(async function test_character_encoding_menu() { - // On macOS, ctrl-click shouldn't open the panel because this normally opens - // the context menu. This happens via the `contextmenu` event which is created - // by widget code, so our simulated clicks do not do so, so we can't test - // anything on macOS. - if (AppConstants.platform == "macosx") { - ok(true, "The test is ignored on Mac"); - return; - } - CustomizableUI.addWidgetToArea( "characterencoding-button", CustomizableUI.AREA_NAVBAR, diff --git a/browser/components/extensions/test/browser/browser_ext_browserAction_click_types.js b/browser/components/extensions/test/browser/browser_ext_browserAction_click_types.js index 22401919bab9..d24deff8beae 100644 --- a/browser/components/extensions/test/browser/browser_ext_browserAction_click_types.js +++ b/browser/components/extensions/test/browser/browser_ext_browserAction_click_types.js @@ -59,16 +59,6 @@ add_task(async function test_clickData() { for (let modifier of Object.keys(map)) { for (let i = 0; i < 2; i++) { - // On Mac, ctrl-click will send a context menu event from the widget, - // we won't send xul command event and won't have onClick message, either. - if ( - AppConstants.platform == "macosx" && - i == 0 && - modifier == "ctrlKey" - ) { - continue; - } - let clickEventData = { button: i }; clickEventData[modifier] = true; await clickBrowserAction(extension, window, clickEventData); diff --git a/layout/xul/nsButtonBoxFrame.cpp b/layout/xul/nsButtonBoxFrame.cpp index 9257704fe452..e0ce1089ed23 100644 --- a/layout/xul/nsButtonBoxFrame.cpp +++ b/layout/xul/nsButtonBoxFrame.cpp @@ -155,15 +155,7 @@ nsresult nsButtonBoxFrame::HandleEvent(nsPresContext* aPresContext, case eMouseClick: { WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent(); - - if (mouseEvent->IsLeftClickEvent() -#ifdef XP_MACOSX - // On Mac, ctrl-click will send a context menu event from the widget, - // so we don't want to dispatch widget command if it is redispatched - // from the mouse event with ctrl key is pressed. - && !mouseEvent->IsControl() -#endif - ) { + if (mouseEvent->IsLeftClickEvent()) { MouseClicked(mouseEvent); } break; diff --git a/layout/xul/nsResizerFrame.cpp b/layout/xul/nsResizerFrame.cpp index 3e5f5e100051..fd96241806e1 100644 --- a/layout/xul/nsResizerFrame.cpp +++ b/layout/xul/nsResizerFrame.cpp @@ -286,14 +286,7 @@ nsresult nsResizerFrame::HandleEvent(nsPresContext* aPresContext, case eMouseClick: { WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent(); - if (mouseEvent->IsLeftClickEvent() -#ifdef XP_MACOSX - // On Mac, ctrl-click will send a context menu event from the widget, - // so we don't want to dispatch widget command if it is redispatched - // from the mouse event with ctrl key is pressed. - && !mouseEvent->IsControl() -#endif - ) { + if (mouseEvent->IsLeftClickEvent()) { MouseClicked(mouseEvent); } break; diff --git a/layout/xul/nsTitleBarFrame.cpp b/layout/xul/nsTitleBarFrame.cpp index d671741f56fd..749bf931d199 100644 --- a/layout/xul/nsTitleBarFrame.cpp +++ b/layout/xul/nsTitleBarFrame.cpp @@ -134,14 +134,7 @@ nsresult nsTitleBarFrame::HandleEvent(nsPresContext* aPresContext, case eMouseClick: { WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent(); - if (mouseEvent->IsLeftClickEvent() -#ifdef XP_MACOSX - // On Mac, ctrl-click will send a context menu event from the widget, - // so we don't want to dispatch widget command if it is redispatched - // from the mouse event with ctrl key is pressed. - && !mouseEvent->IsControl() -#endif - ) { + if (mouseEvent->IsLeftClickEvent()) { MouseClicked(mouseEvent); } break; diff --git a/layout/xul/test/test_resizer_ctrl_click.xhtml b/layout/xul/test/test_resizer_ctrl_click.xhtml index 6321c46e7f0a..3b1e575e8be1 100644 --- a/layout/xul/test/test_resizer_ctrl_click.xhtml +++ b/layout/xul/test/test_resizer_ctrl_click.xhtml @@ -27,8 +27,7 @@ function test_resizer_ctrl_click() resizer.addEventListener("click", function(aEvent) { // Delay check for command event, because it is fired after click event. setTimeout(() => { - is(isCommandFired, AppConstants.platform != "macosx", - "Check if command event is fired"); + ok(isCommandFired, "Check if command event is fired"); SimpleTest.finish(); }, 0); }); diff --git a/layout/xul/test/test_titlebar_ctrl_click.xhtml b/layout/xul/test/test_titlebar_ctrl_click.xhtml index d58bfa7eb7e4..41634086d087 100644 --- a/layout/xul/test/test_titlebar_ctrl_click.xhtml +++ b/layout/xul/test/test_titlebar_ctrl_click.xhtml @@ -29,8 +29,7 @@ function test_titlebar_ctrl_click() titlebar.addEventListener("click", function(aEvent) { // Delay check for command event, because it is fired after click event. setTimeout(() => { - is(isCommandFired, AppConstants.platform != "macosx", - "Check if command event is fired"); + ok(isCommandFired, "Check if command event is fired"); SimpleTest.finish(); }, 0); }); diff --git a/layout/xul/test/test_toolbarbutton_ctrl_click.xhtml b/layout/xul/test/test_toolbarbutton_ctrl_click.xhtml index b09300dc4f16..62463ff256ce 100644 --- a/layout/xul/test/test_toolbarbutton_ctrl_click.xhtml +++ b/layout/xul/test/test_toolbarbutton_ctrl_click.xhtml @@ -27,8 +27,7 @@ function test_resizer_ctrl_click() toolbarbutton.addEventListener("click", function(aEvent) { // Delay check for command event, because it is fired after click event. setTimeout(() => { - is(isCommandFired, AppConstants.platform != "macosx", - "Check if command event is fired"); + ok(isCommandFired, "Check if command event is fired"); SimpleTest.finish(); }, 0); });