Backed out 6 changesets (bug 1641546) for permafailing browser-chrome at browser_devices_get_user_media_unprompted_access_tear_off_tab.js

Backed out changeset 2652e1c084a7 (bug 1641546)
Backed out changeset 72a62a455c47 (bug 1641546)
Backed out changeset 4746c37be3e6 (bug 1641546)
Backed out changeset a2b64d290c0b (bug 1641546)
Backed out changeset 2dc2a430c2e7 (bug 1641546)
Backed out changeset 041cd14e3893 (bug 1641546)
This commit is contained in:
Coroiu Cristina 2020-06-06 19:13:06 +03:00
parent f4024a4046
commit 093544ac23
9 changed files with 5 additions and 75 deletions

View File

@ -717,7 +717,7 @@ function getGlobalIndicator() {
if (!webrtcUI.useLegacyGlobalIndicator) {
const INDICATOR_CHROME_URI =
"chrome://browser/content/webrtcIndicator.xhtml";
let features = "chrome,titlebar=no,alwaysontop,minimizable=yes";
let features = "chrome,titlebar=no,alwaysontop,minimizable=yes,popup=yes";
/* Don't use dialog on Gtk as it adds extra border and titlebar to indicator */
if (!AppConstants.MOZ_WIDGET_GTK) {

View File

@ -154,13 +154,6 @@ let Player = {
});
this.computeAndSetMinimumSize(window.outerWidth, window.outerHeight);
// alwaysontop windows are not focused by default, so we have to do it
// ourselves. We use requestAnimationFrame since we have to wait until the
// window is visible before it can focus.
window.requestAnimationFrame(() => {
window.focus();
});
},
uninit() {

View File

@ -881,14 +881,7 @@ void nsCocoaWindow::Show(bool bState) {
[mWindow setAnimationBehavior:behavior];
mWindowAnimationBehavior = behavior;
}
// We don't want alwaysontop windows to pull focus when they're opened,
// as these tend to be for peripheral indicators and displays.
if (mAlwaysOnTop) {
[mWindow orderFront:nil];
} else {
[mWindow makeKeyAndOrderFront:nil];
}
[mWindow makeKeyAndOrderFront:nil];
NS_OBJC_END_TRY_ABORT_BLOCK;
SendSetZLevelEvent();
}

View File

@ -524,7 +524,6 @@ STUB(gtk_window_set_accept_focus)
STUB(gtk_window_set_decorated)
STUB(gtk_window_set_deletable)
STUB(gtk_window_set_destroy_with_parent)
STUB(gtk_window_set_focus_on_map)
STUB(gtk_window_set_geometry_hints)
STUB(gtk_window_set_icon_name)
STUB(gtk_window_set_modal)

View File

@ -479,7 +479,6 @@ nsWindow::nsWindow() {
mHasAlphaVisual = false;
mIsPIPWindow = false;
mAlwaysOnTop = false;
mWindowScaleFactorChanged = true;
mWindowScaleFactor = 1;
@ -4178,7 +4177,6 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
}
}
mAlwaysOnTop = aInitData && aInitData->mAlwaysOnTop;
mIsPIPWindow = aInitData && aInitData->mPIPWindow;
// ok, create our windows
@ -4396,7 +4394,7 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
g_object_unref(group);
}
if (mAlwaysOnTop) {
if (aInitData->mAlwaysOnTop) {
gtk_window_set_keep_above(GTK_WINDOW(mShell), TRUE);
}
@ -4453,21 +4451,11 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
gtk_widget_set_has_window(container, mDrawToContainer);
gtk_container_add(GTK_CONTAINER(mShell), container);
// alwaysontop windows are generally used for peripheral indicators,
// so we don't focus them by default.
if (mAlwaysOnTop) {
gtk_window_set_focus_on_map(GTK_WINDOW(mShell), FALSE);
}
gtk_widget_realize(container);
// make sure this is the focus widget in the container
gtk_widget_show(container);
if (!mAlwaysOnTop) {
gtk_widget_grab_focus(container);
}
gtk_widget_grab_focus(container);
// the drawing window
mGdkWindow = gtk_widget_get_window(eventWidget);
@ -4975,7 +4963,6 @@ void nsWindow::NativeShow(bool aAction) {
return;
}
}
gtk_widget_show(mShell);
if (!mIsX11Display) {
WaylandStartVsync();

View File

@ -581,7 +581,6 @@ class nsWindow final : public nsBaseWidget {
LayoutDeviceIntRegion mDraggableRegion;
// It's PictureInPicture window.
bool mIsPIPWindow;
bool mAlwaysOnTop;
#ifdef ACCESSIBILITY
RefPtr<mozilla::a11y::Accessible> mRootAccessible;

View File

@ -6,7 +6,6 @@ support-files =
empty_window.xhtml
utils.js
[test_alwaysontop_focus.xhtml]
[test_bug343416.xhtml]
skip-if = debug
[test_bug429954.xhtml]

View File

@ -1,39 +0,0 @@
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Test that alwaysontop windows do not pull focus when opened.</title>
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
<script><![CDATA[
add_task(async function testAlwaysOnTop() {
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
let topWin = window.docShell.rootTreeItem.domWindow;
await SimpleTest.promiseFocus(topWin);
is(Services.focus.activeWindow, topWin, "Top level window is focused");
let newWin = Services.ww.openWindow(
null,
"about:blank",
null,
"chrome,alwaysontop,width=300,height=300",
null
);
await new Promise(resolve => {
newWin.addEventListener("load", resolve, { once: true });
});
// Wait one tick of the event loop to give the window a chance to focus.
await new Promise(resolve => { SimpleTest.executeSoon(resolve); });
is(Services.focus.activeWindow, topWin, "Top level window is still focused");
newWin.close();
});
]]></script>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test"></pre>
</body>
</html>

View File

@ -1614,7 +1614,7 @@ void nsWindow::Show(bool bState) {
::ShowWindow(mWnd, SW_SHOWMINIMIZED);
break;
default:
if (CanTakeFocus() && !mAlwaysOnTop) {
if (CanTakeFocus()) {
::ShowWindow(mWnd, SW_SHOWNORMAL);
} else {
::ShowWindow(mWnd, SW_SHOWNOACTIVATE);
@ -1628,7 +1628,6 @@ void nsWindow::Show(bool bState) {
} else {
DWORD flags = SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW;
if (wasVisible) flags |= SWP_NOZORDER;
if (mAlwaysOnTop) flags |= SWP_NOACTIVATE;
if (mWindowType == eWindowType_popup) {
// ensure popups are the topmost of the TOPMOST