зеркало из https://github.com/mozilla/gecko-dev.git
Bug 810669 - Cleanup GetDocumentForReport in nsDOMEvent.cpp a bit; r=smaug
This commit is contained in:
Родитель
90dc2a2c97
Коммит
6ab7b13127
|
@ -381,16 +381,16 @@ nsDOMEvent::StopImmediatePropagation()
|
|||
|
||||
static nsIDocument* GetDocumentForReport(nsEvent* aEvent)
|
||||
{
|
||||
nsCOMPtr<nsINode> node = do_QueryInterface(aEvent->currentTarget);
|
||||
if (node)
|
||||
nsIDOMEventTarget* target = aEvent->currentTarget;
|
||||
if (nsCOMPtr<nsINode> node = do_QueryInterface(target)) {
|
||||
return node->OwnerDoc();
|
||||
}
|
||||
|
||||
if (nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(target)) {
|
||||
return window->GetExtantDoc();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aEvent->currentTarget);
|
||||
if (!window)
|
||||
return nullptr;
|
||||
|
||||
nsCOMPtr<nsIDocument> doc(do_QueryInterface(window->GetExtantDocument()));
|
||||
return doc;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Загрузка…
Ссылка в новой задаче