             var lastmr:Number;
             var lastml:Number;
             var valign:Object;
+            var hostSizedToContent:Boolean = host.isHeightSizedToContent();
             
             for (var i:int = 0; i < n; i++)
             {

                valign = ValuesManager.valuesImpl.getValue(child, "vertical-align");
                verticalMargins[flexChildIndex] = { marginTop: mt, marginBottom: mb, valign: valign };
            }
            
            for (i = 0; i < n; i++)
			{
				var obj:Object = verticalMargins[0]
				child = contentView.getElementAt(i) as IUIBase;
				if (obj.valign == "center")
					child.y = (maxHeight - child.height) / 2;
				else if (obj.valign == "right")
					child.y = maxHeight - child.height - obj.marginBottom;
				else
					child.y = obj.marginTop;
			}
            return true;
		}

        // TODO (aharui): utility class or base class
        /**
         *  Determines the top and left padding values, if any, as set by
         *  padding style values. This includes "padding" for all padding values
         *  as well as "padding-left" and "padding-top".
         * 
         *  Returns an object with paddingLeft and paddingTop properties.
         *  
         *  @langversion 3.0
         *  @playerversion Flash 10.2
         *  @playerversion AIR 2.6
         *  @productversion FlexJS 0.0
         */
        protected function determinePadding():Object
        {
            var paddingLeft:Object;
            var paddingTop:Object;
            var paddingRight:Object;
            var padding:Object = ValuesManager.valuesImpl.getValue(host, "padding");
            if (typeof(padding) == "Array")
            {
                if (padding.length == 1)
                    paddingLeft = paddingTop = paddingRight = padding[0];
                else if (padding.length <= 3)
                {
                    paddingLeft = padding[1];
                    paddingTop = padding[0];
                    paddingRight = padding[1];
                }
                else if (padding.length == 4)
                {
                    paddingLeft = padding[3];
                    paddingTop = padding[0];					
                    paddingRight = padding[1];
                }
            }
            else if (padding == null)
            {
                paddingLeft = ValuesManager.valuesImpl.getValue(host, "padding-left");
                paddingTop = ValuesManager.valuesImpl.getValue(host, "padding-top");
                paddingRight = ValuesManager.valuesImpl.getValue(host, "padding-right");
            }
            else
            {
                paddingLeft = paddingTop = paddingRight = padding;
            }
            var pl:Number = Number(paddingLeft);
            var pt:Number = Number(paddingTop);
            var pr:Number = Number(paddingRight);
            if (isNaN(pl))
                pl = 0;
            if (isNaN(pr))
                pr = 0;
            if (isNaN(pt))
                pt = 0;
            return {paddingLeft:pl, paddingTop:pt, paddingRight:pr};
        }

        public function setDocument(document:Object, id:String = null):void
        {
            this.document = document;	

			maxHeight = 0;
			var verticalMargins:Array = new Array(n);
			
            var ww:Number = contentView.width;
            var hh:Number = contentView.height;
            var xx:int = 0;
            var flexChildIndex:int;
            var ml:Number;
            var mr:Number;
