Skip to content

Commit

Permalink
Merge pull request BrowserWorks#1403 from hawkeye116477/current_
Browse files Browse the repository at this point in the history
[Current] Bug 1587922 - Remove the remnants of the showModalDialog code.
  • Loading branch information
MrAlex94 authored Feb 13, 2020
2 parents a3b531b + 4c2f01c commit 6bce12d
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 77 deletions.
1 change: 0 additions & 1 deletion dom/base/nsDeprecatedOperationList.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ DEPRECATED_OPERATION(UseOfCaptureEvents)
DEPRECATED_OPERATION(UseOfReleaseEvents)
DEPRECATED_OPERATION(UseOfDOM3LoadMethod)
DEPRECATED_OPERATION(ChromeUseOfDOM3LoadMethod)
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 @@ -885,13 +885,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 @@ -2717,13 +2717,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
7 changes: 0 additions & 7 deletions dom/base/nsGlobalWindowOuter.h
Original file line number Diff line number Diff line change
Expand Up @@ -651,13 +651,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
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 @@ -173,8 +173,6 @@ UseOfCaptureEventsWarning=Use of captureEvents() is deprecated. To upgrade your
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 "document.load()" or "XMLHttpRequest"
UseOfDOM3LoadMethodWarning=Use of document.load() is deprecated. To upgrade your code, use the DOM XMLHttpRequest object. For more help https://developer.mozilla.org/en/XMLHttpRequest
# 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/
ImplicitMetaViewportTagFallback=No meta-viewport tag found. Please explicitly specify one to prevent unexpected behavioural changes in future versions. For more help https://developer.mozilla.org/en/docs/Mozilla/Mobile/Viewport_meta_tag
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 @@ -116,7 +116,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 @@ -239,7 +239,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_print", true);
pref("dom.disable_window_find", 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 @@ -1266,7 +1266,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 @@ -588,7 +588,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 @@ -681,8 +680,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 @@ -949,7 +946,7 @@ nsresult nsWindowWatcher::OpenWindowInternal(
MaybeDisablePersistence(features, newTreeOwner);
}

if ((aDialog || windowIsModalContentDialog) && aArgv) {
if (aDialog && aArgv) {
// Set the args on the new window.
nsCOMPtr<nsPIDOMWindowOuter> piwin(do_QueryInterface(*aResult));
NS_ENSURE_TRUE(piwin, NS_ERROR_UNEXPECTED);
Expand Down Expand Up @@ -1199,8 +1196,7 @@ nsresult nsWindowWatcher::OpenWindowInternal(
SizeOpenedWindow(newTreeOwner, aParent, isCallerChrome, sizeSpec);
}

// XXXbz isn't windowIsModal always true when windowIsModalContentDialog?
if (windowIsModal || windowIsModalContentDialog) {
if (windowIsModal) {
nsCOMPtr<nsIDocShellTreeOwner> newTreeOwner;
newDocShellItem->GetTreeOwner(getter_AddRefs(newTreeOwner));
nsCOMPtr<nsIWebBrowserChrome> newChrome(do_GetInterface(newTreeOwner));
Expand Down

0 comments on commit 6bce12d

Please sign in to comment.