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/02/14 07:44:13 UTC
[3/5] git commit: [flex-falcon] [refs/heads/develop] - handle more
complex media query
handle more complex media query
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/23dc28ea
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/23dc28ea
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/23dc28ea
Branch: refs/heads/develop
Commit: 23dc28ea50955cfbf3e6322b19c3001ad56b561b
Parents: e904914
Author: Alex Harui <ah...@apache.org>
Authored: Fri Feb 13 12:59:14 2015 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Feb 13 12:59:14 2015 -0800
----------------------------------------------------------------------
compiler/src/org/apache/flex/compiler/internal/css/CSS.g | 5 +++--
compiler/src/org/apache/flex/compiler/internal/css/CSSTree.g | 4 ++++
.../apache/flex/compiler/internal/css/codegen/CSSReducer.java | 4 ++++
3 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/23dc28ea/compiler/src/org/apache/flex/compiler/internal/css/CSS.g
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/css/CSS.g b/compiler/src/org/apache/flex/compiler/internal/css/CSS.g
index 45e61ee..a41a463 100644
--- a/compiler/src/org/apache/flex/compiler/internal/css/CSS.g
+++ b/compiler/src/org/apache/flex/compiler/internal/css/CSS.g
@@ -195,10 +195,10 @@ mediaQuery
medium
: mediumCondition
(
- // Flex only support "and" at the momement. (Shaoting)
+ // Flex only support "and" at the moment.
'and'
mediumCondition
- | ',' mediumCondition
+ | mediumCondition
)*
-> ^(I_MEDIUM_CONDITIONS mediumCondition*)
;
@@ -211,6 +211,7 @@ mediumCondition
: ID
| ONLY ID
| ARGUMENTS
+ | COMMA
;
/**
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/23dc28ea/compiler/src/org/apache/flex/compiler/internal/css/CSSTree.g
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/css/CSSTree.g b/compiler/src/org/apache/flex/compiler/internal/css/CSSTree.g
index 68e6ece..aded4f7 100644
--- a/compiler/src/org/apache/flex/compiler/internal/css/CSSTree.g
+++ b/compiler/src/org/apache/flex/compiler/internal/css/CSSTree.g
@@ -174,6 +174,10 @@ mediumCondition
{
$mediaQuery::conditions.add(new CSSMediaQueryCondition($start, tokenStream));
}
+ | COMMA
+ {
+ $mediaQuery::conditions.add(new CSSMediaQueryCondition($start, tokenStream));
+ }
;
fontFace
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/23dc28ea/compiler/src/org/apache/flex/compiler/internal/css/codegen/CSSReducer.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/css/codegen/CSSReducer.java b/compiler/src/org/apache/flex/compiler/internal/css/codegen/CSSReducer.java
index bc4ac1c..58caeed 100644
--- a/compiler/src/org/apache/flex/compiler/internal/css/codegen/CSSReducer.java
+++ b/compiler/src/org/apache/flex/compiler/internal/css/codegen/CSSReducer.java
@@ -736,6 +736,10 @@ public class CSSReducer implements ICSSCodeGenResult
mediaQueryString = site.toString();
else if (mediaQueryString.endsWith("only"))
mediaQueryString += " " + site.toString();
+ else if (site.toString().equals(","))
+ mediaQueryString += ",";
+ else if (mediaQueryString.endsWith(","))
+ mediaQueryString += " " + site.toString();
else
mediaQueryString += " and " + site.toString();
return null;