Backout 223d4f4bd252 (bug 463491) due to a regression (bug 679961). a=LegNeato
authorChristian Legnitto <clegnitto@mozilla.com>
Mon, 31 Oct 2011 16:39:32 -0700
changeset 79272 3f481ad8d6ac8c3fbca084a88cc235aba07dba8e
parent 79271 75ab3bc0ea309589448d2693a683d472ec743021
child 79273 d67013733acba5f356fbe75ac7d1cf6594104d29
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersLegNeato
bugs463491, 679961
milestone9.0
backs out223d4f4bd252fac3ed3591692b84d06f27f010e8
Backout 223d4f4bd252 (bug 463491) due to a regression (bug 679961). a=LegNeato
content/events/src/nsDOMEvent.cpp
dom/tests/browser/Makefile.in
dom/tests/browser/browser_popup_blocker_save_open_panel.js
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -985,16 +985,19 @@ nsDOMEvent::GetEventPopupControlState(ns
     // while handling user input. See
     // nsPresShell::HandleEventInternal() for details.
     if (nsEventStateManager::IsHandlingUserInput()) {
       switch(aEvent->message) {
       case NS_FORM_CHANGE :
         if (::PopupAllowedForEvent("change"))
           abuse = openControlled;
         break;
+      case NS_XUL_COMMAND:
+        abuse = openControlled;
+        break;
       }
     }
     break;
   case NS_KEY_EVENT :
     if (NS_IS_TRUSTED_EVENT(aEvent)) {
       PRUint32 key = static_cast<nsKeyEvent *>(aEvent)->keyCode;
       switch(aEvent->message) {
       case NS_KEY_PRESS :
--- a/dom/tests/browser/Makefile.in
+++ b/dom/tests/browser/Makefile.in
@@ -48,14 +48,13 @@ include $(topsrcdir)/config/rules.mk
 		browser_focus_steal_from_chrome.js \
 		browser_focus_steal_from_chrome_during_mousedown.js \
 		browser_autofocus_background.js \
 		browser_ConsoleAPITests.js \
 		test-console-api.html \
 		browser_ConsoleStorageAPITests.js \
 		browser_ConsoleStoragePBTest.js \
 		browser_autofocus_preference.js \
-		browser_popup_blocker_save_open_panel.js \
 		browser_bug396843.js \
 		$(NULL)
 
 libs::	$(_BROWSER_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
deleted file mode 100644
--- a/dom/tests/browser/browser_popup_blocker_save_open_panel.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * In this test, we call the save panel with CTRL+S. When shown, we load a
- * webpage that is going to open malicious popups. These popups should be
- * disallowed.
- */
-
-var gLoaded = false;
-
-Cc["@mozilla.org/moz/jssubscript-loader;1"]
-  .getService(Ci.mozIJSSubScriptLoader)
-  .loadSubScript("chrome://mochitests/content/browser/toolkit/content/tests/browser/common/mockObjects.js",
-                 this);
-
-function MockFilePicker() { }
-
-MockFilePicker.prototype = {
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIFilePicker]),
-
-  init: function() { },
-
-  appendFilters: function(val) { },
-  appendFilter: function(val) { },
-
-  // constants
-  modeOpen: 0,
-  modeSave: 1,
-  modeGetFolder: 2,
-  modeOpenMultiple: 3,
-  returnOK: 0,
-  returnCancel: 1,
-  returnReplace: 2,
-  filterAll: 1,
-  filterHTML: 2,
-  filterText: 4,
-  filterImages: 8,
-  filterXML: 16,
-  filterXUL: 32,
-  filterApps: 64,
-  filterAllowURLs: 128,
-  filterAudio: 256,
-  filterVideo: 512,
-
-  // properties
-  defaultExtension: "",
-  defaultString: "",
-  get displayDirectory() { return null; },
-  set displayDirectory(val) { },
-  file: null,
-  get files() { return null; },
-  get fileURL() { return null; },
-  filterIndex: 0,
-
-  show: function() {
-    gBrowser.selectedTab.linkedBrowser.addEventListener("load", function () {
-      gBrowser.selectedTab.linkedBrowser.removeEventListener("load", arguments.callee, true);
-      executeSoon(function() {
-        gLoaded = true;
-      });
-    }, true);
-
-    gBrowser.selectedTab.linkedBrowser.loadURI("data:text/html,<!DOCTYPE html><html><body onload='window.open(\"about:blank\", \"\", \"width=200,height=200\");'></body></html>");
-
-    let curThread = Components.classes["@mozilla.org/thread-manager;1"]
-                              .getService().currentThread;
-    while (!gLoaded) {
-      curThread.processNextEvent(true);
-    }
-
-    return this.returnCancel;
-  },
-};
-
-function test() {
-  waitForExplicitFinish();
-
-  var mockFilePickerRegisterer =
-    new MockObjectRegisterer("@mozilla.org/filepicker;1", MockFilePicker);
-  mockFilePickerRegisterer.register();
-
-  var prefs = Components.classes["@mozilla.org/preferences-service;1"]
-            .getService(Components.interfaces.nsIPrefBranch);
-  var gDisableLoadPref = prefs.getBoolPref("dom.disable_open_during_load");
-  prefs.setBoolPref("dom.disable_open_during_load", true);
-
-  gBrowser.addEventListener("DOMPopupBlocked", function() {
-    gBrowser.removeEventListener("DOMPopupBlocked", arguments.callee, true);
-    ok(true, "The popup has been blocked");
-    prefs.setBoolPref("dom.disable_open_during_load", gDisableLoadPref);
-
-    mockFilePickerRegisterer.unregister();
-
-    finish();
-  }, true)
-
-  if (navigator.platform.indexOf("Mac") == 0) {
-    // MacOS use metaKey instead of ctrlKey.
-    EventUtils.synthesizeKey("s", { metaKey: true, });
-  } else {
-    EventUtils.synthesizeKey("s", { ctrlKey: true, });
-  }
-}