     }
 
     /**
-     *  @return Returns the maximum value for an item's dimension so that the component doesn't
+     *  @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.

        if (!layoutTarget)
            return;

        var count:int = layoutTarget.numLayoutItems;
        var maxX:Number = 0;
        var maxY:Number = 0;
        for (var i:int = 0; i < count; i++)
        {
            var layoutItem:ILayoutItem = layoutTarget.getLayoutItemAt(i);
            if (!layoutItem || !layoutItem.includeInLayout)
                continue;

            var hCenter:Number = LayoutItemHelper.parseConstraintValue(layoutItem.horizontalCenter);
            var vCenter:Number = LayoutItemHelper.parseConstraintValue(layoutItem.verticalCenter);
            var left:Number    = LayoutItemHelper.parseConstraintValue(layoutItem.left);
            var right:Number   = LayoutItemHelper.parseConstraintValue(layoutItem.right);
            var top:Number     = LayoutItemHelper.parseConstraintValue(layoutItem.top);
            var bottom:Number  = LayoutItemHelper.parseConstraintValue(layoutItem.bottom);
            var itemMinSize:Point = layoutItem.minSize;
            var itemMaxSize:Point = layoutItem.maxSize.clone(); // Since we may update it below

            // Remember child position before setting actualSize, since changing the size may
            // change the position.
            var childX:Number = layoutItem.actualPosition.x;
            var childY:Number = layoutItem.actualPosition.y;

            // Calculate size
            var childWidth:Number = NaN;

                extY += isNaN(bottom) ? 0 : bottom;
            }

            width = Math.max(width, extX + layoutElement.getPreferredWidth());
            height = Math.max(height, extY + layoutElement.getPreferredHeight());

            var elementMinWidth:Number = constraintsDetermineWidth(layoutElement) ? layoutElement.getMinWidth() : layoutElement.getPreferredWidth();
            var elementMinHeight:Number = constraintsDetermineHeight(layoutElement) ? layoutElement.getMinHeight() : layoutElement.getPreferredHeight();

            minWidth = Math.max(minWidth, extX + elementMinWidth);
            minHeight = Math.max(minHeight, extY + elementMinHeight);
        }

        layoutTarget.measuredWidth = Math.max(width, minWidth);
