forked from mirrors/gecko-dev
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
This commit is contained in:
parent
644a6bc997
commit
8d837fe97f
7 changed files with 7 additions and 34 deletions
|
|
@ -80,19 +80,6 @@ const CHROME_FLAGS_MAP = [
|
|||
// Do not inherit remoteness and fissionness from the previous session.
|
||||
//[Ci.nsIWebBrowserChrome.CHROME_REMOTE_WINDOW, "remote", "non-remote"],
|
||||
//[Ci.nsIWebBrowserChrome.CHROME_FISSION_WINDOW, "fission", "non-fission"],
|
||||
[Ci.nsIWebBrowserChrome.CHROME_WINDOW_POPUP, "popup"],
|
||||
[
|
||||
Ci.nsIWebBrowserChrome.CHROME_WINDOW_POPUP |
|
||||
Ci.nsIWebBrowserChrome.CHROME_TITLEBAR,
|
||||
"",
|
||||
"titlebar=0",
|
||||
],
|
||||
[
|
||||
Ci.nsIWebBrowserChrome.CHROME_WINDOW_POPUP |
|
||||
Ci.nsIWebBrowserChrome.CHROME_WINDOW_CLOSE,
|
||||
"",
|
||||
"close=0",
|
||||
],
|
||||
[Ci.nsIWebBrowserChrome.CHROME_WINDOW_LOWERED, "alwayslowered"],
|
||||
[Ci.nsIWebBrowserChrome.CHROME_WINDOW_RAISED, "alwaysraised"],
|
||||
// "chrome" and "suppressanimation" are always set.
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ nsXULAlerts::ShowAlertWithIconURI(nsIAlertNotification* aAlert,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<mozIDOMWindowProxy> newWindow;
|
||||
nsAutoCString features("chrome,dialog=yes,titlebar=no,popup=yes");
|
||||
nsAutoCString features("chrome,dialog=yes,titlebar=no");
|
||||
if (inPrivateBrowsing) {
|
||||
features.AppendLiteral(",private");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ interface nsIWebBrowserChrome : nsISupports
|
|||
|
||||
// special cases
|
||||
const unsigned long CHROME_WINDOW_MIN = 0x00004000;
|
||||
const unsigned long CHROME_WINDOW_POPUP = 0x00008000;
|
||||
|
||||
// whether to open a new private window. CHROME_NON_PRIVATE_WINDOW
|
||||
// forces the opened window to be non-private, and overrides
|
||||
|
|
|
|||
|
|
@ -425,7 +425,7 @@ SanityTest.prototype = {
|
|||
PAGE_WIDTH +
|
||||
",height=" +
|
||||
PAGE_HEIGHT +
|
||||
",chrome,titlebar=0,scrollbars=0,popup=1",
|
||||
",chrome,titlebar=0,scrollbars=0,dialog=1",
|
||||
null
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -1963,10 +1963,6 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForSystem(
|
|||
chromeFlags |= nsIWebBrowserChrome::CHROME_FISSION_WINDOW;
|
||||
}
|
||||
|
||||
if (aFeatures.GetBoolWithDefault("popup", false, &presenceFlag)) {
|
||||
chromeFlags |= nsIWebBrowserChrome::CHROME_WINDOW_POPUP;
|
||||
}
|
||||
|
||||
/* OK.
|
||||
Normal browser windows, in spite of a stated pattern of turning off
|
||||
all chrome not mentioned explicitly, will want the new OS chrome (window
|
||||
|
|
@ -1975,14 +1971,12 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForSystem(
|
|||
to mean "OS' choice." */
|
||||
|
||||
// default titlebar and closebox to "on," if not mentioned at all
|
||||
if (!(chromeFlags & nsIWebBrowserChrome::CHROME_WINDOW_POPUP)) {
|
||||
if (!aFeatures.Exists("titlebar")) {
|
||||
chromeFlags |= nsIWebBrowserChrome::CHROME_TITLEBAR;
|
||||
}
|
||||
if (!aFeatures.Exists("close")) {
|
||||
chromeFlags |= nsIWebBrowserChrome::CHROME_WINDOW_CLOSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (aDialog && !aFeatures.IsEmpty() && !presenceFlag) {
|
||||
chromeFlags = nsIWebBrowserChrome::CHROME_DEFAULT;
|
||||
|
|
|
|||
|
|
@ -37,10 +37,6 @@ const DISALLOWED = {
|
|||
// "remote":
|
||||
// checked manually, since its default value will
|
||||
// depend on whether or not e10s is enabled by default.
|
||||
popup: {
|
||||
flag: Ci.nsIWebBrowserChrome.CHROME_WINDOW_POPUP,
|
||||
defaults_to: false,
|
||||
},
|
||||
alwaysLowered: {
|
||||
flag: Ci.nsIWebBrowserChrome.CHROME_WINDOW_LOWERED,
|
||||
defaults_to: false,
|
||||
|
|
|
|||
|
|
@ -567,9 +567,6 @@ nsresult nsAppShellService::JustCreateTopWindow(
|
|||
? widget::WindowType::Dialog
|
||||
: widget::WindowType::TopLevel;
|
||||
|
||||
if (aChromeMask & nsIWebBrowserChrome::CHROME_WINDOW_POPUP)
|
||||
widgetInitData.mWindowType = widget::WindowType::Popup;
|
||||
|
||||
if (aChromeMask & nsIWebBrowserChrome::CHROME_SUPPRESS_ANIMATION)
|
||||
widgetInitData.mIsAnimationSuppressed = true;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue