      */
     private function measureReal(layoutTarget:GroupBase):void
     {
-        var layoutEltCount:int = layoutTarget.numElements;
-        var reqEltCount:int = requestedRowCount; // -1 means "all elements"
-        var eltCount:uint = Math.max(reqEltCount, layoutEltCount);
-        var eltInLayoutCount:uint = 0; // elts that have been measured
+        var size:SizesAndLimit = new SizesAndLimit();
+        var justify:Boolean = horizontalAlign == HorizontalAlign.JUSTIFY;
+        var numElements:int = layoutTarget.numElements; // How many elements there are in the target
+        var numElementsInLayout:int = numElements;      // How many elements have includeInLayout == true, start off with numElements.
+        var requestedRowCount:int = this.requestedRowCount;
+        var rowsMeasured:int = 0;                       // How many rows have been measured
         
         var preferredHeight:Number = 0; // sum of the elt preferred heights
         var preferredWidth:Number = 0;  // max of the elt preferred widths
-        var minHeight:Number = 0; // sum of the elt minimum heights
-        var minWidth:Number = 0;  // max of the elt minimum widths
+        var minHeight:Number = 0;       // sum of the elt minimum heights
+        var minWidth:Number = 0;        // max of the elt minimum widths
         
         var fixedRowHeight:Number = NaN;
         if (!variableRowHeight)
             fixedRowHeight = rowHeight;  // may query typicalLayoutElement, elt at index=0
         
-        for (var i:uint = 0; i < eltCount; i++)
-        {            
-            if (i < layoutEltCount) // target.numElements
-                var elt:ILayoutElement = layoutTarget.getElementAt(i);
-            else // target.numElements < requestedElementCount, so "pad"
-                elt = typicalLayoutElement;
-            if (!elt || !elt.includeInLayout)
+        var element:ILayoutElement;
+        for (var i:int = 0; i < numElements; i++)
+        {
+            element = layoutTarget.getElementAt(i);
+            if (!element || !element.includeInLayout)
+            {
+                numElementsInLayout--;
                 continue;
+            }
             
-            // If requestedRowCount is specified, no need to consider the height
-            // of rows outside the bounds of the "requested" range. Otherwise, we
-            // consider each element.
-            if ((reqEltCount == -1) || ((reqEltCount != -1) && eltInLayoutCount < requestedRowCount))
+            // Can we measure this row height?
+            if (requestedRowCount == -1 || rowsMeasured < requestedRowCount)
             {
-                var height:Number = isNaN(fixedRowHeight) ? elt.getPreferredBoundsHeight() : fixedRowHeight;
-                height = Math.ceil(height); // Round up to give it a whole pixel.
-                preferredHeight += height;
-                minHeight += (isNaN(elt.percentHeight)) ? height : Math.ceil(elt.getMinBoundsHeight());
-                eltInLayoutCount += 1;
+                getElementHeight(element, fixedRowHeight, size);
+                preferredHeight += size.preferredSize;
+                minHeight += size.minSize;
+                rowsMeasured++;
             }
             
             // Consider the width of each element, inclusive of those outside
             // the requestedRowCount range.
-            var width:Number = Math.ceil(elt.getPreferredBoundsWidth());
-            preferredWidth = Math.max(preferredWidth, width);
-            var flexibleWidth:Boolean = !isNaN(elt.percentWidth) || horizontalAlign == HorizontalAlign.JUSTIFY;
-            minWidth = Math.max(minWidth, flexibleWidth ? Math.ceil(elt.getMinBoundsWidth()) : width);           
-        }
-        
-        if (eltInLayoutCount > 1)
+            getElementWidth(element, justify, size);
+            preferredWidth = Math.max(preferredWidth, size.preferredSize);
+            minWidth = Math.max(minWidth, size.minSize);
+        }
+        
+        // Calculate the total number of rows to measure
+        var rowsToMeasure:int = (requestedRowCount != -1) ? requestedRowCount : 
+                                                            Math.max(requestedMinRowCount, numElementsInLayout);
+        // Do we need to measure more rows?
+        if (rowsMeasured < rowsToMeasure)
+        {
+            // Use the typical element
+            element = typicalLayoutElement;
+            if (element)
+            {
+                // Height
+                getElementHeight(element, fixedRowHeight, size);
+                preferredHeight += size.preferredSize * (rowsToMeasure - rowsMeasured);
+                minHeight += size.minSize * (rowsToMeasure - rowsMeasured);
+    
+                // Width
+                getElementWidth(element, justify, size);
+                preferredWidth = Math.max(preferredWidth, size.preferredSize);
+                minWidth = Math.max(minWidth, size.minSize);
+                rowsMeasured = rowsToMeasure;
+            }
+        }
+
+        // Add gaps
+        if (rowsMeasured > 1)
         { 
-            var vgap:Number = gap * (eltInLayoutCount - 1);
+            var vgap:Number = gap * (rowsMeasured - 1);
             preferredHeight += vgap;
             minHeight += vgap;
         }

        {
            var typicalWidth:Number = typicalElt.getPreferredBoundsWidth();
            var typicalHeight:Number = typicalElt.getPreferredBoundsHeight();
            llv.minorSize = Math.max(llv.minorSize, typicalWidth);
            llv.defaultMajorSize = typicalHeight; 
        }
        if (layoutTarget)

    private function measureVirtual(layoutTarget:GroupBase):void
    {
        var eltCount:uint = layoutTarget.numElements;
        var measuredEltCount:int = (requestedRowCount != -1) ? requestedRowCount : 
                                                               Math.max(requestedMinRowCount, eltCount);
        
        var hPadding:Number = paddingLeft + paddingRight;
        var vPadding:Number = paddingTop + paddingBottom;
