Bug 854421 - Part 12: Use the view tree to find the subdocument frame in nsDocShell. r=tn

This commit is contained in:
Matt Woodrow 2014-05-30 16:38:48 +12:00
parent a706976822
commit dab2c77f74

View File

@ -5565,11 +5565,19 @@ nsDocShell::GetVisibility(bool * aVisibility)
return NS_OK;
}
nsIContent *shellContent =
pPresShell->GetDocument()->FindContentForSubDocument(presShell->GetDocument());
NS_ASSERTION(shellContent, "subshell not in the map");
vm = presShell->GetViewManager();
if (vm) {
view = vm->GetRootView();
}
nsIFrame* frame = shellContent ? shellContent->GetPrimaryFrame() : nullptr;
if (view) {
view = view->GetParent(); // anonymous inner view
if (view) {
view = view->GetParent(); // subdocumentframe's view
}
}
nsIFrame* frame = view ? view->GetFrame() : nullptr;
bool isDocShellOffScreen = false;
docShell->GetIsOffScreenBrowser(&isDocShellOffScreen);
if (frame &&