Bug 433274 - Allow popups from context menu events - part 2, r=smaug
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 12 Feb 2019 15:11:36 +0000
changeset 458852 571569056837
parent 458851 8c306186cbd7
child 458853 93e37c529818
push id35548
push useropoprus@mozilla.com
push dateWed, 13 Feb 2019 09:48:26 +0000
treeherdermozilla-central@93e37c529818 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs433274
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 433274 - Allow popups from context menu events - part 2, r=smaug Differential Revision: https://phabricator.services.mozilla.com/D19500
dom/base/PopupBlocker.cpp
--- a/dom/base/PopupBlocker.cpp
+++ b/dom/base/PopupBlocker.cpp
@@ -313,28 +313,28 @@ PopupBlocker::PopupControlState PopupBlo
             case eMouseDoubleClick:
               if (PopupAllowedForEvent("dblclick")) {
                 abuse = PopupBlocker::openControlled;
               }
               break;
             default:
               break;
           }
-        } else if (aEvent->AsMouseEvent()->button ==
-                   WidgetMouseEvent::eRightButton) {
-          abuse = PopupBlocker::openBlocked;
-          switch (aEvent->mMessage) {
-            case eContextMenu:
-              if (PopupAllowedForEvent("contextmenu")) {
-                abuse = PopupBlocker::openControlled;
-              }
-              break;
-            default:
-              break;
-          }
+        }
+
+        switch (aEvent->mMessage) {
+          case eContextMenu:
+            if (PopupAllowedForEvent("contextmenu")) {
+              abuse = PopupBlocker::openControlled;
+            } else {
+              abuse = PopupBlocker::openBlocked;
+            }
+            break;
+          default:
+            break;
         }
       }
       break;
     case ePointerEventClass:
       if (aEvent->IsTrusted() &&
           aEvent->AsPointerEvent()->button == WidgetMouseEvent::eLeftButton) {
         switch (aEvent->mMessage) {
           case ePointerUp: