You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/03/27 17:46:24 UTC

[royale-compiler] branch develop updated: fix #34

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git


The following commit(s) were added to refs/heads/develop by this push:
     new 546b5a5  fix #34
546b5a5 is described below

commit 546b5a588bb7288cb867d5fca1881820a113cbf1
Author: Alex Harui <ah...@apache.org>
AuthorDate: Tue Mar 27 10:46:07 2018 -0700

    fix #34
---
 compiler-jx/src/test/resources/royale/files/CSSTestSource.css          | 2 ++
 .../src/test/resources/royale/files/CSSTestSource_encoded_result.txt   | 3 ++-
 compiler-jx/src/test/resources/royale/files/CSSTestSource_result.css   | 2 ++
 .../main/java/org/apache/royale/compiler/internal/css/CSSProperty.java | 2 +-
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/compiler-jx/src/test/resources/royale/files/CSSTestSource.css b/compiler-jx/src/test/resources/royale/files/CSSTestSource.css
index 9da086f..b998e3e 100755
--- a/compiler-jx/src/test/resources/royale/files/CSSTestSource.css
+++ b/compiler-jx/src/test/resources/royale/files/CSSTestSource.css
@@ -140,10 +140,12 @@
 
 .jewel.slider input[type="range"] {
   padding: 0;
+  content: url(assets/checkbox-tick.svg);
 }
 
 input[type="range"] {
   padding: 0;
+  content: '\2714';
 }
 
 .complex {
diff --git a/compiler-jx/src/test/resources/royale/files/CSSTestSource_encoded_result.txt b/compiler-jx/src/test/resources/royale/files/CSSTestSource_encoded_result.txt
index 8ebbe37..e107431 100755
--- a/compiler-jx/src/test/resources/royale/files/CSSTestSource_encoded_result.txt
+++ b/compiler-jx/src/test/resources/royale/files/CSSTestSource_encoded_result.txt
@@ -34,5 +34,6 @@ this["padding"] = 0.0;
 this["border"] = 0.0;
 this["WebkitTransform"] = null;
 this["top"] = 50.0},
-0,
1,
"input",
function() {this["padding"] = 0.0},
0,
1,
"input[type=\"checkbox\"]",
function() {this["padding"] = 0.0},
0,
1,
".slider::-webkit-slider-thumb",
function() {this["padding"] = 0.0},
0,
1,
"input[type=\"range\"]",
function() {this["padding"] = 0.0},
0,
1,
"input[type=\"range\"]",
function() {this["padding"] = 0.0}];
+0,
1,
"input",
function() {this["padding"] = 0.0},
0,
1,
"input[type=\"checkbox\"]",
function() {this["padding"] = 0.0},
0,
1,
".slider::-webkit-slider-thumb",
function() {this["padding"] = 0.0},
0,
1,
"input[type=\"range\"]",
function() {this["content"] = "assets/checkbox-tick.svg";
+this["padding"] = 0.0},
0,
1,
"input[type=\"range\"]",
function() {this["content"] = "✔";
this["padding"] = 0.0},
0,
1,
".complex",
function() {this["background"] = ["url(\"data:image/svg+xml;utf8,<svg viewBox='0 0 16 13' version='1.1' xmlns='http://www.w3.org/2000/svg'><g transform='translate(-763, -290)'><g transform='translate(760, 285)'><g><polygon fill='#ffffff' points='3 13 9 18 19 7 16 5 9 13 6 10'></polygon></g></g></g></svg>\")", 11788282]}];
 
diff --git a/compiler-jx/src/test/resources/royale/files/CSSTestSource_result.css b/compiler-jx/src/test/resources/royale/files/CSSTestSource_result.css
index 1c08cfd..ba88e0a 100755
--- a/compiler-jx/src/test/resources/royale/files/CSSTestSource_result.css
+++ b/compiler-jx/src/test/resources/royale/files/CSSTestSource_result.css
@@ -152,11 +152,13 @@
 
 
 .jewel.slider input[type="range"] {
+        content: url(assets/checkbox-tick.svg);
         padding: 0;
 }
 
 
 input[type="range"] {
+        content: "\2714";
         padding: 0;
 }
 
diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSProperty.java b/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSProperty.java
index affdf51..9b3ddf1 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSProperty.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSProperty.java
@@ -72,7 +72,7 @@ public class CSSProperty extends CSSNodeBase implements ICSSProperty
         {
             cssName = cssName.replaceAll("[A-Z]", "-$0").toLowerCase();
         }
-        if (cssName.equals("content"))
+        if (cssName.equals("content") && value instanceof CSSStringPropertyValue)
         {
             return String.format("%s: \"%s\";", cssName, escape(((CSSStringPropertyValue)value).getValue()));            
         }

-- 
To stop receiving notification emails like this one, please contact
aharui@apache.org.