         // then prefer to show the "non-dependent" auto scrollbar if we added the second
         // "dependent" auto scrollbar because of the space consumed by the first.
         
-        if (hsbVisible && vsbVisible) 
+        if ((hsbVisible && hsbTakeUpSpace) && (vsbVisible && vsbTakeUpSpace)) 
         {
             if (hsbFits(w, h) && vsbFits(w, h))
             {

                    vsbVisible = (contentH >= (viewportH + SDT));
                }                        
                break;

            default:
                vsbVisible = false;
        }

                    vsbVisible = false;
            }
        }
        else if (hsbVisible && hsbTakeUpSpace && !hsbFits(w, h))  // just trying to show HSB, but it doesn't fit
            hsbVisible = false;
        else if (vsbVisible && vsbTakeUpSpace && !vsbFits(w, h))  // just trying to show VSB, but it doesn't fit
            vsbVisible = false;
        
        // Reset the viewport's width,height to account for the visible scrollbars, unless
        // the viewport's size was explicitly set, then we just use that.
        
        if (isNaN(explicitViewportW))
            viewportW = w - ((vsbVisible && vsbTakeUpSpace) ? (minViewportInset + vsbRequiredWidth()) : (minViewportInset * 2));
        else 
            viewportW = explicitViewportW;

        if (isNaN(explicitViewportH))
            viewportH = h - ((hsbVisible && hsbTakeUpSpace) ? (minViewportInset + hsbRequiredHeight()) : (minViewportInset * 2));
        else 
            viewportH = explicitViewportH;
        
