Bug 1183845 - Only send activation event if document is non-null. r=bz

This commit is contained in:
Eric Rahm 2015-07-31 13:23:15 -07:00
parent b655d3ecf9
commit 193b1bbe07

View File

@ -1134,12 +1134,14 @@ nsFocusManager::ActivateOrDeactivate(nsPIDOMWindow* aWindow, bool aActive)
aWindow->ActivateOrDeactivate(aActive);
// Send the activate event.
nsContentUtils::DispatchEventOnlyToChrome(aWindow->GetExtantDoc(),
aWindow,
aActive ?
NS_LITERAL_STRING("activate") :
NS_LITERAL_STRING("deactivate"),
true, true, nullptr);
if (aWindow->GetExtantDoc()) {
nsContentUtils::DispatchEventOnlyToChrome(aWindow->GetExtantDoc(),
aWindow,
aActive ?
NS_LITERAL_STRING("activate") :
NS_LITERAL_STRING("deactivate"),
true, true, nullptr);
}
// Look for any remote child frames, iterate over them and send the activation notification.
nsContentUtils::CallOnAllRemoteChildren(aWindow, ActivateOrDeactivateChild,