             measuredH += viewportElt.getPreferredBoundsHeight();
         }
         
-        // TBD: if the viewport's explicitSize is set, then add it to the minW,H
+        // If the viewport's explicit size is set, then 
+        // include that in the scroller's minimum size
+        var viewportUIC:IUIComponent = viewport as IUIComponent;
+        var explicitViewportW:Number = viewportUIC ? viewportUIC.explicitWidth : NaN;
+        var explicitViewportH:Number = viewportUIC ? viewportUIC.explicitHeight : NaN;
+        if (!isNaN(explicitViewportW)) minW += explicitViewportW;
+        if (!isNaN(explicitViewportH)) minH += explicitViewportH;
         
         var hsb:ScrollBar = scroller.horizontalScrollBar;
         var showHSB:Boolean = false;
-        switch(scroller.horizontalScrollPolicy) {
+        switch(scroller.horizontalScrollPolicy) 
+        {
             case ScrollPolicy.ON: 
                 if (hsb) showHSB = true; 
                 break;
             case ScrollPolicy.AUTO: 
-                if (hsb) showHSB = hsb.visible;  
+                if (hsb) showHSB = hsb.visible;
                 break;
         } 
 
         var vsb:ScrollBar = scroller.verticalScrollBar;
         var showVSB:Boolean = false;
-        switch(scroller.verticalScrollPolicy) {
+        switch(scroller.verticalScrollPolicy) 
+        {
            case ScrollPolicy.ON: 
                 if (vsb) showVSB = true; 
                 break;
             case ScrollPolicy.AUTO: 
-                if (vsb) showVSB = vsb.visible;  
+                if (vsb) showVSB = vsb.visible;
                 break;
         }
         

                if (vsb && viewport)
                { 
                    vAuto = true;
                    var contentHeight:Number = viewport.contentHeight;
                    if (isNaN(explicitViewportH))
                        showVSB = contentHeight > (h - (minViewportInset * 2));
                    else
                        showVSB = contentHeight >  explicitViewportH;
                }                        
                break;
        }
        
        // Shrink the viewport's width,height for the visible scrollbars
        var viewportH:Number = h - minViewportInset;
        var hsbH:Number = 0;
        if (showHSB) 
        {
            hsbH = hsb.getPreferredBoundsHeight();
            viewportH -= Math.max(minViewportInset, hsbH);
        }
        var viewportW:Number = w - minViewportInset;
        var vsbW:Number = 0;
        if (showVSB) 
        {
            vsbW = vsb.getPreferredBoundsWidth();
            viewportW -= Math.max(minViewportInset, vsbW);
        }
        
        // If the scrollBarPolicy is auto, and we're only showing one scrollbar, 
        // the viewport may have shrunk enough to require showing the other one.
        if (showVSB && !showHSB && hAuto && (viewport.contentWidth > viewportW))
        {
            showHSB = true;
            hsbH = hsb.getPreferredBoundsHeight();                
            viewportH -= Math.max(minViewportInset, hsbH);
        }
        else if (!showVSB && showHSB && vAuto && (viewport.contentHeight > viewportH))
        {
            showVSB = true;
            vsbW = vsb.getPreferredBoundsWidth();                
            viewportW -= Math.max(minViewportInset, vsbW);
        }
        
        // Factor in scrollBar-side viewportInsets where there aren't scrollbars
        if (!showHSB)
            viewportH -= minViewportInset;
        if (!showVSB)
            viewportW -= minViewportInset;
            
        // Special case: viewport's size is explicitly set
        if (!isNaN(explicitViewportW))
            viewportW = explicitViewportW;
        if (!isNaN(explicitViewportH))
            viewportH = explicitViewportH;
        
        // layout the viewport
        if (viewport)
        {
            var viewportElt:ILayoutElement = ILayoutElement(viewport);
            viewportElt.setLayoutBoundsSize(viewportW, viewportH);
            viewportElt.setLayoutBoundsPosition(minViewportInset, minViewportInset);
        }
        
        // layout the scrollbars
        if (hsb) hsb.visible = showHSB;
        if (showHSB)
        {
            hsb.setLayoutBoundsSize(Math.max(hsb.getMinBoundsWidth(), w - vsbW), hsbH);
            hsb.setLayoutBoundsPosition(0, h - hsbH);
        }
        if (vsb) vsb.visible = showVSB;
        if (showVSB)
        {
            vsb.setLayoutBoundsSize(vsbW, Math.max(vsb.getMinBoundsHeight(), h - hsbH));
            vsb.setLayoutBoundsPosition(w - vsbW, 0);
        }
        
        // If the scroller's size isn't explicit and we've added a scrollbar, then
        // the measured size is likely to have been wrong.  
        if ((isNaN(target.explicitWidth) || isNaN(target.explicitHeight)) && 
            ((showVSB != oldShowVSB) || (showHSB != oldShowHSB)))
            target.invalidateSize();
             
        target.setContentSize(w, h);
    }

        var explicitViewportH:Number = viewportUIC ? viewportUIC.explicitHeight : NaN;
        
        // Decide which scrollbars will be visible based on the viewport's content size
        // See the method doc above for more information.

        var showHSB:Boolean = false;
        var hAuto:Boolean = false; 
        switch(scroller.horizontalScrollPolicy) {
