diff --git a/docshell/base/nsWebShell.cpp b/docshell/base/nsWebShell.cpp index fdb777334555..4be14d773f3e 100644 --- a/docshell/base/nsWebShell.cpp +++ b/docshell/base/nsWebShell.cpp @@ -178,6 +178,8 @@ public: NS_IMETHOD SetMarginHeight(PRInt32 aHeight); NS_IMETHOD GetScrolling(PRInt32& aScrolling); NS_IMETHOD SetScrolling(PRInt32 aScrolling); + NS_IMETHOD GetIsFrame(PRBool& aIsFrame); + NS_IMETHOD SetIsFrame(PRBool aIsFrame); // Document load api's NS_IMETHOD GetDocumentLoader(nsIDocumentLoader*& aResult); @@ -329,6 +331,7 @@ protected: PRInt32 mMarginWidth; PRInt32 mMarginHeight; PRInt32 mScrolling; + PRBool mIsFrame; nsVoidArray mRefreshments; void ReleaseChildren(); @@ -437,6 +440,7 @@ nsWebShell::nsWebShell() mScriptGlobal = nsnull; mScriptContext = nsnull; InitFrameData(); + mIsFrame = PR_FALSE; } nsWebShell::~nsWebShell() @@ -467,6 +471,7 @@ nsWebShell::~nsWebShell() NS_IF_RELEASE(mScriptContext); InitFrameData(); + mIsFrame = PR_FALSE; // XXX Because we hold references to the children and they hold references // to us we never get destroyed. See Destroy() instead... @@ -1158,6 +1163,22 @@ nsWebShell::SetScrolling(PRInt32 aScrolling) mScrolling = aScrolling; return NS_OK; } + +NS_IMETHODIMP +nsWebShell::GetIsFrame(PRBool& aIsFrame) +{ + aIsFrame = mIsFrame; + return NS_OK; +} + +NS_IMETHODIMP +nsWebShell::SetIsFrame(PRBool aIsFrame) +{ + mIsFrame = aIsFrame; + return NS_OK; +} + + /** * Document Load methods */ @@ -1213,7 +1234,8 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec, // web shell is being recycled nsIWebShell *rootWebShell; GetRootWebShell(rootWebShell); - if (this == rootWebShell) { + //if (this == rootWebShell) { + if (!mIsFrame) { InitFrameData(); } diff --git a/webshell/public/nsIWebShell.h b/webshell/public/nsIWebShell.h index 3f3335667caf..8bde4edc24f8 100644 --- a/webshell/public/nsIWebShell.h +++ b/webshell/public/nsIWebShell.h @@ -315,8 +315,10 @@ public: NS_IMETHOD SetMarginWidth (PRInt32 aWidth) = 0; NS_IMETHOD GetMarginHeight(PRInt32& aWidth) = 0; NS_IMETHOD SetMarginHeight(PRInt32 aHeight) = 0; - NS_IMETHOD SetScrolling(PRInt32 aScrolling) = 0; - NS_IMETHOD GetScrolling(PRInt32& aScrolling) = 0; + NS_IMETHOD SetScrolling(PRInt32 aScrolling) = 0; + NS_IMETHOD GetScrolling(PRInt32& aScrolling) = 0; + NS_IMETHOD SetIsFrame(PRBool aIsFrame) = 0; + NS_IMETHOD GetIsFrame(PRBool& aIsFrame) = 0; /** * Finds text in content diff --git a/webshell/src/nsWebShell.cpp b/webshell/src/nsWebShell.cpp index fdb777334555..4be14d773f3e 100644 --- a/webshell/src/nsWebShell.cpp +++ b/webshell/src/nsWebShell.cpp @@ -178,6 +178,8 @@ public: NS_IMETHOD SetMarginHeight(PRInt32 aHeight); NS_IMETHOD GetScrolling(PRInt32& aScrolling); NS_IMETHOD SetScrolling(PRInt32 aScrolling); + NS_IMETHOD GetIsFrame(PRBool& aIsFrame); + NS_IMETHOD SetIsFrame(PRBool aIsFrame); // Document load api's NS_IMETHOD GetDocumentLoader(nsIDocumentLoader*& aResult); @@ -329,6 +331,7 @@ protected: PRInt32 mMarginWidth; PRInt32 mMarginHeight; PRInt32 mScrolling; + PRBool mIsFrame; nsVoidArray mRefreshments; void ReleaseChildren(); @@ -437,6 +440,7 @@ nsWebShell::nsWebShell() mScriptGlobal = nsnull; mScriptContext = nsnull; InitFrameData(); + mIsFrame = PR_FALSE; } nsWebShell::~nsWebShell() @@ -467,6 +471,7 @@ nsWebShell::~nsWebShell() NS_IF_RELEASE(mScriptContext); InitFrameData(); + mIsFrame = PR_FALSE; // XXX Because we hold references to the children and they hold references // to us we never get destroyed. See Destroy() instead... @@ -1158,6 +1163,22 @@ nsWebShell::SetScrolling(PRInt32 aScrolling) mScrolling = aScrolling; return NS_OK; } + +NS_IMETHODIMP +nsWebShell::GetIsFrame(PRBool& aIsFrame) +{ + aIsFrame = mIsFrame; + return NS_OK; +} + +NS_IMETHODIMP +nsWebShell::SetIsFrame(PRBool aIsFrame) +{ + mIsFrame = aIsFrame; + return NS_OK; +} + + /** * Document Load methods */ @@ -1213,7 +1234,8 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec, // web shell is being recycled nsIWebShell *rootWebShell; GetRootWebShell(rootWebShell); - if (this == rootWebShell) { + //if (this == rootWebShell) { + if (!mIsFrame) { InitFrameData(); }