scrollbar visibility is no longer reflected in mChromeFlags. bug 130174 r=bryner,jag,jst

git-svn-id: svn://10.0.0.236/trunk@122457 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
danm%netscape.com 2002-06-01 00:00:12 +00:00
parent d58e517145
commit f4f4bed53e
2 changed files with 20 additions and 7 deletions

View File

@ -412,15 +412,23 @@ NS_IMETHODIMP nsContentTreeOwner::GetChromeFlags(PRUint32* aChromeFlags)
{
NS_ENSURE_ARG_POINTER(aChromeFlags);
// use scrollbar status from the content shell window to update flags
*aChromeFlags = mChromeFlags;
/* mChromeFlags is kept up to date, except for scrollbar visibility.
That can be changed directly by the content DOM window, which
doesn't know to update the chrome window. So that we must check
separately. */
// however, it's pointless to ask if the window isn't set up yet
if (!mXULWindow->mChromeLoaded)
return NS_OK;
PRBool scrollbarVisibility = mXULWindow->GetContentScrollbarVisibility();
if (scrollbarVisibility)
mChromeFlags |= nsIWebBrowserChrome::CHROME_SCROLLBARS;
*aChromeFlags |= nsIWebBrowserChrome::CHROME_SCROLLBARS;
else
mChromeFlags &= ~nsIWebBrowserChrome::CHROME_SCROLLBARS;
*aChromeFlags &= ~nsIWebBrowserChrome::CHROME_SCROLLBARS;
// the rest of mChromeFlags is kept up to date
*aChromeFlags = mChromeFlags;
return NS_OK;
}
@ -632,7 +640,11 @@ NS_IMETHODIMP nsContentTreeOwner::ApplyChromeFlags()
nsIWebBrowserChrome::CHROME_MENUBAR ?
PR_TRUE : PR_FALSE);
// scrollbars have their own special treatment
/* Scrollbars have their own special treatment. (note here we *do* use
mChromeFlags directly, without going through the accessor. This method
is intended to be used right after setting mChromeFlags, so this is
where the content window's scrollbar state is set to match mChromeFlags
in the first place. */
mXULWindow->SetContentScrollbarVisibility(mChromeFlags &
nsIWebBrowserChrome::CHROME_SCROLLBARS ?
PR_TRUE : PR_FALSE);

View File

@ -67,11 +67,12 @@ protected:
nsSiteWindow2 *mSiteWindow2;
PRBool mPrimary;
PRBool mContentTitleSetting;
PRUint32 mChromeFlags;
nsString mWindowTitleModifier;
nsString mTitleSeparator;
nsString mTitlePreface;
private:
PRUint32 mChromeFlags; // don't use directly! use GetChromeFlags()
};
#endif /* nsContentTreeOwner_h__ */