Skip to content

Commit

Permalink
Bug 1814597; r=smaug
Browse files Browse the repository at this point in the history
  • Loading branch information
EdgarChen committed Mar 14, 2023
1 parent 6b3bee4 commit 5860c73
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions dom/base/nsFocusManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1658,10 +1658,10 @@ Maybe<uint64_t> nsFocusManager::SetFocusInner(Element* aNewContent,

// Exit fullscreen if a website focuses another window
if (StaticPrefs::full_screen_api_exit_on_windowRaise() &&
!isElementInActiveWindow && (aFlags & FLAG_RAISE) &&
(aFlags & FLAG_NONSYSTEMCALLER)) {
!isElementInActiveWindow && (aFlags & FLAG_RAISE)) {
if (XRE_IsParentProcess()) {
if (Document* doc = mActiveWindow ? mActiveWindow->GetDoc() : nullptr) {
Document::ClearPendingFullscreenRequests(doc);
if (doc->GetFullscreenElement()) {
LogWarningFullscreenWindowRaise(mFocusedElement);
Document::AsyncExitFullscreen(doc);
Expand All @@ -1672,9 +1672,11 @@ Maybe<uint64_t> nsFocusManager::SetFocusInner(Element* aNewContent,
if (activeBrowsingContext) {
nsIDocShell* shell = activeBrowsingContext->GetDocShell();
if (shell) {
Document* doc = shell->GetDocument();
if (doc && doc->GetFullscreenElement()) {
Document::AsyncExitFullscreen(doc);
if (Document* doc = shell->GetDocument()) {
Document::ClearPendingFullscreenRequests(doc);
if (doc->GetFullscreenElement()) {
Document::AsyncExitFullscreen(doc);
}
}
} else {
mozilla::dom::ContentChild* contentChild =
Expand Down

0 comments on commit 5860c73

Please sign in to comment.