Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Unified Diff: Source/core/css/CSSGrammar.y.in

Issue 23542021: Explicit space required around NOT/ONLY/AND in CSS MQ. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/media/media-query-only-not-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSGrammar.y.in
diff --git a/Source/core/css/CSSGrammar.y.in b/Source/core/css/CSSGrammar.y.in
index d437fb6d2cb4ff2522e62b038183b6f312daad29..69be3b430d4978aba8977fa525fdaed723eb5ba1 100644
--- a/Source/core/css/CSSGrammar.y.in
+++ b/Source/core/css/CSSGrammar.y.in
@@ -268,6 +268,8 @@ inline static CSSParserValue makeOperatorValue(int value)
%type <valueList> maybe_media_value
%type <mediaQueryExp> media_query_exp
%type <mediaQueryExpList> media_query_exp_list
+%type <mediaQueryExpList> media_query_exp_list_space
+%type <mediaQueryExpList> media_query_exp_list_no_space
%type <mediaQueryExpList> maybe_and_media_query_exp_list
%type <boolean> supports_condition
@@ -397,6 +399,11 @@ internal_supports_condition:
}
;
+spaces:
SeRya 2013/09/23 09:12:43 It should be 'space' for consistency with 'maybe_s
rune 2013/10/01 12:04:48 Done.
+ WHITESPACE
+ | spaces WHITESPACE
+ ;
+
maybe_space:
/* empty */ %prec UNIMPORTANT_TOK
| maybe_space WHITESPACE
@@ -598,7 +605,7 @@ maybe_media_value:
;
media_query_exp:
- '(' maybe_space IDENT maybe_space maybe_media_value closing_parenthesis maybe_space {
+ '(' maybe_space IDENT maybe_space maybe_media_value closing_parenthesis {
parser->tokenToLowerCase($3);
$$ = parser->createFloatingMediaQueryExp($3, $5);
if (!$$)
@@ -609,23 +616,35 @@ media_query_exp:
}
;
-media_query_exp_list:
+media_query_exp_list_no_space:
media_query_exp {
$$ = parser->createFloatingMediaQueryExpList();
$$->append(parser->sinkFloatingMediaQueryExp($1));
}
- | media_query_exp_list MEDIA_AND maybe_space media_query_exp {
+ | media_query_exp_list_space MEDIA_AND spaces media_query_exp {
$$ = $1;
$$->append(parser->sinkFloatingMediaQueryExp($4));
}
;
+media_query_exp_list_space:
SeRya 2013/09/23 09:12:43 Can "media_query_exp_list_space" be replaced by "m
rune 2013/10/01 12:04:48 Done. I've removed the _no_space part since there'
+ media_query_exp_list_no_space spaces
+ ;
+
+media_query_exp_list:
+ media_query_exp_list_no_space
+ | media_query_exp_list_space
+ ;
+
maybe_and_media_query_exp_list:
/*empty*/ {
$$ = parser->createFloatingMediaQueryExpList();
}
- | MEDIA_AND maybe_space media_query_exp_list {
- $$ = $3;
+ | spaces {
SeRya 2013/09/23 09:12:43 maybe_space { .... } To avoid conflicts redef
rune 2013/10/01 12:04:48 Done.
+ $$ = parser->createFloatingMediaQueryExpList();
+ }
+ | spaces MEDIA_AND spaces media_query_exp_list {
+ $$ = $4;
}
;
@@ -633,10 +652,10 @@ maybe_media_restrictor:
/*empty*/ {
$$ = MediaQuery::None;
}
- | MEDIA_ONLY maybe_space {
+ | MEDIA_ONLY spaces {
$$ = MediaQuery::Only;
}
- | MEDIA_NOT maybe_space {
+ | MEDIA_NOT spaces {
$$ = MediaQuery::Not;
}
;
@@ -732,7 +751,7 @@ media:
;
medium:
- IDENT maybe_space
+ IDENT
;
supports:
« no previous file with comments | « LayoutTests/fast/media/media-query-only-not-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698