mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 1481629 - only dispatch UnselectedTabHover event when outer window exists. r=bzbarsky
If we can't reach the outer window from the document, then also can't reach the chrome <browser> either. Therefore, there's no point in firing the event. Differential Revision: https://phabricator.services.mozilla.com/D2891 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
ed36e3dff8
commit
23e50af065
@ -110,6 +110,11 @@ BackgroundVideoDecodingPermissionObserver::EnableEvent() const
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPIDOMWindowOuter> ownerTop = GetOwnerWindow();
|
||||
if (!ownerTop) {
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<AsyncEventDispatcher> asyncDispatcher =
|
||||
new AsyncEventDispatcher(doc,
|
||||
NS_LITERAL_STRING("UnselectedTabHover:Enable"),
|
||||
@ -126,6 +131,11 @@ BackgroundVideoDecodingPermissionObserver::DisableEvent() const
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPIDOMWindowOuter> ownerTop = GetOwnerWindow();
|
||||
if (!ownerTop) {
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<AsyncEventDispatcher> asyncDispatcher =
|
||||
new AsyncEventDispatcher(doc,
|
||||
NS_LITERAL_STRING("UnselectedTabHover:Disable"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user