You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pe...@apache.org on 2016/06/24 15:02:28 UTC

git commit: [flex-asjs] [refs/heads/develop] - Recognize "transparent" as a valid background-color in CSS for SWF side.

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 32f305337 -> 897de956d


Recognize "transparent" as a valid background-color in CSS for SWF side.


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

Branch: refs/heads/develop
Commit: 897de956d70fc274df95efc9fdeb5ec1afca281f
Parents: 32f3053
Author: Peter Ent <pe...@apache.org>
Authored: Fri Jun 24 11:02:23 2016 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Fri Jun 24 11:02:23 2016 -0400

----------------------------------------------------------------------
 .../Core/src/main/flex/org/apache/flex/utils/CSSUtils.as       | 6 +++++-
 .../main/flex/org/apache/flex/html/beads/CSSTextButtonView.as  | 5 ++++-
 .../flex/org/apache/flex/html/beads/SolidBackgroundBead.as     | 6 +++++-
 3 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/897de956/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/CSSUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/CSSUtils.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/CSSUtils.as
index 770c428..35e6314 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/CSSUtils.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/CSSUtils.as
@@ -86,7 +86,7 @@ package org.apache.flex.utils
          *
          *  @param value The value. 
          *
-         *  @return uint of the color. 
+         *  @return uint of the color. If value is "transparent" then uint.MAX_VALUE is returned.
          *  
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
@@ -103,6 +103,10 @@ package org.apache.flex.utils
             var c2:int;
             
             var stringValue:String = value as String;
+			if (stringValue == "transparent")
+			{
+				return uint.MAX_VALUE;
+			}
             if (stringValue.charAt(0) == '#')
             {
                 if (stringValue.length == 4)

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/897de956/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSTextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSTextButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSTextButtonView.as
index cc285b7..3150e7a 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSTextButtonView.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSTextButtonView.as
@@ -212,7 +212,10 @@ package org.apache.flex.html.beads
             if (backgroundColor != null)
             {
                 bgColor = CSSUtils.toColorWithAlpha(backgroundColor);
-                if (bgColor & 0xFF000000)
+				if (bgColor == uint.MAX_VALUE) {
+					bgAlpha = 0
+				}
+				else if (bgColor & 0xFF000000)
                 {
                     bgAlpha = bgColor >>> 24 / 255;
                     bgColor = bgColor & 0xFFFFFF;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/897de956/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SolidBackgroundBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SolidBackgroundBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SolidBackgroundBead.as
index a42a23d..a162669 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SolidBackgroundBead.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SolidBackgroundBead.as
@@ -79,7 +79,11 @@ package org.apache.flex.html.beads
 			IEventDispatcher(host).addEventListener("initComplete", changeHandler);
 			
 			var bgColor:Object = ValuesManager.valuesImpl.getValue(host, "background-color");
-			if( bgColor != null ) {
+			if ((bgColor is String) && (bgColor == "transparent")) {
+				bgColor = null;
+				opacity = 0;
+			}
+			else if( bgColor != null ) {
 				backgroundColor = ValuesManager.valuesImpl.convertColor(bgColor);
 			}