Bug 114850: scrollbars permanently hidden when using window.scrollbars.visible = false, patch by Martijn Wargers <martijn.martijn@gmail.com>, r+sr=bzbarsky

This commit is contained in:
gavin%gavinsharp.com 2005-12-30 16:57:46 +00:00
parent cd8a2f2c20
commit c826eb751d

View File

@ -301,6 +301,15 @@ nsScrollbarsProp::GetVisible(PRBool *aVisible)
NS_IMETHODIMP NS_IMETHODIMP
nsScrollbarsProp::SetVisible(PRBool aVisible) nsScrollbarsProp::SetVisible(PRBool aVisible)
{ {
PRBool enabled = PR_FALSE;
nsCOMPtr<nsIScriptSecurityManager>
securityManager(do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID));
if (securityManager)
securityManager->IsCapabilityEnabled("UniversalBrowserWrite", &enabled);
if (!enabled)
return NS_OK;
/* Scrollbars, unlike the other barprops, implement visibility directly /* Scrollbars, unlike the other barprops, implement visibility directly
rather than handing off to the superclass (and from there to the rather than handing off to the superclass (and from there to the
chrome window) because scrollbar visibility uniquely applies only chrome window) because scrollbar visibility uniquely applies only