Skip to content

Commit

Permalink
Bug 1587922 - Remove the remnants of the showModalDialog code; r=smaug
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D48892

--HG--
extra : moz-landing-system : lando
  • Loading branch information
ehsan committed Oct 10, 2019
1 parent 3cb490c commit 1fd1ce7
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 90 deletions.
1 change: 0 additions & 1 deletion dom/base/nsDeprecatedOperationList.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ DEPRECATED_OPERATION(LenientThis)
DEPRECATED_OPERATION(MozGetAsFile)
DEPRECATED_OPERATION(UseOfCaptureEvents)
DEPRECATED_OPERATION(UseOfReleaseEvents)
DEPRECATED_OPERATION(ShowModalDialog)
DEPRECATED_OPERATION(SyncXMLHttpRequest)
DEPRECATED_OPERATION(Window_Cc_ontrollers)
DEPRECATED_OPERATION(ImportXULIntoContent)
Expand Down
7 changes: 0 additions & 7 deletions dom/base/nsGlobalWindowInner.h
Original file line number Diff line number Diff line change
Expand Up @@ -916,13 +916,6 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,

void DidRefresh() override;

void GetDialogArgumentsOuter(JSContext* aCx,
JS::MutableHandle<JS::Value> aRetval,
nsIPrincipal& aSubjectPrincipal,
mozilla::ErrorResult& aError);
void GetDialogArguments(JSContext* aCx, JS::MutableHandle<JS::Value> aRetval,
nsIPrincipal& aSubjectPrincipal,
mozilla::ErrorResult& aError);
void GetReturnValueOuter(JSContext* aCx,
JS::MutableHandle<JS::Value> aReturnValue,
nsIPrincipal& aSubjectPrincipal,
Expand Down
7 changes: 0 additions & 7 deletions dom/base/nsGlobalWindowOuter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2687,13 +2687,6 @@ void nsGlobalWindowOuter::PoisonOuterWindowProxy(JSObject* aObject) {
nsresult nsGlobalWindowOuter::SetArguments(nsIArray* aArguments) {
nsresult rv;

// Historically, we've used the same machinery to handle openDialog arguments
// (exposed via window.arguments) and showModalDialog arguments (exposed via
// window.dialogArguments), even though the former is XUL-only and uses an
// XPCOM array while the latter is web-exposed and uses an arbitrary JS value.
// Moreover, per-spec |dialogArguments| is a property of the browsing context
// (outer), whereas |arguments| lives on the inner.
//
// We've now mostly separated them, but the difference is still opaque to
// nsWindowWatcher (the caller of SetArguments in this little back-and-forth
// embedding waltz we do here).
Expand Down
17 changes: 9 additions & 8 deletions dom/base/nsGlobalWindowOuter.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,15 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
virtual void SetReadyForFocus() override;
virtual void PageHidden() override;

virtual nsresult SetArguments(nsIArray* aArguments) override;
/**
* Set a arguments for this window. This will be set on the window
* right away (if there's an existing document) and it will also be
* installed on the window when the next document is loaded.
*
* This function passes |arguments| back from nsWindowWatcher to
* nsGlobalWindow.
*/
nsresult SetArguments(nsIArray* aArguments);

void MaybeForgiveSpamCount();
bool IsClosedOrClosing() {
Expand Down Expand Up @@ -658,13 +666,6 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
void SetBrowserDOMWindowOuter(nsIBrowserDOMWindow* aBrowserWindow);
void SetCursorOuter(const nsAString& aCursor, mozilla::ErrorResult& aError);

void GetDialogArgumentsOuter(JSContext* aCx,
JS::MutableHandle<JS::Value> aRetval,
nsIPrincipal& aSubjectPrincipal,
mozilla::ErrorResult& aError);
void GetDialogArguments(JSContext* aCx, JS::MutableHandle<JS::Value> aRetval,
nsIPrincipal& aSubjectPrincipal,
mozilla::ErrorResult& aError);
void GetReturnValueOuter(JSContext* aCx,
JS::MutableHandle<JS::Value> aReturnValue,
nsIPrincipal& aSubjectPrincipal,
Expand Down
12 changes: 0 additions & 12 deletions dom/base/nsPIDOMWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -974,18 +974,6 @@ class nsPIDOMWindowOuter : public mozIDOMWindowProxy {
*/
virtual void PageHidden() = 0;

/**
* Set a arguments for this window. This will be set on the window
* right away (if there's an existing document) and it will also be
* installed on the window when the next document is loaded.
*
* This function serves double-duty for passing both |arguments| and
* |dialogArguments| back from nsWindowWatcher to nsGlobalWindow. For the
* latter, the array is an array of length 0 whose only element is a
* DialogArgumentsHolder representing the JS value passed to showModalDialog.
*/
virtual nsresult SetArguments(nsIArray* aArguments) = 0;

/**
* Return the window id of this window
*/
Expand Down
3 changes: 1 addition & 2 deletions dom/base/nsSandboxFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ const unsigned long SANDBOXED_NAVIGATION = 0x1;

/**
* This flag prevents content from creating new auxiliary browsing contexts,
* e.g. using the target attribute, the window.open() method, or the
* showModalDialog() method.
* e.g. using the target attribute, or the window.open() method.
*/
const unsigned long SANDBOXED_AUXILIARY_NAVIGATION = 0x2;

Expand Down
2 changes: 0 additions & 2 deletions dom/locales/en-US/chrome/dom/dom.properties
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ MozGetAsFileWarning=The non-standard mozGetAsFile method is deprecated and will
UseOfCaptureEventsWarning=Use of captureEvents() is deprecated. To upgrade your code, use the DOM 2 addEventListener() method. For more help http://developer.mozilla.org/en/docs/DOM:element.addEventListener
# LOCALIZATION NOTE: Do not translate "releaseEvents()" or "removeEventListener()"
UseOfReleaseEventsWarning=Use of releaseEvents() is deprecated. To upgrade your code, use the DOM 2 removeEventListener() method. For more help http://developer.mozilla.org/en/docs/DOM:element.removeEventListener
# LOCALIZATION NOTE: Do not translate "window.showModalDialog()" or "window.open()"
ShowModalDialogWarning=Use of window.showModalDialog() is deprecated. Use window.open() instead. For more help https://developer.mozilla.org/en-US/docs/Web/API/Window.open
# LOCALIZATION NOTE: Do not translate "XMLHttpRequest"
SyncXMLHttpRequestWarning=Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help http://xhr.spec.whatwg.org/
# LOCALIZATION NOTE: Do not translate "window.controllers/Controllers"
Expand Down
1 change: 0 additions & 1 deletion dom/tests/mochitest/bugs/mochitest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ skip-if = toolkit == 'android'
[test_bug698061.html]
[test_bug698551.html]
[test_bug707749.html]
[test_bug735237.html]
[test_bug739038.html]
[test_bug740811.html]
[test_bug743615.html]
Expand Down
3 changes: 1 addition & 2 deletions dom/tests/mochitest/bugs/test_bug61098.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,7 @@

function runtests()
{
SpecialPowers.pushPrefEnv({'set': [["dom.successive_dialog_time_limit", 3],
["dom.disable_window_showModalDialog", false]]},
SpecialPowers.pushPrefEnv({'set': [["dom.successive_dialog_time_limit", 3]]},
runtestsInner);
}

Expand Down
38 changes: 0 additions & 38 deletions dom/tests/mochitest/bugs/test_bug735237.html

This file was deleted.

1 change: 0 additions & 1 deletion mobile/android/app/mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ pref("privacy.popups.showBrowserMessage", true);

/* disable opening windows with the dialog feature */
pref("dom.disable_window_open_dialog_feature", true);
pref("dom.disable_window_showModalDialog", true);
pref("dom.disable_window_find", true);

pref("keyword.enabled", true);
Expand Down
1 change: 0 additions & 1 deletion modules/libpref/init/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,6 @@ pref("dom.disable_window_open_feature.menubar", false);
pref("dom.disable_window_open_feature.resizable", true);
pref("dom.disable_window_open_feature.minimizable", false);
pref("dom.disable_window_open_feature.status", true);
pref("dom.disable_window_showModalDialog", true);

pref("dom.allow_scripts_to_close_windows", false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ const STATE_CANCELED = 3;
// NOTE: Copied from nsSandboxFlags.h
/**
* This flag prevents content from creating new auxiliary browsing contexts,
* e.g. using the target attribute, the window.open() method, or the
* showModalDialog() method.
* e.g. using the target attribute, or the window.open() method.
*/
const SANDBOXED_AUXILIARY_NAVIGATION = 0x2;

Expand Down
8 changes: 2 additions & 6 deletions toolkit/components/windowwatcher/nsWindowWatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,6 @@ nsresult nsWindowWatcher::OpenWindowInternal(
bool windowNeedsName = false;
bool windowIsModal = false;
bool uriToLoadIsChrome = false;
bool windowIsModalContentDialog = false;

uint32_t chromeFlags;
nsAutoString name; // string version of aName
Expand Down Expand Up @@ -697,8 +696,6 @@ nsresult nsWindowWatcher::OpenWindowInternal(
} else {
chromeFlags = CalculateChromeFlagsForChild(features);

// Until ShowModalDialog is removed, it's still possible for content to
// request dialogs, but only in single-process mode.
if (aDialog) {
MOZ_ASSERT(XRE_IsParentProcess());
chromeFlags |= nsIWebBrowserChrome::CHROME_OPENAS_DIALOG;
Expand Down Expand Up @@ -1029,7 +1026,7 @@ nsresult nsWindowWatcher::OpenWindowInternal(
MaybeDisablePersistence(features, newTreeOwner);
}

if ((aDialog || windowIsModalContentDialog) && aArgv) {
if (aDialog && aArgv) {
MOZ_ASSERT(win);
NS_ENSURE_TRUE(win, NS_ERROR_UNEXPECTED);

Expand Down Expand Up @@ -1271,8 +1268,7 @@ nsresult nsWindowWatcher::OpenWindowInternal(
SizeOpenedWindow(newTreeOwner, aParent, isCallerChrome, sizeSpec);
}

// XXXbz isn't windowIsModal always true when windowIsModalContentDialog?
if (windowIsModal || windowIsModalContentDialog) {
if (windowIsModal) {
NS_ENSURE_TRUE(newDocShell, NS_ERROR_NOT_IMPLEMENTED);

nsCOMPtr<nsIDocShellTreeOwner> newTreeOwner;
Expand Down

0 comments on commit 1fd1ce7

Please sign in to comment.