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/01/09 17:10:28 UTC

[15/22] git commit: [flex-asjs] [refs/heads/develop] - parse off units and do conversions

parse off units and do conversions


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

Branch: refs/heads/develop
Commit: aa8c5901267c96816332a26ffb1d14fe76b3c434
Parents: 2436e99
Author: Alex Harui <ah...@apache.org>
Authored: Fri Jan 9 07:45:46 2015 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Jan 9 08:09:49 2015 -0800

----------------------------------------------------------------------
 .../org/apache/flex/core/SimpleCSSValuesImpl.as    | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aa8c5901/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as
index 263d3a2..04855f1 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -504,7 +504,22 @@ package org.apache.flex.core
                 {
                     var n:Number = Number(value);
                     if (isNaN(n))
-                        obj[pieces[0]] = value;
+                    {
+                        if (value.charAt(0) == "#")
+                        {
+                            value = value.replace("#", "0x");
+                            n = parseInt(value);
+                            obj[pieces[0]] = n;
+                        }
+                        else
+                        {
+                            if (value.charAt(0) == "'")
+                                value = value.substr(1, value.length - 2);
+                            else if (value.charAt(0) == '"')
+                                value = value.substr(1, value.length - 2);
+                            obj[pieces[0]] = value;
+                        }
+                    }
                     else
                         obj[pieces[0]] = n;
                 }