Back out bug 1031945 for now because we have silly pref settings on mobile and dumb tests. a=orange

This commit is contained in:
Boris Zbarsky 2014-07-26 03:30:56 -04:00
parent d9e695483d
commit a107e396fa
3 changed files with 2 additions and 21 deletions

View File

@ -4365,21 +4365,6 @@ nsGlobalWindow::IsChromeWindow(JSContext* aCx, JSObject* aObj)
return xpc::WindowOrNull(aObj)->IsChromeWindow();
}
/* static */ bool
nsGlobalWindow::IsShowModalDialogEnabled(JSContext*, JSObject*)
{
static bool sAddedPrefCache = false;
static bool sIsDisabled;
static const char sShowModalDialogPref[] = "dom.disable_window_showModalDialog";
if (!sAddedPrefCache) {
Preferences::AddBoolVarCache(&sIsDisabled, sShowModalDialogPref, false);
sAddedPrefCache = true;
}
return !sIsDisabled;
}
nsIDOMOfflineResourceList*
nsGlobalWindow::GetApplicationCache(ErrorResult& aError)
{
@ -9136,7 +9121,7 @@ nsGlobalWindow::ShowModalDialog(const nsAString& aUrl, nsIVariant* aArgument,
(aUrl, aArgument, aOptions, aError), aError,
nullptr);
if (!IsShowModalDialogEnabled()) {
if (Preferences::GetBool("dom.disable_window_showModalDialog", false)) {
aError.Throw(NS_ERROR_NOT_AVAILABLE);
return nullptr;
}

View File

@ -512,9 +512,6 @@ public:
static bool IsChromeWindow(JSContext* /* unused */, JSObject* aObj);
static bool IsShowModalDialogEnabled(JSContext* /* unused */ = nullptr,
JSObject* /* unused */ = nullptr);
bool DoNewResolve(JSContext* aCx, JS::Handle<JSObject*> aObj,
JS::Handle<jsid> aId,
JS::MutableHandle<JSPropertyDescriptor> aDesc);

View File

@ -79,8 +79,7 @@ typedef any Transferable;
[Throws] DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
[Throws] void print();
//[Throws] any showModalDialog(DOMString url, optional any argument);
[Throws, Func="nsGlobalWindow::IsShowModalDialogEnabled"]
any showModalDialog(DOMString url, optional any argument, optional DOMString options = "");
[Throws] any showModalDialog(DOMString url, optional any argument, optional DOMString options = "");
[Throws, CrossOriginCallable] void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);