mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1618152 - Use BrowsingContext for activeness check in nsGenericHTMLFormElement::FocusState. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D64340 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
13b081a62d
commit
e0301a2e76
@ -1979,23 +1979,7 @@ nsGenericHTMLFormElement::FocusTristate nsGenericHTMLFormElement::FocusState() {
|
||||
return eUnfocusable;
|
||||
}
|
||||
|
||||
// If the window is not active, do not allow the focus to bring the
|
||||
// window to the front. We update the focus controller, but do
|
||||
// nothing else.
|
||||
if (nsPIDOMWindowOuter* win = doc->GetWindow()) {
|
||||
nsCOMPtr<nsPIDOMWindowOuter> rootWindow = win->GetPrivateRoot();
|
||||
|
||||
nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
|
||||
if (fm && rootWindow) {
|
||||
nsCOMPtr<mozIDOMWindowProxy> activeWindow;
|
||||
fm->GetActiveWindow(getter_AddRefs(activeWindow));
|
||||
if (activeWindow == rootWindow) {
|
||||
return eActiveWindow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return eInactiveWindow;
|
||||
return IsInActiveTab(doc) ? eActiveWindow : eInactiveWindow;
|
||||
}
|
||||
|
||||
Element* nsGenericHTMLFormElement::AddFormIdObserver() {
|
||||
|
Loading…
Reference in New Issue
Block a user