You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2015/08/27 08:46:02 UTC

[1/9] git commit: [flex-asjs] [refs/heads/develop] - just like the AS side, check left/right and top/bottom when determining sizeToContent and then use that correctly in ContainerView

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 7c7dd0508 -> 94502fde9


just like the AS side, check left/right and top/bottom when determining sizeToContent and then use that correctly in ContainerView


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

Branch: refs/heads/develop
Commit: 9a3e19a7df586cfcf71e7459990e704f5666bcf9
Parents: 7c7dd05
Author: Alex Harui <ah...@apache.org>
Authored: Wed Aug 26 12:28:05 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Aug 26 12:28:05 2015 -0700

----------------------------------------------------------------------
 .../Core/js/src/org/apache/flex/core/UIBase.js  | 14 ++++++--
 .../org/apache/flex/html/beads/ContainerView.js | 36 +++++++++++++-------
 2 files changed, 35 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9a3e19a7/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js b/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js
index 0c33d65..04dfbaa 100644
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js
@@ -764,7 +764,12 @@ org.apache.flex.core.UIBase.prototype.setWidthAndHeight =
  */
 org.apache.flex.core.UIBase.prototype.isWidthSizedToContent = function()
 {
-  return (isNaN(this.explicitWidth_) && isNaN(this.percentWidth_));
+  if (!isNaN(this.explicitWidth_) || !isNaN(this.percentWidth_))
+    return false;
+  var scv = window.getComputedStyle(this.element);
+  if (scv.left != 'auto' && scv.right != 'auto')
+    return false;
+  return true;
 };
 
 
@@ -774,7 +779,12 @@ org.apache.flex.core.UIBase.prototype.isWidthSizedToContent = function()
  */
 org.apache.flex.core.UIBase.prototype.isHeightSizedToContent = function()
 {
-  return (isNaN(this.explicitHeight_) && isNaN(this.percentHeight_));
+  if (!isNaN(this.explicitHeight_) || !isNaN(this.percentHeight_))
+    return false;
+  var scv = window.getComputedStyle(this.element);
+  if (scv.top != 'auto' && scv.bottom != 'auto')
+    return false;
+  return true;
 };
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9a3e19a7/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
index 23a951a..3c2f63a 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
@@ -20,6 +20,7 @@ goog.require('org.apache.flex.core.ILayoutParent');
 goog.require('org.apache.flex.html.beads.models.ViewportModel');
 goog.require('org.apache.flex.html.supportClasses.ContainerContentArea');
 goog.require('org.apache.flex.html.supportClasses.Viewport');
+goog.require('org.apache.flex.utils.BeadMetrics');
 
 
 
@@ -148,6 +149,7 @@ org.apache.flex.html.beads.ContainerView.
  */
 org.apache.flex.html.beads.ContainerView.
     prototype.sizeChangeHandler = function(event) {
+  if (this.runningLayout) return;
   this.performLayout(event);
 };
 
@@ -157,6 +159,7 @@ org.apache.flex.html.beads.ContainerView.
  */
 org.apache.flex.html.beads.ContainerView.
     prototype.resizeHandler = function(event) {
+  if (this.runningLayout) return;
   this.performLayout(event);
 };
 
@@ -166,8 +169,8 @@ org.apache.flex.html.beads.ContainerView.
  */
  org.apache.flex.html.beads.ContainerView.
     prototype.childResizeHandler = function(event) {
-    if (this.runningLayout) return;
-    this.performLayout(event);
+  if (this.runningLayout) return;
+  this.performLayout(event);
 };
 
 
@@ -178,10 +181,10 @@ org.apache.flex.html.beads.ContainerView.
     prototype.completeSetup = function() {
   this.createViewport();
 
-   this._strand.addEventListener('childrenAdded',
+  this._strand.addEventListener('childrenAdded',
       org.apache.flex.utils.Language.closure(this.childrenChangedHandler, this, 'childrenAdded'));
-   this.childrenChangedHandler(null);
-   this._strand.addEventListener('childrenAdded',
+  this.childrenChangedHandler(null);
+  this._strand.addEventListener('childrenAdded',
       org.apache.flex.utils.Language.closure(this.changeHandler, this, 'childrenAdded'));
   this._strand.addEventListener('childrenRemoved',
       org.apache.flex.utils.Language.closure(this.changeHandler, this, 'childrenRemoved'));
@@ -253,14 +256,21 @@ org.apache.flex.html.beads.ContainerView.
  */
 org.apache.flex.html.beads.ContainerView.
     prototype.adjustSizeAfterLayout = function() {
-  var max = this.contentView.width;//this.layout.maxWidth;
-  if (isNaN(this.resizableView.explicitWidth) && !isNaN(max))
-    this.resizableView.setWidth(max, true);
-  max = this.contentView.height;//this.layout.maxHeight;
-  if (isNaN(this.resizableView.explicitHeight) && !isNaN(max))
-    this.resizableView.setHeight(max, true);
-
-  this.layoutContainer(false, false);
+  var host = this._strand;
+  var metrics = org.apache.flex.utils.BeadMetrics.getMetrics(host);
+
+  if (host.isWidthSizedToContent() && host.isHeightSizedToContent()) {
+    host.setWidthAndHeight(this.viewportModel_.contentWidth + metrics.left + metrics.right,
+                           this.viewportModel_.contentHeight + metrics.top + metrics.bottom, false);
+  }
+  else if (!host.isWidthSizedToContent() && host.isHeightSizedToContent()) {
+    host.setHeight(this.viewportModel_.contentHeight + metrics.top + metrics.bottom, false);
+  }
+  else if (host.isWidthSizedToContent() && !host.isHeightSizedToContent()) {
+    host.setWidth(this.viewportModel_.contentWidth + metrics.left + metrics.right, false);
+  }
+
+  this.layoutContainer(host.isWidthSizedToContent(), host.isHeightSizedToContent());
 
   // The JS version of Panel matches the content space to the viewport since HTML
   // takes care of scrollbars


[3/9] git commit: [flex-asjs] [refs/heads/develop] - fix copy of styles to backing properties so we can better test sizedToContent

Posted by ah...@apache.org.
fix copy of styles to backing properties so we can better test sizedToContent


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

Branch: refs/heads/develop
Commit: eef961519fb95f0dbdbdf5fb0d8a6a66d9066f95
Parents: 9547533
Author: Alex Harui <ah...@apache.org>
Authored: Wed Aug 26 17:32:41 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Aug 26 17:32:41 2015 -0700

----------------------------------------------------------------------
 .../Core/as/src/org/apache/flex/core/UIBase.as  | 26 ++++++++++---
 .../Core/js/src/org/apache/flex/core/UIBase.js  | 40 +++++++++++++++++++-
 2 files changed, 58 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eef96151/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as b/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
index a017e38..5e3d7d6 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
@@ -931,7 +931,7 @@ package org.apache.flex.core
         {
             var c:Class;
 			
-			if (isNaN(_width) && isNaN(_percentWidth)) 
+			if (isNaN(_explicitWidth) && isNaN(_percentWidth)) 
             {
 				var value:* = ValuesManager.valuesImpl.getValue(this,"width");
 				if (value !== undefined) 
@@ -939,14 +939,21 @@ package org.apache.flex.core
 					if (value is String)
                     {
                         var s:String = String(value);
-    					_percentWidth = Number(s.substring(0, s.length - 1));
+                        if (s.indexOf("%") != -1)
+        					_percentWidth = Number(s.substring(0, s.length - 1));
+                        else
+                        {
+                            if (s.indexOf("px") != -1)
+                                s = s.substring(0, s.length - 2);
+                            _width = _explicitWidth = Number(s);                            
+                        }
                     }
 					else 
-						_width = value as Number;
+						_width = _explicitWidth = value as Number;
 				}
 			}
 			
-			if (isNaN(_height) && isNaN(_percentHeight)) 
+			if (isNaN(_explicitHeight) && isNaN(_percentHeight)) 
             {
 				value = ValuesManager.valuesImpl.getValue(this,"height");
 				if (value !== undefined) 
@@ -954,10 +961,17 @@ package org.apache.flex.core
                     if (value is String)
                     {
     					s = String(value);
-						_percentHeight = Number(s.substring(0, s.length - 1));
+                        if (s.indexOf("%") != -1)
+    						_percentHeight = Number(s.substring(0, s.length - 1));
+                        else
+                        {
+                            if (s.indexOf("px") != -1)
+                                s = s.substring(0, s.length - 2);
+                            _height = _explicitHeight = Number(s);
+                        }
 					} 
                     else
-						_height = value as Number;
+						_height = _explicitHeight = value as Number;
 				}
 			}
             

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eef96151/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js b/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js
index 04dfbaa..3721dc0 100644
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js
@@ -224,11 +224,47 @@ org.apache.flex.core.UIBase.prototype.removeElement = function(c) {
 /**
  */
 org.apache.flex.core.UIBase.prototype.addedToParent = function() {
-
+  var s, value;
   var styles = this.style;
   if (styles)
     org.apache.flex.core.ValuesManager.valuesImpl.applyStyles(this, styles);
 
+  if (isNaN(this.explicitWidth_) && isNaN(this.percentWidth_)) {
+    value = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this, 'width');
+    if (value !== undefined) {
+      if (typeof(value) === 'string') {
+        s = value;
+        if (s.indexOf('%') != -1)
+          this.percentWidth_ = Number(s.substring(0, s.length - 1));
+        else {
+          if (s.indexOf('px') != -1)
+             s = s.substring(0, s.length - 2);
+          this.width_ = this.explicitWidth_ = Number(s);
+        }
+      }
+      else
+        this.width_ = this.explicitWidth_ = value;
+    }
+  }
+
+  if (isNaN(this.explicitHeight_) && isNaN(this.percentHeight_)) {
+    value = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this, 'height');
+    if (value !== undefined) {
+      if (typeof(value) === 'string') {
+        s = value;
+        if (s.indexOf('%') != -1)
+          this.percentHeight_ = Number(s.substring(0, s.length - 1));
+        else {
+          if (s.indexOf('px') != -1)
+            s = s.substring(0, s.length - 2);
+          this.height_ = this.explicitHeight_ = Number(s);
+        }
+      }
+      else
+        this.height_ = this.explicitHeight_ = value;
+    }
+  }
+
   if (this.mxmlBeads_) {
     var n = this.mxmlBeads_.length;
     for (var i = 0; i < n; i++) {
@@ -661,7 +697,7 @@ Object.defineProperties(org.apache.flex.core.UIBase.prototype, {
                 if (this.lastDisplay_) {
                   this.positioner.style.display = this.lastDisplay_;
                 } else {
-                  this.positioner.style.display = this.positioner.internalDisplay;
+                  this.positioner.style.display = this.internalDisplay;
                 }
                 this.dispatchEvent(new org.apache.flex.events.Event('show'));
               }


[7/9] git commit: [flex-asjs] [refs/heads/develop] - Many layouts rely on the contentView size and don't check the model

Posted by ah...@apache.org.
Many layouts rely on the contentView size and don't check the model


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

Branch: refs/heads/develop
Commit: dbce087cb36e9551fc38f293df619d38a20272f7
Parents: 2999ee0
Author: Alex Harui <ah...@apache.org>
Authored: Wed Aug 26 23:19:41 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Aug 26 23:19:41 2015 -0700

----------------------------------------------------------------------
 .../HTML/js/src/org/apache/flex/html/beads/ContainerView.js        | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/dbce087c/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
index ce10234..859a923 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
@@ -226,6 +226,8 @@ org.apache.flex.html.beads.ContainerView.
     this.viewportModel_.contentHeight = this._strand.height;
     this.viewportModel_.contentX = 0;
     this.viewportModel_.contentY = 0;
+    this.contentView.width = this.viewportModel_.contentWidth;
+    this.contentView.height = this.viewportModel_.contentHeight;
 };
 
 


[5/9] git commit: [flex-asjs] [refs/heads/develop] - use sizedToContent (and fix up use of internalDisplay)

Posted by ah...@apache.org.
use sizedToContent (and fix up use of internalDisplay)


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

Branch: refs/heads/develop
Commit: f7de7d90cdce3c663f653dd8acc7cb39287cb640
Parents: cd7b69e
Author: Alex Harui <ah...@apache.org>
Authored: Wed Aug 26 17:33:55 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Aug 26 17:33:55 2015 -0700

----------------------------------------------------------------------
 .../org/apache/flex/core/HTMLElementWrapper.js    |  4 ++--
 .../apache/flex/html/beads/layouts/BasicLayout.js | 18 +++++++-----------
 .../flex/html/beads/layouts/ButtonBarLayout.js    |  2 +-
 .../flex/html/beads/layouts/HorizontalLayout.js   | 11 ++++-------
 .../apache/flex/html/beads/layouts/TileLayout.js  |  4 ++--
 .../flex/html/beads/layouts/VerticalLayout.js     | 10 ++++------
 6 files changed, 20 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f7de7d90/frameworks/projects/Core/js/src/org/apache/flex/core/HTMLElementWrapper.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/HTMLElementWrapper.js b/frameworks/projects/Core/js/src/org/apache/flex/core/HTMLElementWrapper.js
index e8ecb5b..c9b82bf 100644
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/HTMLElementWrapper.js
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/HTMLElementWrapper.js
@@ -59,10 +59,10 @@ org.apache.flex.core.HTMLElementWrapper.prototype._beads = null;
 
 
 /**
- * @protected
+ * Used internally by layouts.
  * @type {string}
  */
-org.apache.flex.core.HTMLElementWrapper.prototype.internalDisplay = 'inline';
+org.apache.flex.core.HTMLElementWrapper.prototype.internalDisplay = 'block';
 
 
 /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f7de7d90/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/BasicLayout.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/BasicLayout.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/BasicLayout.js
index daaf348..80f0f42 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/BasicLayout.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/BasicLayout.js
@@ -28,8 +28,6 @@ goog.require('org.apache.flex.utils.Language');
 org.apache.flex.html.beads.layouts.BasicLayout =
     function() {
   this.strand_ = null;
-  this.lastWidth_ = '';
-  this.lastHeight_ = '';
   this.className = 'BasicLayout';
 };
 
@@ -66,18 +64,16 @@ org.apache.flex.html.beads.layouts.BasicLayout.
 
   var viewBead = this.strand_.getBeadByType(org.apache.flex.core.ILayoutParent);
   var contentView = viewBead.contentView;
-  var cvs = contentView.positioner.style;
-  var cv = getComputedStyle(contentView.positioner);
   w = contentView.width;
-  var hasWidth = cvs.width !== undefined && cvs.width != this.lastWidth_;
+  var hasWidth = !this.strand_.isWidthSizedToContent();
   h = contentView.height;
-  var hasHeight = cvs.height !== undefined && cvs.height != this.lastHeight_;
+  var hasHeight = !this.strand_.isHeightSizedToContent();
   var maxHeight = 0;
   var maxWidth = 0;
   n = contentView.numElements;
   for (i = 0; i < n; i++) {
     var child = contentView.getElementAt(i);
-    child.positioner.internalDisplay = 'block';
+    child.internalDisplay = 'block';
     var left = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'left');
     var right = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'right');
     var top = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'top');
@@ -119,10 +115,10 @@ org.apache.flex.html.beads.layouts.BasicLayout.
   }
   // if there are children and maxHeight is ok, use it.
   // maxHeight can be NaN if the child hasn't been rendered yet.
-  if (!hasWidth && n > 0 && !isNaN(maxWidth) && (!(cv.left != 'auto' && cv.right != 'auto'))) {
-    this.lastWidth_ = cvs.width = maxWidth.toString() + 'px';
+  if (!hasWidth && n > 0 && !isNaN(maxWidth)) {
+    contentView.width = maxWidth;
   }
-  if (!hasHeight && n > 0 && !isNaN(maxHeight) && (!(cv.top != 'auto' && cv.bottom != 'auto'))) {
-    this.lastHeight_ = cvs.height = maxHeight.toString() + 'px';
+  if (!hasHeight && n > 0 && !isNaN(maxHeight)) {
+    contentView.height = maxHeight;
   }
 };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f7de7d90/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.js
index dec2378..3690bc1 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.js
@@ -88,7 +88,7 @@ org.apache.flex.html.beads.layouts.ButtonBarLayout.
   {
     var ir = itemRendererParent.getElementAt(i);
     ir.height = useHeight;
-    ir.positioner.internalDisplay = 'inline-block';
+    ir.internalDisplay = 'inline-block';
     ir.positioner.style['vertical-align'] = 'middle';
     ir.positioner.style['text-align'] = 'center';
     ir.positioner.style['left-margin'] = 'auto';

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f7de7d90/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js
index 54ff416..8db30eb 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js
@@ -26,7 +26,6 @@ org.apache.flex.html.beads.layouts.HorizontalLayout =
     function() {
   this.strand_ = null;
   this.className = 'HorizontalLayout';
-  this.lastHeight_ = '';
 };
 
 
@@ -65,15 +64,13 @@ org.apache.flex.html.beads.layouts.HorizontalLayout.
   var viewBead = this.strand_.getBeadByType(org.apache.flex.core.ILayoutParent);
   var contentView = viewBead.contentView;
   children = contentView.internalChildren();
-  var sps = this.strand_.positioner.style;
-  var scv = getComputedStyle(this.strand_.positioner);
-  var hasHeight = sps.height !== undefined && sps.height != this.lastHeight_;
+  var hasHeight = !this.strand_.isHeightSizedToContent();
   var maxHeight = 0;
   n = children.length;
   for (i = 0; i < n; i++)
   {
     var child = children[i];
-    child.internalDisplay = 'inline-block';
+    child.flexjs_wrapper.internalDisplay = 'inline-block';
     if (child.style.display == 'none')
       child.lastDisplay_ = 'inline-block';
     else
@@ -83,7 +80,7 @@ org.apache.flex.html.beads.layouts.HorizontalLayout.
   }
   // if there are children and maxHeight is ok, use it.
   // maxHeight can be NaN if the child hasn't been rendered yet.
-  if (!hasHeight && n > 0 && !isNaN(maxHeight) && (!(scv.top != 'auto' && scv.bottom != 'auto'))) {
-    this.lastHeight_ = sps.height = maxHeight.toString() + 'px';
+  if (!hasHeight && n > 0 && !isNaN(maxHeight)) {
+    contentView.height = maxHeight;
   }
 };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f7de7d90/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/TileLayout.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/TileLayout.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/TileLayout.js
index 0e0095c..6a8b7e6 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/TileLayout.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/TileLayout.js
@@ -123,7 +123,7 @@ org.apache.flex.html.beads.layouts.TileLayout.
   {
     child = children[i].flexjs_wrapper;
     if (!child.visible) continue;
-    child.positioner.internalDisplay = 'inline-block';
+    child.internalDisplay = 'inline-block';
     child.width = useWidth;
     child.height = useHeight;
   }
@@ -151,7 +151,7 @@ org.apache.flex.html.beads.layouts.TileLayout.
   {
     child = children[i].flexjs_wrapper;
     if (!child.visible) continue;
-    child.positioner.internalDisplay = 'inline-block';
+    child.internalDisplay = 'inline-block';
     child.width = useWidth;
     child.height = useHeight;
     child.x = xpos;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f7de7d90/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/VerticalLayout.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/VerticalLayout.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/VerticalLayout.js
index 428675e..b569245 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/VerticalLayout.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/VerticalLayout.js
@@ -27,7 +27,6 @@ org.apache.flex.html.beads.layouts.VerticalLayout =
     function() {
   this.strand_ = null;
   this.className = 'VerticalLayout';
-  this.lastWidth_ = '';
 };
 
 
@@ -68,15 +67,14 @@ org.apache.flex.html.beads.layouts.VerticalLayout.
   var viewBead = this.strand_.getBeadByType(org.apache.flex.core.ILayoutParent);
   var contentView = viewBead.contentView;
   children = contentView.internalChildren();
-  var sps = this.strand_.positioner.style;
   var scv = getComputedStyle(this.strand_.positioner);
-  var hasWidth = sps.width !== undefined && sps.width != this.lastWidth_;
+  var hasWidth = !this.strand_.isWidthSizedToContent();
   var maxWidth = 0;
   n = children.length;
   for (i = 0; i < n; i++)
   {
     var child = children[i];
-    child.internalDisplay = 'block';
+    child.flexjs_wrapper.internalDisplay = 'block';
     if (child.style.display === 'none') {
       child.lastDisplay_ = 'block';
     } else {
@@ -85,12 +83,12 @@ org.apache.flex.html.beads.layouts.VerticalLayout.
     maxWidth = Math.max(maxWidth, child.offsetLeft + child.offsetWidth);
     child.flexjs_wrapper.dispatchEvent('sizeChanged');
   }
-  if (!hasWidth && n > 0 && !isNaN(maxWidth) && (!(scv.left != 'auto' && scv.right != 'auto'))) {
+  if (!hasWidth && n > 0 && !isNaN(maxWidth)) {
     var pl = scv['padding-left'];
     var pr = scv['padding-right'];
     pl = parseInt(pl.substring(0, pl.length - 2), 10);
     pr = parseInt(pr.substring(0, pr.length - 2), 10);
     maxWidth += scv.paddingLeft + pl + pr;
-    this.lastWidth_ = sps.width = maxWidth.toString() + 'px';
+    contentView.width = maxWidth;
   }
 };


[2/9] git commit: [flex-asjs] [refs/heads/develop] - forward layoutNeeded from children

Posted by ah...@apache.org.
forward layoutNeeded from children


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

Branch: refs/heads/develop
Commit: 954753323a0eab5efb211a1d414ff0f82a8e9768
Parents: 9a3e19a
Author: Alex Harui <ah...@apache.org>
Authored: Wed Aug 26 14:38:39 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Aug 26 14:38:39 2015 -0700

----------------------------------------------------------------------
 .../flex/html/supportClasses/ContainerContentArea.js   | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95475332/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 952fcd1..4887922 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
@@ -57,5 +57,18 @@ org.apache.flex.html.supportClasses.ContainerContentArea.prototype.createElement
   this.positioner.style.position = 'relative';
   this.element.flexjs_wrapper = this;
 
+  this.addEventListener('layoutNeeded',
+      goog.bind(this.forwardEventHandler_, this));
   return this.element;
 };
+
+
+/**
+ * @private
+ * @param {Object} e The Event.;
+ */
+org.apache.flex.html.supportClasses.ContainerContentArea.prototype.forwardEventHandler_ =
+    function(e) {
+  if (this.parent)
+    this.parent.dispatchEvent(e);
+};


[8/9] git commit: [flex-asjs] [refs/heads/develop] - try to upgrade to not using lastHeight and using sizeToContent instead

Posted by ah...@apache.org.
try to upgrade to not using lastHeight and using sizeToContent instead


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

Branch: refs/heads/develop
Commit: 97f6f668b62c08e1c547a3d578d5c1781a30d984
Parents: dbce087
Author: Alex Harui <ah...@apache.org>
Authored: Wed Aug 26 23:45:30 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Aug 26 23:45:30 2015 -0700

----------------------------------------------------------------------
 .../html/beads/layouts/VerticalColumnLayout.as  | 27 ++++++++------------
 1 file changed, 10 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/97f6f668/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 69e3d86..21cff15 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,7 +20,9 @@ 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.IMeasurementBead;
+    import org.apache.flex.core.IParent;
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.UIBase;
@@ -88,22 +90,19 @@ package org.apache.flex.html.beads.layouts
 			_numColumns = value;
 		}
 		
-        private var lastWidth:Number = 0;
-        private var lastHeight:Number = 0;
-        
         /**
          * @copy org.apache.flex.core.IBeadLayout#layout
          */
 		public function layout():Boolean
 		{			
             var host:UIBase = UIBase(_strand);
+            var layoutParent:ILayoutParent = host.getBeadByType(ILayoutParent) as ILayoutParent;
+            var contentView:IParent = layoutParent.contentView;
 			var sw:Number = host.width;
 			var sh:Number = host.height;
 			
-            var hostWidth:* = ValuesManager.valuesImpl.getValue(host, "width");
-            var hasWidth:Boolean = (hostWidth !== undefined) && hostWidth != lastWidth;
-            var hostHeight:* = ValuesManager.valuesImpl.getValue(host, "height");
-            var hasHeight:Boolean = (hostHeight !== undefined) && hostHeight != lastHeight;
+            var hasWidth:Boolean = host.isWidthSizedToContent();
+            var hasHeight:Boolean = host.isHeightSizedToContent();
 			var e:IUIBase;
 			var i:int;
 			var col:int = 0;
@@ -184,19 +183,13 @@ package org.apache.flex.html.beads.layouts
 					curx = 0;
 				}
 			}
-			if (!hasWidth && n > 0 && !isNaN(maxWidth) && 
-                (!(ValuesManager.valuesImpl.getValue(host, "left") !== undefined) &&
-                  (ValuesManager.valuesImpl.getValue(host, "right") !== undefined)))
+			if (!hasWidth && n > 0 && !isNaN(maxWidth))
             {
-                lastWidth = maxWidth;
-                host.setWidth(maxWidth, true);
+                UIBase(contentView).setWidth(maxWidth, true);
             }
-            if (!hasHeight && n > 0 && !isNaN(maxHeight) && 
-                (!(ValuesManager.valuesImpl.getValue(host, "top") !== undefined) &&
-                    (ValuesManager.valuesImpl.getValue(host, "bottom") !== undefined)))
+            if (!hasHeight && n > 0 && !isNaN(maxHeight))
             {
-                lastHeight = maxHeight;
-                host.setHeight(maxHeight, true);
+                UIBase(contentView).setHeight(maxHeight, true);
             }
 			return true;
 		}


[6/9] git commit: [flex-asjs] [refs/heads/develop] - need to handle removeElement

Posted by ah...@apache.org.
need to handle removeElement


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

Branch: refs/heads/develop
Commit: 2999ee0282c6e18ddbfc12a0fe9ecfff3e821722
Parents: f7de7d9
Author: Alex Harui <ah...@apache.org>
Authored: Wed Aug 26 17:43:10 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Aug 26 17:43:10 2015 -0700

----------------------------------------------------------------------
 .../Core/js/src/org/apache/flex/core/ContainerBase.js   | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2999ee02/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js b/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js
index 6a66619..7bec248 100644
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js
@@ -209,6 +209,18 @@ org.apache.flex.core.ContainerBase.prototype.getElementAt = function(index) {
 };
 
 
+/**
+ * @param {Object} c The child element.
+ */
+org.apache.flex.core.ContainerBase.prototype.removeElement = function(c) {
+  if (this.supportsChromeChildren && org.apache.flex.utils.Language.is(c, org.apache.flex.core.IChrome)) {
+     this.actualParent.element.removeChild(c.element);
+  }
+  else {
+  }
+};
+
+
 Object.defineProperties(org.apache.flex.core.ContainerBase.prototype, {
     /** @export */
     MXMLDescriptor: {


[9/9] git commit: [flex-asjs] [refs/heads/develop] - replicate childrenAdded logic in JS

Posted by ah...@apache.org.
replicate childrenAdded logic in JS


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

Branch: refs/heads/develop
Commit: 94502fde91a06f878df8411993e3b6a88b5760b2
Parents: 97f6f66
Author: Alex Harui <ah...@apache.org>
Authored: Wed Aug 26 23:45:47 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Aug 26 23:45:47 2015 -0700

----------------------------------------------------------------------
 .../src/org/apache/flex/core/ContainerBase.js   | 14 ++++++++++--
 .../Core/js/src/org/apache/flex/core/UIBase.js  | 10 ++++----
 .../apache/flex/utils/MXMLDataInterpreter.js    |  6 +++--
 .../org/apache/flex/html/beads/ContainerView.js | 24 ++++++++++----------
 4 files changed, 34 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/94502fde/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js b/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js
index 7bec248..450bce8 100644
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/ContainerBase.js
@@ -157,7 +157,10 @@ org.apache.flex.core.ContainerBase.prototype.setActualParent = function(parent)
 /**
  * @override
  */
-org.apache.flex.core.ContainerBase.prototype.addElement = function(c) {
+org.apache.flex.core.ContainerBase.prototype.addElement = function(c, opt_dispatchEvent) {
+  if (opt_dispatchEvent === undefined)
+    opt_dispatchEvent = true;
+
   if (this.supportsChromeChildren && org.apache.flex.utils.Language.is(c, org.apache.flex.core.IChrome)) {
      //org.apache.flex.core.ContainerBase.base(this, 'addElement', c);
      this.element.appendChild(c.positioner);
@@ -168,13 +171,18 @@ org.apache.flex.core.ContainerBase.prototype.addElement = function(c) {
      this.actualParent.element.appendChild(c.positioner);
      c.addedToParent();
   }
+  if (opt_dispatchEvent)
+    this.dispatchEvent('childrenAdded');
 };
 
 
 /**
  * @override
  */
-org.apache.flex.core.ContainerBase.prototype.addElementAt = function(c, index) {
+org.apache.flex.core.ContainerBase.prototype.addElementAt = function(c, index, opt_dispatchEvent) {
+  if (opt_dispatchEvent === undefined)
+    opt_dispatchEvent = true;
+
   if (this.supportsChromeChildren && org.apache.flex.utils.Language.is(c, org.apache.flex.core.IChrome)) {
      //org.apache.flex.core.ContainerBase.base(this, 'addElementAt', c, index);
      var children1 = this.internalChildren();
@@ -197,6 +205,8 @@ org.apache.flex.core.ContainerBase.prototype.addElementAt = function(c, index) {
        c.addedToParent();
      }
    }
+  if (opt_dispatchEvent)
+    this.dispatchEvent('childrenAdded');
 };
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/94502fde/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js b/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js
index 3721dc0..602201e 100644
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js
@@ -163,8 +163,9 @@ org.apache.flex.core.UIBase.prototype.finalizeElement = null;
 
 /**
  * @param {Object} c The child element.
+ * @param {boolean=} opt_dispatchEvent Use 'false' to skip sending a childrenAdded event.
  */
-org.apache.flex.core.UIBase.prototype.addElement = function(c) {
+org.apache.flex.core.UIBase.prototype.addElement = function(c, opt_dispatchEvent) {
   this.element.appendChild(c.positioner);
   c.addedToParent();
 };
@@ -173,8 +174,9 @@ org.apache.flex.core.UIBase.prototype.addElement = function(c) {
 /**
  * @param {Object} c The child element.
  * @param {number} index The index.
+ * @param {boolean=} opt_dispatchEvent Use 'false' to skip sending a childrenAdded event.
  */
-org.apache.flex.core.UIBase.prototype.addElementAt = function(c, index) {
+org.apache.flex.core.UIBase.prototype.addElementAt = function(c, index, opt_dispatchEvent) {
   var children = this.internalChildren();
   if (index >= children.length)
     this.addElement(c);
@@ -802,7 +804,7 @@ org.apache.flex.core.UIBase.prototype.isWidthSizedToContent = function()
 {
   if (!isNaN(this.explicitWidth_) || !isNaN(this.percentWidth_))
     return false;
-  var scv = window.getComputedStyle(this.element);
+  var scv = window.getComputedStyle(this.positioner);
   if (scv.left != 'auto' && scv.right != 'auto')
     return false;
   return true;
@@ -817,7 +819,7 @@ org.apache.flex.core.UIBase.prototype.isHeightSizedToContent = function()
 {
   if (!isNaN(this.explicitHeight_) || !isNaN(this.percentHeight_))
     return false;
-  var scv = window.getComputedStyle(this.element);
+  var scv = window.getComputedStyle(this.positioner);
   if (scv.top != 'auto' && scv.bottom != 'auto')
     return false;
   return true;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/94502fde/frameworks/projects/Core/js/src/org/apache/flex/utils/MXMLDataInterpreter.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/utils/MXMLDataInterpreter.js b/frameworks/projects/Core/js/src/org/apache/flex/utils/MXMLDataInterpreter.js
index 7faacb5..8af3fdb 100644
--- a/frameworks/projects/Core/js/src/org/apache/flex/utils/MXMLDataInterpreter.js
+++ b/frameworks/projects/Core/js/src/org/apache/flex/utils/MXMLDataInterpreter.js
@@ -250,13 +250,15 @@ org.apache.flex.utils.MXMLDataInterpreter.initializeStrandBasedObject =
     comp.addEventListener(name, goog.bind(value, document));
   }
 
+  var isContainer = (typeof comp.childrenAdded === 'function');
+
   children = data[i++];
   if (children && comp['setMXMLDescriptor']) {
     comp['setMXMLDescriptor'](document, children);
   }
   if (parent && org.apache.flex.utils.Language.is(comp,
       org.apache.flex.core.IUIBase)) {
-    parent.addElement(comp);
+    parent.addElement(comp, !isContainer);
   }
 
   if (children) {
@@ -264,7 +266,7 @@ org.apache.flex.utils.MXMLDataInterpreter.initializeStrandBasedObject =
       self = org.apache.flex.utils.MXMLDataInterpreter;
       self.generateMXMLInstances(
             document, comp, children);
-      if (typeof comp.childrenAdded === 'function')
+      if (isContainer)
         comp.childrenAdded();
     }
   }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/94502fde/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
index 859a923..858da12 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
@@ -98,7 +98,7 @@ org.apache.flex.html.beads.ContainerView.
    }
    else {
      this._strand.addEventListener('sizeChanged',
-       org.apache.flex.utils.Language.closure(this.deferredSizeHandler, this, 'defer_sizeChanged'));
+       org.apache.flex.utils.Language.closure(this.deferredSizeHandler, this, 'deferredSizeHandler'));
    }
 };
 
@@ -109,7 +109,7 @@ org.apache.flex.html.beads.ContainerView.
 org.apache.flex.html.beads.ContainerView.
     prototype.deferredSizeHandler = function(event) {
     this._strand.removeEventListener('sizeChanged',
-      org.apache.flex.utils.Language.closure(this.deferredSizeHandler, this, 'defer_sizeChanged'));
+      org.apache.flex.utils.Language.closure(this.deferredSizeHandler, this, 'deferredSizeHandler'));
     this.completeSetup();
 
     var num = this.contentView.numElements;
@@ -137,9 +137,9 @@ org.apache.flex.html.beads.ContainerView.
     for (var i = 0; i < num; i++) {
       var child = this.contentView.getElementAt(i);
       child.addEventListener('widthChanged',
-          org.apache.flex.utils.Language.closure(this.childResizeHandler, this, 'child_widthChanged'));
+          org.apache.flex.utils.Language.closure(this.childResizeHandler, this, 'childResizeHandler'));
       child.addEventListener('heightChanged',
-          org.apache.flex.utils.Language.closure(this.childResizeHandler, this, 'child_heightChanged'));
+          org.apache.flex.utils.Language.closure(this.childResizeHandler, this, 'childResizeHandler'));
     }
 };
 
@@ -182,20 +182,20 @@ org.apache.flex.html.beads.ContainerView.
   this.createViewport();
 
   this._strand.addEventListener('childrenAdded',
-      org.apache.flex.utils.Language.closure(this.childrenChangedHandler, this, 'childrenAdded'));
+      org.apache.flex.utils.Language.closure(this.childrenChangedHandler, this, 'childrenChangedHandler'));
   this.childrenChangedHandler(null);
   this._strand.addEventListener('childrenAdded',
-      org.apache.flex.utils.Language.closure(this.changeHandler, this, 'childrenAdded'));
+      org.apache.flex.utils.Language.closure(this.changeHandler, this, 'changeHandler'));
   this._strand.addEventListener('childrenRemoved',
-      org.apache.flex.utils.Language.closure(this.changeHandler, this, 'childrenRemoved'));
+      org.apache.flex.utils.Language.closure(this.changeHandler, this, 'changeHandler'));
   this._strand.addEventListener('layoutNeeded',
-     org.apache.flex.utils.Language.closure(this.performLayout, this, 'layoutNeeded'));
+     org.apache.flex.utils.Language.closure(this.performLayout, this, 'performLayout'));
   this._strand.addEventListener('widthChanged',
-     org.apache.flex.utils.Language.closure(this.resizeHandler, this, 'widthChanged'));
+     org.apache.flex.utils.Language.closure(this.resizeHandler, this, 'resizeHandler'));
   this._strand.addEventListener('heightChanged',
-     org.apache.flex.utils.Language.closure(this.resizeHandler, this, 'heightChanged'));
+     org.apache.flex.utils.Language.closure(this.resizeHandler, this, 'resizeHandler'));
   this._strand.addEventListener('sizeChanged',
-     org.apache.flex.utils.Language.closure(this.resizeHandler, this, 'sizeChanged'));
+     org.apache.flex.utils.Language.closure(this.resizeHandler, this, 'resizeHandler'));
 };
 
 
@@ -368,7 +368,7 @@ Object.defineProperties(org.apache.flex.html.beads.ContainerView.prototype, {
             this.host.addElement(this.contentView);
             this.host.setActualParent(this.contentView);
             this._strand.addEventListener('initComplete',
-                  org.apache.flex.utils.Language.closure(this.initCompleteHandler, this, 'initComplete'));
+                  org.apache.flex.utils.Language.closure(this.initCompleteHandler, this, 'initCompleteHandler'));
          }
     },
     /** @export */


[4/9] git commit: [flex-asjs] [refs/heads/develop] - use contentView size after layout

Posted by ah...@apache.org.
use contentView size after layout


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

Branch: refs/heads/develop
Commit: cd7b69e399dbbdcfe19d63ff1308dfd8b1356c88
Parents: eef9615
Author: Alex Harui <ah...@apache.org>
Authored: Wed Aug 26 17:33:21 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Aug 26 17:33:21 2015 -0700

----------------------------------------------------------------------
 .../HTML/js/src/org/apache/flex/html/beads/ContainerView.js       | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cd7b69e3/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
index 3c2f63a..ce10234 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js
@@ -259,6 +259,9 @@ org.apache.flex.html.beads.ContainerView.
   var host = this._strand;
   var metrics = org.apache.flex.utils.BeadMetrics.getMetrics(host);
 
+  this.viewportModel_.contentWidth = Math.max(this.viewportModel_.contentWidth, this.contentView.width);
+  this.viewportModel_.contentHeight = Math.max(this.viewportModel_.contentHeight, this.contentView.height);
+
   if (host.isWidthSizedToContent() && host.isHeightSizedToContent()) {
     host.setWidthAndHeight(this.viewportModel_.contentWidth + metrics.left + metrics.right,
                            this.viewportModel_.contentHeight + metrics.top + metrics.bottom, false);