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/09/13 23:50:38 UTC

git commit: [flex-asjs] [refs/heads/develop] - can't use getComputedStyle here because FF returns 0 instead of null or auto

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 994180230 -> 029ee8c1e


can't use getComputedStyle here because FF returns 0 instead of null or auto


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

Branch: refs/heads/develop
Commit: 029ee8c1e17bbc9ebb42b0d5a0502085b4d98151
Parents: 9941802
Author: Alex Harui <ah...@apache.org>
Authored: Sun Sep 13 14:51:11 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Sun Sep 13 14:51:11 2015 -0700

----------------------------------------------------------------------
 .../Core/js/src/org/apache/flex/core/UIBase.js       | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/029ee8c1/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 7cec9fd..ef667c9 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
@@ -804,12 +804,10 @@ org.apache.flex.core.UIBase.prototype.isWidthSizedToContent = function()
 {
   if (!isNaN(this.explicitWidth_) || !isNaN(this.percentWidth_))
     return false;
-
-  var scv = window.getComputedStyle(/** @type {Element} */ (this.positioner));
+  var left = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this, 'left');
+  var right = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this, 'right');
   // not sized to content if both left and right are specified
-  if (scv.left !== '' && scv.left != 'auto' && scv.right !== '' && scv.right != 'auto')
-    return false;
-  return true;
+  return (left === undefined || right === undefined);
 };
 
 
@@ -821,11 +819,10 @@ org.apache.flex.core.UIBase.prototype.isHeightSizedToContent = function()
 {
   if (!isNaN(this.explicitHeight_) || !isNaN(this.percentHeight_))
     return false;
-  var scv = window.getComputedStyle(/** @type {Element} */ (this.positioner));
+  var top = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this, 'top');
+  var bottom = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this, 'bottom');
   // not sized to content if both top and bottom are specified
-  if (scv.top !== '' && scv.top != 'auto' && scv.bottom !== '' && scv.bottom != 'auto')
-    return false;
-  return true;
+  return (top === undefined || bottom === undefined);
 };