From 6e23c7709d6650004edc3e6a5e76d5758fd85185 Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Fri, 28 May 1999 22:26:48 +0000 Subject: [PATCH] More accurate tracking of chrome shells. git-svn-id: svn://10.0.0.236/trunk@33171 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsFrameFrame.cpp | 16 +++++++--------- .../layout/html/document/src/nsFrameFrame.cpp | 16 +++++++--------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/mozilla/layout/generic/nsFrameFrame.cpp b/mozilla/layout/generic/nsFrameFrame.cpp index 7187b19ba4a..5a9611d356a 100644 --- a/mozilla/layout/generic/nsFrameFrame.cpp +++ b/mozilla/layout/generic/nsFrameFrame.cpp @@ -791,19 +791,17 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext, mWebShell->SetWebShellType(parentType); } - // Make sure all shells have links back to the outermost chrome + // Make sure all shells have links back to the nearest enclosing chrome // shell. + nsCOMPtr chromeShell; - outerShell->GetContainingChromeShell(getter_AddRefs(chromeShell)); - if (!chromeShell) - chromeShell = dont_QueryInterface(outerShell); - - // Make sure the outermost shell is chrome, and only set up - // this link if it is. nsWebShellType chromeShellType; - chromeShell->GetWebShellType(chromeShellType); + outerShell->GetWebShellType(chromeShellType); if (chromeShellType == nsWebShellChrome) - mWebShell->SetContainingChromeShell(chromeShell); + chromeShell = dont_QueryInterface(outerShell); + else outerShell->GetContainingChromeShell(getter_AddRefs(chromeShell)); + + mWebShell->SetContainingChromeShell(chromeShell); #endif // INCLUDE_XUL diff --git a/mozilla/layout/html/document/src/nsFrameFrame.cpp b/mozilla/layout/html/document/src/nsFrameFrame.cpp index 7187b19ba4a..5a9611d356a 100644 --- a/mozilla/layout/html/document/src/nsFrameFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameFrame.cpp @@ -791,19 +791,17 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext, mWebShell->SetWebShellType(parentType); } - // Make sure all shells have links back to the outermost chrome + // Make sure all shells have links back to the nearest enclosing chrome // shell. + nsCOMPtr chromeShell; - outerShell->GetContainingChromeShell(getter_AddRefs(chromeShell)); - if (!chromeShell) - chromeShell = dont_QueryInterface(outerShell); - - // Make sure the outermost shell is chrome, and only set up - // this link if it is. nsWebShellType chromeShellType; - chromeShell->GetWebShellType(chromeShellType); + outerShell->GetWebShellType(chromeShellType); if (chromeShellType == nsWebShellChrome) - mWebShell->SetContainingChromeShell(chromeShell); + chromeShell = dont_QueryInterface(outerShell); + else outerShell->GetContainingChromeShell(getter_AddRefs(chromeShell)); + + mWebShell->SetContainingChromeShell(chromeShell); #endif // INCLUDE_XUL