             bottomHolder = row.y + row.height;
         }
 
-        
         // available width
         availableWidth = Math.round(rightHolder - leftHolder);
         availableHeight = Math.round(bottomHolder - topHolder);
         
         // set width
-        if (!isNaN(left) && !isNaN(right))
+        if (!isNaN(percentWidth))
+        {
+            if (!isNaN(left))
+                availableWidth -= left;
+            if (!isNaN(right))
+                availableWidth -= right;
+            
+            elementWidth = Math.round(availableWidth * Math.min(percentWidth * 0.01, 1));
+            elementMaxWidth = Math.min(layoutElement.getMaxBoundsWidth(),
+                maxSizeToFitIn(unscaledWidth, left, right, layoutElement.getLayoutBoundsX()));
+        }
+        else if (!isNaN(left) && !isNaN(right))
         {
             elementWidth = availableWidth - left - right;
         }
+        
         // set height
+        if (!isNaN(percentHeight))
+        {
+            if (!isNaN(top))
+                availableHeight -= top;
+            if (!isNaN(bottom))
+                availableHeight -= bottom;    
+            
+            elementHeight = Math.round(availableHeight * Math.min(percentHeight * 0.01, 1));
+            elementMaxHeight = Math.min(layoutElement.getMaxBoundsHeight(),
+                maxSizeToFitIn(unscaledHeight, top, bottom, layoutElement.getLayoutBoundsY()));
+        }
         if (!isNaN(top) && !isNaN(bottom))
         {
             elementHeight = availableHeight - top - bottom;

        {
            var numRowSpanElements:Number = rowSpanElements.length;
            
            // Measure content size rows only single span for now.
            // If multiple span, do nothing yet.
            for (i = 0; i < numRowSpanElements; i++)

    private static function constraintsDetermineHeight(elementInfo:ElementConstraintInfo):Boolean
    {
        return !isNaN(elementInfo.top) && !isNaN(elementInfo.bottom);
    }
    
    /**
     *  @return Returns the maximum value for an element's dimension so that the component doesn't
     *  spill out of the container size. Calculations are based on the layout rules.
     *  Pass in unscaledWidth, hCenter, left, right, childX to get a maxWidth value.
     *  Pass in unscaledHeight, vCenter, top, bottom, childY to get a maxHeight value.
     *  
     *  @langversion 3.0
     *  @playerversion Flash 10
     *  @playerversion AIR 1.5
     *  @productversion Flex 4
     */
    static private function maxSizeToFitIn(totalSize:Number,
                                           lowConstraint:Number,
                                           highConstraint:Number,
                                           position:Number):Number
    {
        if (!isNaN(lowConstraint))
        {
            // childWidth + left <= totalSize
            return totalSize - lowConstraint;
        }
        else if (!isNaN(highConstraint))
        {
            // childWidth + right <= totalSize
            return totalSize - highConstraint;
        }
        else
        {
            // childWidth + childX <= totalSize
            return totalSize - position;
        }
    }
    
    //--------------------------------------------------------------------------
