Skip to content

Commit 8d837fe

Browse files
committed
Bug 1870512 - Remove top-level windows with WindowType::Popup. r=tnikkel,sessionstore-reviewers,dao
These are only used right now for XUL notifications. They are extremely weird (I bet there's tons of code that assume that WindowType::Popup corresponds to nsMenuPopupFrame), and afaict there's no good reason why these have to be this way. They no longer are on Linux (because Wayland doesn't support such thing for example). XUL alerts work fine with this patch on all platforms after some basic testing. The other usage of this for the gfx sanity test can use type=dialog. Actually it can just be a toplevel, but that breaks the XUL skeleton UI. Differential Revision: https://phabricator.services.mozilla.com/D196665
1 parent 644a6bc commit 8d837fe

File tree

7 files changed

+7
-34
lines changed

7 files changed

+7
-34
lines changed

browser/components/sessionstore/SessionStore.sys.mjs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,6 @@ const CHROME_FLAGS_MAP = [
8080
// Do not inherit remoteness and fissionness from the previous session.
8181
//[Ci.nsIWebBrowserChrome.CHROME_REMOTE_WINDOW, "remote", "non-remote"],
8282
//[Ci.nsIWebBrowserChrome.CHROME_FISSION_WINDOW, "fission", "non-fission"],
83-
[Ci.nsIWebBrowserChrome.CHROME_WINDOW_POPUP, "popup"],
84-
[
85-
Ci.nsIWebBrowserChrome.CHROME_WINDOW_POPUP |
86-
Ci.nsIWebBrowserChrome.CHROME_TITLEBAR,
87-
"",
88-
"titlebar=0",
89-
],
90-
[
91-
Ci.nsIWebBrowserChrome.CHROME_WINDOW_POPUP |
92-
Ci.nsIWebBrowserChrome.CHROME_WINDOW_CLOSE,
93-
"",
94-
"close=0",
95-
],
9683
[Ci.nsIWebBrowserChrome.CHROME_WINDOW_LOWERED, "alwayslowered"],
9784
[Ci.nsIWebBrowserChrome.CHROME_WINDOW_RAISED, "alwaysraised"],
9885
// "chrome" and "suppressanimation" are always set.

toolkit/components/alerts/nsXULAlerts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ nsXULAlerts::ShowAlertWithIconURI(nsIAlertNotification* aAlert,
354354
NS_ENSURE_SUCCESS(rv, rv);
355355

356356
nsCOMPtr<mozIDOMWindowProxy> newWindow;
357-
nsAutoCString features("chrome,dialog=yes,titlebar=no,popup=yes");
357+
nsAutoCString features("chrome,dialog=yes,titlebar=no");
358358
if (inPrivateBrowsing) {
359359
features.AppendLiteral(",private");
360360
}

toolkit/components/browser/nsIWebBrowserChrome.idl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ interface nsIWebBrowserChrome : nsISupports
4747

4848
// special cases
4949
const unsigned long CHROME_WINDOW_MIN = 0x00004000;
50-
const unsigned long CHROME_WINDOW_POPUP = 0x00008000;
5150

5251
// whether to open a new private window. CHROME_NON_PRIVATE_WINDOW
5352
// forces the opened window to be non-private, and overrides

toolkit/components/gfx/SanityTest.sys.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ SanityTest.prototype = {
425425
PAGE_WIDTH +
426426
",height=" +
427427
PAGE_HEIGHT +
428-
",chrome,titlebar=0,scrollbars=0,popup=1",
428+
",chrome,titlebar=0,scrollbars=0,dialog=1",
429429
null
430430
);
431431

toolkit/components/windowwatcher/nsWindowWatcher.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,10 +1963,6 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForSystem(
19631963
chromeFlags |= nsIWebBrowserChrome::CHROME_FISSION_WINDOW;
19641964
}
19651965

1966-
if (aFeatures.GetBoolWithDefault("popup", false, &presenceFlag)) {
1967-
chromeFlags |= nsIWebBrowserChrome::CHROME_WINDOW_POPUP;
1968-
}
1969-
19701966
/* OK.
19711967
Normal browser windows, in spite of a stated pattern of turning off
19721968
all chrome not mentioned explicitly, will want the new OS chrome (window
@@ -1975,13 +1971,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForSystem(
19751971
to mean "OS' choice." */
19761972

19771973
// default titlebar and closebox to "on," if not mentioned at all
1978-
if (!(chromeFlags & nsIWebBrowserChrome::CHROME_WINDOW_POPUP)) {
1979-
if (!aFeatures.Exists("titlebar")) {
1980-
chromeFlags |= nsIWebBrowserChrome::CHROME_TITLEBAR;
1981-
}
1982-
if (!aFeatures.Exists("close")) {
1983-
chromeFlags |= nsIWebBrowserChrome::CHROME_WINDOW_CLOSE;
1984-
}
1974+
if (!aFeatures.Exists("titlebar")) {
1975+
chromeFlags |= nsIWebBrowserChrome::CHROME_TITLEBAR;
1976+
}
1977+
if (!aFeatures.Exists("close")) {
1978+
chromeFlags |= nsIWebBrowserChrome::CHROME_WINDOW_CLOSE;
19851979
}
19861980

19871981
if (aDialog && !aFeatures.IsEmpty() && !presenceFlag) {

toolkit/components/windowwatcher/test/browser_new_content_window_chromeflags.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ const DISALLOWED = {
3737
// "remote":
3838
// checked manually, since its default value will
3939
// depend on whether or not e10s is enabled by default.
40-
popup: {
41-
flag: Ci.nsIWebBrowserChrome.CHROME_WINDOW_POPUP,
42-
defaults_to: false,
43-
},
4440
alwaysLowered: {
4541
flag: Ci.nsIWebBrowserChrome.CHROME_WINDOW_LOWERED,
4642
defaults_to: false,

xpfe/appshell/nsAppShellService.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,6 @@ nsresult nsAppShellService::JustCreateTopWindow(
567567
? widget::WindowType::Dialog
568568
: widget::WindowType::TopLevel;
569569

570-
if (aChromeMask & nsIWebBrowserChrome::CHROME_WINDOW_POPUP)
571-
widgetInitData.mWindowType = widget::WindowType::Popup;
572-
573570
if (aChromeMask & nsIWebBrowserChrome::CHROME_SUPPRESS_ANIMATION)
574571
widgetInitData.mIsAnimationSuppressed = true;
575572

0 commit comments

Comments
 (0)