Bug 866748 - isTopLevel shouldn't throw. r=smaug

This commit is contained in:
Gavin Sharp 2013-04-29 15:52:57 -07:00
Родитель 1870e96454
Коммит 64d722a6fa
1 изменённых файлов: 9 добавлений и 8 удалений

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

@ -952,17 +952,18 @@ nsDocLoader::GetIsTopLevel(bool *aResult)
*aResult = false;
nsCOMPtr<nsIDOMWindow> window;
nsresult rv = GetDOMWindow(getter_AddRefs(window));
NS_ENSURE_SUCCESS(rv, rv);
GetDOMWindow(getter_AddRefs(window));
if (window) {
nsCOMPtr<nsPIDOMWindow> piwindow = do_QueryInterface(window);
NS_ENSURE_STATE(piwindow);
nsCOMPtr<nsIDOMWindow> topWindow;
rv = piwindow->GetTop(getter_AddRefs(topWindow));
nsresult rv = piwindow->GetTop(getter_AddRefs(topWindow));
NS_ENSURE_SUCCESS(rv, rv);
*aResult = piwindow == topWindow;
}
return NS_OK;
}