Bug 1642425: Part 3 - Fix nsDocLoader::GetIsTopLevel under Fission. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D77702
This commit is contained in:
Kris Maglione 2020-06-17 18:01:10 +00:00
Родитель 316de88922
Коммит 79760bfbb6
1 изменённых файлов: 2 добавлений и 12 удалений

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

@ -1018,18 +1018,8 @@ nsDocLoader::GetInnerDOMWindowID(uint64_t* aResult) {
NS_IMETHODIMP
nsDocLoader::GetIsTopLevel(bool* aResult) {
*aResult = false;
nsCOMPtr<mozIDOMWindowProxy> window;
GetDOMWindow(getter_AddRefs(window));
if (window) {
nsCOMPtr<nsPIDOMWindowOuter> piwindow = nsPIDOMWindowOuter::From(window);
NS_ENSURE_STATE(piwindow);
nsCOMPtr<nsPIDOMWindowOuter> topWindow = piwindow->GetInProcessTop();
*aResult = piwindow == topWindow;
}
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(this);
*aResult = docShell && docShell->GetBrowsingContext()->IsTop();
return NS_OK;
}