Bug 810669 - Cleanup GetDocumentForReport in nsDOMEvent.cpp a bit; r=smaug

This commit is contained in:
Ms2ger 2012-12-02 09:59:29 +01:00
Родитель 90dc2a2c97
Коммит 6ab7b13127
1 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -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