Bug 1623092 - Avoid setting mActiveWindow in content processes. r=NeilDeakin

Differential Revision: https://phabricator.services.mozilla.com/D67191

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Henri Sivonen 2020-04-01 12:01:51 +00:00
Родитель 3b815d9201
Коммит 48b72003b0
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -681,8 +681,9 @@ nsFocusManager::WindowRaised(mozIDOMWindowProxy* aWindow) {
NS_ENSURE_TRUE(docShellAsItem, NS_OK);
// set this as the active window
mActiveWindow = window;
if (!XRE_IsParentProcess()) {
if (XRE_IsParentProcess()) {
mActiveWindow = window;
} else {
BrowsingContext* bc = window->GetBrowsingContext();
if (bc == bc->Top()) {
SetActiveBrowsingContextInContent(bc);
@ -788,8 +789,9 @@ nsFocusManager::WindowLowered(mozIDOMWindowProxy* aWindow) {
// window can be prevented until we return. Otherwise, focus can get into
// an unusual state.
mWindowBeingLowered = window;
mActiveWindow = nullptr;
if (!XRE_IsParentProcess()) {
if (XRE_IsParentProcess()) {
mActiveWindow = nullptr;
} else {
BrowsingContext* bc = window->GetBrowsingContext();
if (bc == bc->Top()) {
SetActiveBrowsingContextInContent(nullptr);