Issue #1829 - Revert "Issue #1751"

This commit is contained in:
Brian Smith 2022-04-26 11:34:08 -05:00 committed by roytam1
commit 13fcc4a046
949 changed files with 95662 additions and 444 deletions

View file

@ -66,7 +66,9 @@
#include "nsAccessibilityService.h"
#endif
#ifndef XP_MACOSX
#include "nsIScriptError.h"
#endif
using namespace mozilla;
using namespace mozilla::dom;
@ -1268,10 +1270,12 @@ nsFocusManager::SetFocusInner(nsIContent* aNewContent, int32_t aFlags,
}
}
// Exit fullscreen if we're focusing a windowed plugin. We don't control
// event dispatch to windowed plugins, so we can't display the <Press ESC
// to leave fullscreen mode> warning on key input if a windowed plugin is
// focused, so just exit fullscreen to guard against phishing.
// Exit fullscreen if we're focusing a windowed plugin on a non-MacOSX
// system. We don't control event dispatch to windowed plugins on non-MacOSX,
// so we can't display the "Press ESC to leave fullscreen mode" warning on
// key input if a windowed plugin is focused, so just exit fullscreen
// to guard against phishing.
#ifndef XP_MACOSX
if (contentToFocus &&
nsContentUtils::
GetRootDocument(contentToFocus->OwnerDoc())->GetFullscreenElement() &&
@ -1283,6 +1287,7 @@ nsFocusManager::SetFocusInner(nsIContent* aNewContent, int32_t aFlags,
"FocusedWindowedPluginWhileFullscreen");
nsIDocument::AsyncExitFullscreen(contentToFocus->OwnerDoc());
}
#endif
// if the FLAG_NOSWITCHFRAME flag is used, only allow the focus to be
// shifted away from the current element if the new shell to focus is