Backout 223d4f4bd252 (bug 463491) due to a regression (bug 679961). a=LegNeato

This commit is contained in:
Christian Legnitto 2011-10-31 16:39:32 -07:00
parent d7fe093722
commit 72fefb3b42
3 changed files with 3 additions and 57 deletions

View File

@ -998,6 +998,9 @@ nsDOMEvent::GetEventPopupControlState(nsEvent *aEvent)
if (::PopupAllowedForEvent("change"))
abuse = openControlled;
break;
case NS_XUL_COMMAND:
abuse = openControlled;
break;
}
}
break;

View File

@ -53,7 +53,6 @@ _BROWSER_FILES = \
browser_ConsoleStorageAPITests.js \
browser_ConsoleStoragePBTest.js \
browser_autofocus_preference.js \
browser_popup_blocker_save_open_panel.js \
browser_bug396843.js \
$(NULL)

View File

@ -1,56 +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;
var MockFilePicker = SpecialPowers.MockFilePicker;
function onShowCallback() {
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);
}
MockFilePicker.returnValue = MockFilePicker.returnCancel;
};
function test() {
waitForExplicitFinish();
MockFilePicker.reset();
MockFilePicker.showCallback = onShowCallback;
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);
MockFilePicker.reset();
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, });
}
}