Bug 862918 - Only create nsGlobalModalWindow for the primary content shell. r=bz
This commit is contained in:
@@ -11418,6 +11418,15 @@ nsDocShell::EnsureScriptEnvironment()
|
|||||||
|
|
||||||
bool isModalContentWindow = (mItemType == typeContent) &&
|
bool isModalContentWindow = (mItemType == typeContent) &&
|
||||||
(chromeFlags & nsIWebBrowserChrome::CHROME_MODAL);
|
(chromeFlags & nsIWebBrowserChrome::CHROME_MODAL);
|
||||||
|
// There can be various other content docshells associated with the
|
||||||
|
// top-level window, like sidebars. Make sure that we only create an
|
||||||
|
// nsGlobalModalWindow for the primary content shell.
|
||||||
|
if (isModalContentWindow) {
|
||||||
|
nsCOMPtr<nsIDocShellTreeItem> primaryItem;
|
||||||
|
nsresult rv = mTreeOwner->GetPrimaryContentShell(getter_AddRefs(primaryItem));
|
||||||
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
isModalContentWindow = (primaryItem == this);
|
||||||
|
}
|
||||||
|
|
||||||
// If our window is modal and we're not opened as chrome, make
|
// If our window is modal and we're not opened as chrome, make
|
||||||
// this window a modal content window.
|
// this window a modal content window.
|
||||||
|
|||||||
Reference in New Issue
Block a user