         // 3) If the element causes a column to expand, update the column width to match.
         if (span == 1)
         {
-           // a) For the single spanning case, we only need to check if this element's 
-           //    required width is larger than the column's current width.
+            // a) For the single spanning case, we only need to check if this element's 
+            //    required width is larger than the column's current width.
             col = _constraintColumns[leftIndex];
             
             if (col.contentSize || !isNaN(col.percentWidth))

        var maxExtent:Number;
        var remainingWidth:Number;
        
        var colWidth:Number = 0;
        
        // 1) Determine how much space the element needs to satisfy its

            clearConstraintCache();
        
        return colWidths;
    }
    
    /**
     *  @private
     *  Updates the heights of content size and percent size rows that are spanned
     *  by the specified element. This method updates the provided row heights 
     *  vector in place. The algorithm is as follows:
     * 
     *  1) Determine the space needed by the element to satisfy its constraints
     *     and be at its preferred size.
     * 
     *  2) Calculate the number of rows the element will span.
     * 
     *  3) If the element causes a row to expand, update the row height to match.
     *     a) For the single spanning case, we only need to check if this element's 
     *        required height is larger than the row's current height.
     *     b) For the multiple spanning case, we distribute the remaining height after 
     *        subtracting the fixed size rows across the content/percent size rows.
     *        Then, we only update a row's height if the new divided height would cause
     *        the row's height to expand.
     * 
     *  @param elementInfo The constraint information of the element.
     *  @param colWidths The vector of column widths to update.
     */
    private function updateRowHeightsForElement(rowHeights:Vector.<Number>, elementInfo:ElementConstraintInfo):void
    {
        var layoutElement:ILayoutElement = elementInfo.layoutElement;
        var numRows:int = _constraintRows.length;
        var row:ConstraintRow;
        
        var topIndex:int = -1;
        var bottomIndex:int = -1;
        var span:int;
        
        var extY:Number = 0;
        var preferredHeight:Number = layoutElement.getPreferredBoundsHeight();
        var maxExtent:Number;
        var remainingHeight:Number;
        
        var j:int;
        var rowHeight:Number = 0;
        
        // 1) Determine how much space the element needs to satisfy its
        //    constraints and be at its preferred height.
        if (!isNaN(elementInfo.top))
        {
            extY += elementInfo.top;
            if (elementInfo.topBoundary)
                topIndex = elementInfo.rowSpanTopIndex;
            else
                topIndex = 0; // constrained to parent
        }
        
        if (!isNaN(elementInfo.bottom))
        {
            extY += elementInfo.bottom;
            if (elementInfo.bottomBoundary)
                bottomIndex = elementInfo.rowSpanBottomIndex;
            else
                bottomIndex = numRows - 1; // constrained to parent
        }
        
        // Only include baseline if at least one of top or bottom don't
        // exist.
        if (!isNaN(elementInfo.baseline) && (topIndex < 0 || bottomIndex < 0))
        {
            extY += elementInfo.baseline - layoutElement.baselinePosition;
            
            if (!isNaN(elementInfo.top))
                extY -= elementInfo.top;
            
            if (elementInfo.baselineBoundary)
            {
                topIndex = elementInfo.baselineIndex;
                
                // add baseline offset.
                extY += Number(rowBaselines[topIndex][0]); 
                
                // add maxAscent. maxAscent is 0 if not specified on the row.
                if (rowMaxAscents)
                    extY += rowMaxAscents[topIndex];
            }
            else
            {
                topIndex = 0;
            }
        }
        
        maxExtent = extY + preferredHeight;
        remainingHeight = maxExtent;
            
        // 2) If either the top or the bottom constraint doesn't exist,
        //    we must find the span of the element. We do this by
        //    determining the index of the last row that the element
        //    occupies in the unconstrained direction.
        if (topIndex < 0 || bottomIndex < 0)
        {
            var isTop:Boolean = topIndex < 0;
            var startIndex:int = isTop ? bottomIndex : topIndex;
            var endIndex:int = isTop ? -1 : numRows;
            var increment:int = isTop ? -1 : 1;
            
            if (isTop) // defaults to 0
                topIndex = 0;
            else // defaults to numRows - 1
                bottomIndex = numRows - 1;
            
            for (j = startIndex; j != endIndex ; j += increment)
            {
                row = _constraintRows[j];
                
                // subtract fixed rows
                if (!isNaN(row.explicitHeight))
                    remainingHeight -= row.explicitHeight;
                
                if ((row.contentSize || !isNaN(row.percentHeight)) || remainingHeight < 0)
                {
                    if (isTop)
                        topIndex = j;
                    else
                        bottomIndex = j;
                    break;
                }
            }
        }
        // always 1 or positive.
        span = bottomIndex - topIndex + 1;
        
        // 3) If the element causes a row to expand, update the row height to match.
        if (span == 1)
        {
            // a) For the single spanning case, we only need to check if this element's 
            //    required height is larger than the row's current height.
            row = _constraintRows[topIndex];
            
            if (row.contentSize || !isNaN(row.percentHeight))
            {   
                rowHeight = Math.max(rowHeights[topIndex], extY + preferredHeight);
                
                if (constraintsDetermineHeight(elementInfo))
                    rowHeight = Math.max(rowHeight, extY + layoutElement.getMinBoundsHeight());
                
                // bound with max height of row
                if (!isNaN(row.maxHeight))
                    rowHeight = Math.min(rowHeight, row.maxHeight);
                
                rowHeights[topIndex] = Math.ceil(rowHeight);
            }
        }
        else
        {
            // b) multiple spanning case. span >= 2.
            //    1) start from topIndex and subtract fixed rows
            //    2) divide space evenly into content/percent size rows.
            var contentRows:Vector.<ConstraintRow> = new Vector.<ConstraintRow>();
            var contentRowsIndices:Vector.<int> = new Vector.<int>();
            
            remainingHeight = maxExtent;
            for (j = topIndex; j <= bottomIndex; j++)
            {
                row = _constraintRows[j];
                
                if (!isNaN(row.explicitHeight))
                {
                    if (remainingHeight < row.height)
                        break;
                    
                    remainingHeight -= row.height;
                }
                else if (row.contentSize || !isNaN(row.percentHeight))
                {
                    contentRows.push(row);
                    contentRowsIndices.push(j);
                }
            }
            
            var numContentRows:Number = contentRows.length;
            if (numContentRows > 0)
            {
                var splitHeight:Number = remainingHeight / numContentRows;
                
                for (j = 0; j < numContentRows; j++)
                {
                    row = contentRows[j];
                    
                    rowHeight = Math.max(rowHeights[contentRowsIndices[j]], splitHeight);
                    if (!isNaN(row.maxHeight))
                        rowHeight = Math.min(rowHeight, row.maxHeight);
                    
                    rowHeights[contentRowsIndices[j]] = Math.ceil(rowHeight);
                }
            }
        }
    }
    
    /**
