         var layoutElement:ILayoutElement;
         
         var cache:Dictionary = new Dictionary(true);
-        
-        for (var i:int = 0; i < count; i++)
+        var i:int;
+        
+        // Populate rowBaselines with baseline information from rows.
+        var n:int = _constraintRows.length;
+        var row:ConstraintRow;
+        var obj:Object = new Object();
+        if (rowBaselines == null)
+            rowBaselines = new Vector.<Array>();
+        else
+            rowBaselines.length = 0;
+        
+        for (i = 0; i < n; i++)
+        {
+            row = _constraintRows[i];
+            rowBaselines[i] = LayoutElementHelper.parseConstraintExp(row.baseline);
+            
+            var maxAscentStr:String = rowBaselines[i][1];
+            if (maxAscentStr && maxAscentStr != "maxAscent")
+                throw new Error(ResourceManager.getInstance().getString("layout", "invalidBaselineOnRow",
+                    [ row.id, row.baseline ]));
+        }
+        
+        for (i = 0; i < count; i++)
         {
             layoutElement = layoutTarget.getElementAt(i);
             if (!layoutElement || !layoutElement.includeInLayout)

        
        _constraintRows = temp;
        rowsObject = obj;
        rowBaselines = baselines;
        
        if (target)
        {

        colSpanElements = null;
        rowSpanElements = null;
        otherElements = null;
        rowMaxAscents = null;
        constraintCache = null;
    }
    
