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

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: Removed unrelated whitespace fixes. Created 7 years, 2 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 da016a2f6ee9af87d96a26d1fa685259f29dea91..bc988cb47d5cc526758a7db02653fb1911416065 100644
--- a/Source/core/css/CSSGrammar.y.in
+++ b/Source/core/css/CSSGrammar.y.in
@@ -397,9 +397,14 @@ internal_supports_condition:
}
;
+space:
+ WHITESPACE
+ | space WHITESPACE
+ ;
+
maybe_space:
/* empty */ %prec UNIMPORTANT_TOK
- | maybe_space WHITESPACE
+ | space
;
maybe_sgml:
@@ -598,7 +603,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 (!$$)
@@ -614,18 +619,18 @@ media_query_exp_list:
$$ = parser->createFloatingMediaQueryExpList();
$$->append(parser->sinkFloatingMediaQueryExp($1));
}
- | media_query_exp_list MEDIA_AND maybe_space media_query_exp {
+ | media_query_exp_list space MEDIA_AND space media_query_exp {
$$ = $1;
- $$->append(parser->sinkFloatingMediaQueryExp($4));
+ $$->append(parser->sinkFloatingMediaQueryExp($5));
}
;
maybe_and_media_query_exp_list:
- /*empty*/ {
+ maybe_space {
$$ = parser->createFloatingMediaQueryExpList();
}
- | MEDIA_AND maybe_space media_query_exp_list {
- $$ = $3;
+ | space MEDIA_AND space media_query_exp_list maybe_space {
+ $$ = $4;
}
;
@@ -633,16 +638,16 @@ maybe_media_restrictor:
/*empty*/ {
$$ = MediaQuery::None;
}
- | MEDIA_ONLY maybe_space {
+ | MEDIA_ONLY space {
$$ = MediaQuery::Only;
}
- | MEDIA_NOT maybe_space {
+ | MEDIA_NOT space {
$$ = MediaQuery::Not;
}
;
valid_media_query:
- media_query_exp_list {
+ media_query_exp_list maybe_space {
$$ = parser->createFloatingMediaQuery(parser->sinkFloatingMediaQueryExpList($1));
}
| maybe_media_restrictor medium maybe_and_media_query_exp_list {
@@ -732,7 +737,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