flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/3] git commit: [flex-asjs] [refs/heads/develop] - handle padding in layouts
Date Thu, 03 Sep 2015 22:23:19 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 43b444645 -> 93b358a48


handle padding in layouts


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/93b358a4
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/93b358a4
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/93b358a4

Branch: refs/heads/develop
Commit: 93b358a48d60edae3529ece84f7c327988a12cfa
Parents: 4906f08
Author: Alex Harui <aharui@apache.org>
Authored: Thu Sep 3 15:19:31 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Sep 3 15:23:39 2015 -0700

----------------------------------------------------------------------
 .../flex/html/beads/layouts/HorizontalLayout.as | 29 ++++++++--------
 .../flex/html/beads/layouts/VerticalLayout.as   | 30 +++++++++--------
 .../FlexibleFirstChildHorizontalLayout.as       | 18 +++++-----
 .../layouts/OneFlexibleChildHorizontalLayout.as | 35 +++++++++++---------
 .../layouts/OneFlexibleChildVerticalLayout.as   | 29 ++++++++--------
 .../html/beads/layouts/VerticalColumnLayout.as  | 13 +++++---
 .../html/supportClasses/ContainerContentArea.js |  5 +++
 7 files changed, 90 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/93b358a4/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HorizontalLayout.as
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HorizontalLayout.as
index a8a235f..0ebdc52 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HorizontalLayout.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HorizontalLayout.as
@@ -28,7 +28,9 @@ package org.apache.flex.html.beads.layouts
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.geom.Rectangle;
 	import org.apache.flex.utils.dbg.DOMPathUtil;
+    import org.apache.flex.utils.CSSContainerUtils;
 
     /**
      *  The HorizontalLayout class is a simple layout
@@ -81,7 +83,8 @@ package org.apache.flex.html.beads.layouts
             //trace(DOMPathUtil.getPath(host), event ? event.type : "fixed size");
 			var layoutParent:ILayoutParent = host.getBeadByType(ILayoutParent) as ILayoutParent;
 			var contentView:IParentIUIBase = layoutParent.contentView;
-			
+            var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
+            
 			var n:int = contentView.numElements;
             var hostSizedToContent:Boolean = host.isHeightSizedToContent();
             var ilc:ILayoutChild;
@@ -162,9 +165,9 @@ package org.apache.flex.html.beads.layouts
                 if (i == 0)
                 {
                     if (ilc)
-                        ilc.setX(ml);
+                        ilc.setX(ml + padding.left);
                     else
-                        child.x = ml;
+                        child.x = ml + padding.left;
                 }
                 else
                 {
@@ -185,7 +188,7 @@ package org.apache.flex.html.beads.layouts
                 {
                     // if host is sized by parent,
                     // we can position and size children horizontally now
-                    setPositionAndHeight(child, top, mt, bottom, mb, h);
+                    setPositionAndHeight(child, top, mt, padding.top, bottom, mb, padding.bottom,
h);
                     maxHeight = Math.max(maxHeight, mt + child.height + mb);
                 }
                 else
@@ -216,8 +219,8 @@ package org.apache.flex.html.beads.layouts
                     child = contentView.getElementAt(i) as IUIBase;
                     if (child == null || !child.visible) continue;
                     var obj:Object = verticalMargins[i];
-                    setPositionAndHeight(child, obj.top, obj.marginTop,
-                        obj.bottom, obj.marginBottom, maxHeight);
+                    setPositionAndHeight(child, obj.top, obj.marginTop, padding.top,
+                        obj.bottom, obj.marginBottom, padding.bottom, maxHeight);
                 }
             }
 			for (i = 0; i < n; i++)
@@ -234,7 +237,7 @@ package org.apache.flex.html.beads.layouts
                 if (ilc)
                 {
     				if (obj.valign == "top")
-                        ilc.setY(obj.marginTop);
+                        ilc.setY(obj.marginTop + padding.top);
     				else if (valign == "bottom")
                         ilc.setY(maxHeight - child.height - obj.marginBottom);
     				else // TODO: aharui - baseline
@@ -243,7 +246,7 @@ package org.apache.flex.html.beads.layouts
                 else
                 {
                     if (obj.valign == "top")
-                        child.y = obj.marginTop;
+                        child.y = obj.marginTop + padding.top;
                     else if (valign == "bottom")
                         child.y = maxHeight - child.height - obj.marginBottom;
                     else // TODO: aharui - baseline
@@ -260,8 +263,8 @@ package org.apache.flex.html.beads.layouts
 			return sizeChanged;
 		}
         
-        private function setPositionAndHeight(child:IUIBase, top:Number, mt:Number,
-                                             bottom:Number, mb:Number, h:Number):void
+        private function setPositionAndHeight(child:IUIBase, top:Number, mt:Number, pt:Number,
+                                             bottom:Number, mb:Number, pb:Number, h:Number):void
         {
             var heightSet:Boolean = false;
             
@@ -278,10 +281,10 @@ package org.apache.flex.html.beads.layouts
             else 
             {
                 if (ilc)
-                    ilc.setY(mt);
+                    ilc.setY(mt + pt);
                 else
-                    child.y = mt;
-                hh -= mt;
+                    child.y = mt + pt;
+                hh -= mt + pt;
             }
             if (!isNaN(bottom))
             {

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/93b358a4/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalLayout.as
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalLayout.as
index fd741b4..53f60ce 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalLayout.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalLayout.as
@@ -28,8 +28,10 @@ package org.apache.flex.html.beads.layouts
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
+    import org.apache.flex.geom.Rectangle;
 	import org.apache.flex.utils.dbg.DOMPathUtil;
     import org.apache.flex.utils.CSSUtils;
+    import org.apache.flex.utils.CSSContainerUtils;
 	
 	/**
 	 *  The VerticalLayout class is a simple layout
@@ -78,7 +80,8 @@ package org.apache.flex.html.beads.layouts
 		{
 			var layoutParent:ILayoutParent = host.getBeadByType(ILayoutParent) as ILayoutParent;
 			var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(host);
-
+            var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
+            
 			var n:int = contentView.numElements;
 			var hasHorizontalFlex:Boolean;
 			var hostSizedToContent:Boolean = host.isWidthSizedToContent();
@@ -115,9 +118,9 @@ package org.apache.flex.html.beads.layouts
 				if (i == 0)
                 {
                     if (ilc)
-                        ilc.setY(mt);
+                        ilc.setY(mt + padding.top);
                     else
-    					child.y = mt;
+    					child.y = mt + padding.top;
                 }
 				else
                 {
@@ -172,7 +175,8 @@ package org.apache.flex.html.beads.layouts
 				{
 					// if host is sized by parent,
 					// we can position and size children horizontally now
-					setPositionAndWidth(child, left, ml, right, mr, w);
+					setPositionAndWidth(child, left, ml, padding.left, 
+                        right, mr, padding.right, w);
 				}
 				else
 				{
@@ -197,8 +201,8 @@ package org.apache.flex.html.beads.layouts
 					child = contentView.getElementAt(i) as IUIBase;
 					if (child == null || !child.visible) continue;
 					var obj:Object = flexibleHorizontalMargins[i];
-					setPositionAndWidth(child, obj.left, obj.marginLeft,
-						obj.right, obj.marginRight, maxWidth);
+					setPositionAndWidth(child, obj.left, obj.marginLeft, padding.left,
+						obj.right, obj.marginRight, padding.right, maxWidth);
 				}
 			}
 			if (hasHorizontalFlex)
@@ -216,14 +220,14 @@ package org.apache.flex.html.beads.layouts
                             if (obj.marginLeft == "auto" && obj.marginRight == "auto")
                                 ilc.setX(maxWidth - child.width / 2);
                             else if (obj.marginLeft == "auto")
-                                ilc.setX(maxWidth - child.width - obj.marginRight);     
                      
+                                ilc.setX(maxWidth - child.width - obj.marginRight - padding.right);
                           
                         }
                         else
                         {
         					if (obj.marginLeft == "auto" && obj.marginRight == "auto")
         						child.x = maxWidth - child.width / 2;
         					else if (obj.marginLeft == "auto")
-        						child.x = maxWidth - child.width - obj.marginRight;
+        						child.x = maxWidth - child.width - obj.marginRight - padding.right;
                         }
 					}
 				}
@@ -238,8 +242,8 @@ package org.apache.flex.html.beads.layouts
 			return sizeChanged;
 		}
 		
-		private function setPositionAndWidth(child:IUIBase, left:Number, ml:Number,
-											 right:Number, mr:Number, w:Number):void
+		private function setPositionAndWidth(child:IUIBase, left:Number, ml:Number, pl:Number,
+											 right:Number, mr:Number, pr:Number, w:Number):void
 		{
 			var widthSet:Boolean = false;
 			
@@ -256,10 +260,10 @@ package org.apache.flex.html.beads.layouts
 			else 
 			{
                 if (ilc)
-                    ilc.setX(ml);
+                    ilc.setX(ml + pl);
                 else
-    				child.x = ml;
-				ww -= ml;
+    				child.x = ml + pl;
+				ww -= ml + pl;
 			}
 			if (!isNaN(right))
 			{

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/93b358a4/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
index a23b9b8..2191645 100644
--- a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
@@ -21,7 +21,7 @@ package org.apache.flex.html.beads.layouts
 	import org.apache.flex.core.IBeadLayout;
 	import org.apache.flex.core.ILayoutChild;
     import org.apache.flex.core.ILayoutParent;
-	import org.apache.flex.core.IParent;
+	import org.apache.flex.core.IParentIUIBase;
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.IViewport;
@@ -131,7 +131,8 @@ package org.apache.flex.html.beads.layouts
 		public function layout():Boolean
 		{
 			var layoutParent:ILayoutParent = host.getBeadByType(ILayoutParent) as ILayoutParent;
-			var contentView:IParent = layoutParent.contentView;
+			var contentView:IParentIUIBase = layoutParent.contentView as IParentIUIBase;
+            var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
             var hostSizedToContent:Boolean = host.isHeightSizedToContent();
 			
 			var n:int = contentView.numElements;
@@ -143,11 +144,10 @@ package org.apache.flex.html.beads.layouts
 			maxHeight = 0;
 			var verticalMargins:Array = [];
 			
-            var xx:Number = layoutParent.resizableView.width;
+            var xx:Number = contentView.width;
             if (isNaN(xx) || xx <= 0)
                 return true;
-            var uiMetrics:Rectangle = CSSContainerUtils.getBorderAndPaddingMetrics(layoutParent.resizableView);
-            xx -= uiMetrics.left + uiMetrics.right + 1; // some browsers won't layout to
the edge
+            xx -= padding.right + 1; // some browsers won't layout to the edge
             
             for (var i:int = n - 1; i >= 0; i--)
 			{
@@ -208,12 +208,12 @@ package org.apache.flex.html.beads.layouts
 					if (isNaN(mr))
 						mr = 0;
 				}
-				child.y = mt;
+				child.y = mt + padding.top;
 				maxHeight = Math.max(maxHeight, mt + child.height + mb);
 				if (i == 0)
                 {
-                    child.x = ml;
-                    child.width = xx - mr;
+                    child.x = ml + padding.left;
+                    child.width = xx - mr - child.x;
                 }
 				else
                     child.x = xx - child.width - mr;
@@ -234,7 +234,7 @@ package org.apache.flex.html.beads.layouts
 					child.y = obj.marginTop;
 			}
             if (hostSizedToContent)
-                ILayoutChild(contentView).setHeight(maxHeight, true);
+                ILayoutChild(contentView).setHeight(maxHeight + padding.top + padding.bottom,
true);
 			
             return true;
 		}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/93b358a4/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as
b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as
index d992d6b..416fb2c 100644
--- a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as
@@ -19,17 +19,19 @@
 package org.apache.flex.html.beads.layouts
 {
 	import org.apache.flex.core.IBeadLayout;
-    import org.apache.flex.core.IDocument;
+	import org.apache.flex.core.IDocument;
 	import org.apache.flex.core.ILayoutChild;
-    import org.apache.flex.core.ILayoutParent;
+	import org.apache.flex.core.ILayoutParent;
+	import org.apache.flex.core.IParentIUIBase;
 	import org.apache.flex.core.IStrand;
-    import org.apache.flex.core.IParentIUIBase;
-    import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
-    import org.apache.flex.utils.CSSUtils;
+	import org.apache.flex.geom.Rectangle;
+	import org.apache.flex.utils.CSSUtils;
+    import org.apache.flex.utils.CSSContainerUtils;
 
     /**
      *  The OneFlexibleChildHorizontalLayout class is a simple layout
@@ -148,6 +150,7 @@ package org.apache.flex.html.beads.layouts
 		{
             var layoutParent:ILayoutParent = host.getBeadByType(ILayoutParent) as ILayoutParent;
             var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(host);
+            var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
             actualChild = document[flexibleChild];
 
             var ilc:ILayoutChild;
@@ -160,9 +163,9 @@ package org.apache.flex.html.beads.layouts
 			maxHeight = 0;
 			var verticalMargins:Array = new Array(n);
 			
-            var ww:Number = contentView.width;
+            var ww:Number = contentView.width - padding.right;
             var hh:Number = contentView.height;
-            var xx:int = 0;
+            var xx:int = padding.left;
             var flexChildIndex:int;
             var ml:Number;
             var mr:Number;
@@ -190,7 +193,7 @@ package org.apache.flex.html.beads.layouts
                 mb = CSSUtils.getBottomValue(marginBottom, margin, hh);
                 mr = CSSUtils.getRightValue(marginRight, margin, ww);
                 ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
-                child.y = mt;
+                child.y = mt + padding.top;
                 if (child is ILayoutChild)
                 {
                     ilc = child as ILayoutChild;
@@ -219,7 +222,7 @@ package org.apache.flex.html.beads.layouts
     				mb = CSSUtils.getTopValue(marginBottom, margin, hh);
                     mr = CSSUtils.getRightValue(marginRight, margin, ww);
                     ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
-                    child.y = mt;
+                    child.y = mt + padding.top;
                     if (child is ILayoutChild)
                     {
                         ilc = child as ILayoutChild;
@@ -252,25 +255,25 @@ package org.apache.flex.html.beads.layouts
                 }
                 maxHeight = Math.max(maxHeight, mt + child.height + mb);
                 child.x = xx + ml;
-                child.width = ww - xx - mr;
+                child.width = ww - xx - child.x;
                 valign = ValuesManager.valuesImpl.getValue(child, "vertical-align");
                 verticalMargins[flexChildIndex] = { marginTop: mt, marginBottom: mb, valign:
valign };
             }
             if (hostSizedToContent)
-                ILayoutChild(contentView).setHeight(maxHeight, true);
+                ILayoutChild(contentView).setHeight(maxHeight + padding.top + padding.bottom,
true);
             
             for (i = 0; i < n; i++)
 			{
 				var obj:Object = verticalMargins[i]
 				child = contentView.getElementAt(i) as IUIBase;
-                setPositionAndHeight(child, obj.top, obj.marginTop,
-                    obj.bottom, obj.marginBottom, maxHeight, obj.valign);
+                setPositionAndHeight(child, obj.top, obj.marginTop, padding.top,
+                    obj.bottom, obj.marginBottom, padding.bottom, maxHeight, obj.valign);
 			}
             return true;
 		}
 
-        private function setPositionAndHeight(child:IUIBase, top:Number, mt:Number,
-                                              bottom:Number, mb:Number, h:Number, valign:String):void
+        private function setPositionAndHeight(child:IUIBase, top:Number, mt:Number, pt:Number,
+                                              bottom:Number, mb:Number, pb:Number, h:Number,
valign:String):void
         {
             var heightSet:Boolean = false; // if we've set the height in a way that gens
a change event
             var ySet:Boolean = false; // if we've set the y yet.
@@ -315,7 +318,7 @@ package org.apache.flex.html.beads.layouts
             else if (valign == "bottom")
                 child.y = h - child.height - mb;
             else
-                child.y = mt;
+                child.y = mt + pt;
             if (!heightSet)
                 child.dispatchEvent(new Event("sizeChanged"));
         }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/93b358a4/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
index 73f0f3a..e06df50 100644
--- a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
@@ -19,16 +19,18 @@
 package org.apache.flex.html.beads.layouts
 {
 	import org.apache.flex.core.IBeadLayout;
-    import org.apache.flex.core.IDocument;
+	import org.apache.flex.core.IDocument;
 	import org.apache.flex.core.ILayoutChild;
-    import org.apache.flex.core.ILayoutParent;
+	import org.apache.flex.core.ILayoutParent;
+	import org.apache.flex.core.IParentIUIBase;
 	import org.apache.flex.core.IStrand;
-    import org.apache.flex.core.IParentIUIBase;
-    import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.geom.Rectangle;
+    import org.apache.flex.utils.CSSContainerUtils;
 
     /**
      *  The OneFlexibleChildVerticalLayout class is a simple layout
@@ -147,6 +149,7 @@ package org.apache.flex.html.beads.layouts
 		{
             var layoutParent:ILayoutParent = host.getBeadByType(ILayoutParent) as ILayoutParent;
             var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(host);
+            var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
 			actualChild = document[flexibleChild];
             
             var ilc:ILayoutChild;
@@ -159,8 +162,8 @@ package org.apache.flex.html.beads.layouts
 			maxWidth = 0;
             
             var w:Number = contentView.width;			
-            var hh:Number = contentView.height;
-            var yy:int = 0;
+            var hh:Number = contentView.height - padding.bottom;
+            var yy:int = padding.top;
             var flexChildIndex:int;
             var ml:Number;
             var mr:Number;
@@ -246,7 +249,7 @@ package org.apache.flex.html.beads.layouts
                         ilc.setWidth(contentView.width * ilc.percentWidth / 100, !isNaN(ilc.percentHeight));
                 }
                 maxWidth = Math.max(maxWidth, ml + child.width + mr);
-                setPositionAndWidth(child, left, ml, right, mr, w);
+                setPositionAndWidth(child, left, ml, padding.left, right, mr, padding.right,
w);
                 child.y = yy + mt;
                 yy += child.height + mt + mb;
                 lastmb = mb;
@@ -322,7 +325,7 @@ package org.apache.flex.html.beads.layouts
                         if (!isNaN(ilc.percentWidth))
                             ilc.setWidth(contentView.width * ilc.percentWidth / 100, !isNaN(ilc.percentHeight));
                     }
-                    setPositionAndWidth(child, left, ml, right, mr, w);
+                    setPositionAndWidth(child, left, ml, padding.left, right, mr, padding.right,
w);
                     maxWidth = Math.max(maxWidth, ml + child.width + mr);
                     child.y = hh - child.height - mb;
     				hh -= child.height + mt + mb;
@@ -396,16 +399,16 @@ package org.apache.flex.html.beads.layouts
                 if (!isNaN(ilc.percentWidth))
                     ilc.setWidth(contentView.width * ilc.percentWidth / 100, !isNaN(ilc.percentHeight));
             }
-            setPositionAndWidth(child, left, ml, right, mr, w);
+            setPositionAndWidth(child, left, ml, padding.left, right, mr, padding.right,
w);
             maxWidth = Math.max(maxWidth, ml + child.width + mr);
             child.y = yy + mt;
-            child.height = hh - yy - mb;
+            child.height = hh - mb - child.y;
             
             return true;
 		}
 
-        private function setPositionAndWidth(child:IUIBase, left:Number, ml:Number,
-                                             right:Number, mr:Number, w:Number):void
+        private function setPositionAndWidth(child:IUIBase, left:Number, ml:Number, pl:Number,
+                                             right:Number, mr:Number, pr:Number, w:Number):void
         {
             var widthSet:Boolean = false;
             
@@ -419,7 +422,7 @@ package org.apache.flex.html.beads.layouts
             else 
             {
                 if (isNaN(right))
-                    child.x = ml;
+                    child.x = ml + pl;
                 ww -= ml;
             }
             if (!isNaN(right))

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/93b358a4/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
index be14146..122f9b3 100644
--- a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
@@ -20,16 +20,18 @@ package org.apache.flex.html.beads.layouts
 {	
 	import org.apache.flex.core.IBeadLayout;
 	import org.apache.flex.core.IContainer;
-    import org.apache.flex.core.ILayoutParent;
+	import org.apache.flex.core.ILayoutParent;
 	import org.apache.flex.core.IMeasurementBead;
-    import org.apache.flex.core.IParent;
+	import org.apache.flex.core.IParent;
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.geom.Rectangle;
 	import org.apache.flex.utils.CSSUtils;
+    import org.apache.flex.utils.CSSContainerUtils;    
 	
 	/**
 	 * ColumnLayout is a class that organizes the positioning of children
@@ -98,6 +100,7 @@ package org.apache.flex.html.beads.layouts
             var host:UIBase = UIBase(_strand);
             var layoutParent:ILayoutParent = host.getBeadByType(ILayoutParent) as ILayoutParent;
             var contentView:IParent = layoutParent.contentView;
+            var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
 			var sw:Number = host.width;
 			var sh:Number = host.height;
 			
@@ -162,8 +165,8 @@ package org.apache.flex.html.beads.layouts
 			}
 			
             var lastmb:Number = 0;
-			var curx:int = 0;
-			var cury:int = 0;
+			var curx:int = padding.left;
+			var cury:int = padding.top;
 			var maxHeight:int = 0;
             var maxWidth:int = 0;
 			col = 0;
@@ -180,7 +183,7 @@ package org.apache.flex.html.beads.layouts
 					cury += rows[0].rowHeight;
                     rows.shift();
 					col = 0;
-					curx = 0;
+					curx = padding.left;
 				}
 			}
 			if (!hasWidth && n > 0 && !isNaN(maxWidth))

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/93b358a4/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/ContainerContentArea.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/ContainerContentArea.js
b/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/ContainerContentArea.js
index febf12a..ffd190c 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/ContainerContentArea.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/ContainerContentArea.js
@@ -56,6 +56,11 @@ org.apache.flex.html.supportClasses.ContainerContentArea.prototype.createElement
   // also absolutely positioned
   this.positioner.style.position = 'relative';
   this.positioner.style.backgroundColor = 'inherit';
+  this.positioner.style.paddingLeft = 'inherit';
+  this.positioner.style.paddingRight = 'inherit';
+  this.positioner.style.paddingTop = 'inherit';
+  this.positioner.style.paddingBottom = 'inherit';
+  this.positioner.style.padding = 'inherit';
   this.element.flexjs_wrapper = this;
 
   this.addEventListener('layoutNeeded',


Mime
View raw message