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

Unified Diff: sky/engine/core/css/parser/CSSGrammar.y

Issue 836383004: Remove all attribute selectors that are not Set or Exact. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
Index: sky/engine/core/css/parser/CSSGrammar.y
diff --git a/sky/engine/core/css/parser/CSSGrammar.y b/sky/engine/core/css/parser/CSSGrammar.y
index 61bfc46bf803f7b36caea8bda1454861ef4c2e28..3d639a64919d58c991a8a78ff4acd72e9f69bd07 100644
--- a/sky/engine/core/css/parser/CSSGrammar.y
+++ b/sky/engine/core/css/parser/CSSGrammar.y
@@ -147,12 +147,6 @@ inline static CSSParserValue makeIdentValue(CSSParserString string)
%token WHITESPACE SGML_CD
%token TOKEN_EOF 0
-%token INCLUDES
-%token DASHMATCH
-%token BEGINSWITH
-%token ENDSWITH
-%token CONTAINS
-
%token <string> STRING
%right <string> IDENT
%token <string> NTH
@@ -271,7 +265,6 @@ inline static CSSParserValue makeIdentValue(CSSParserString string)
%type <boolean> prio
-%type <integer> match
%type <integer> unary_operator
%type <integer> maybe_unary_operator
%type <character> operator
@@ -828,10 +821,10 @@ attrib:
$$->setAttribute(QualifiedName($3), CSSSelector::CaseSensitive);
$$->setMatch(CSSSelector::Set);
}
- | '[' maybe_space attr_name match maybe_space ident_or_string maybe_space maybe_attr_match_type closing_square_bracket {
+ | '[' maybe_space attr_name '=' maybe_space ident_or_string maybe_space maybe_attr_match_type closing_square_bracket {
$$ = parser->createFloatingSelector();
$$->setAttribute(QualifiedName($3), $8);
- $$->setMatch((CSSSelector::Match)$4);
+ $$->setMatch(CSSSelector::Exact);
$$->setValue($6);
}
| '[' selector_recovery closing_square_bracket {
@@ -839,27 +832,6 @@ attrib:
}
;
-match:
- '=' {
- $$ = CSSSelector::Exact;
- }
- | INCLUDES {
- $$ = CSSSelector::List;
- }
- | DASHMATCH {
- $$ = CSSSelector::Hyphen;
- }
- | BEGINSWITH {
- $$ = CSSSelector::Begin;
- }
- | ENDSWITH {
- $$ = CSSSelector::End;
- }
- | CONTAINS {
- $$ = CSSSelector::Contain;
- }
- ;
-
ident_or_string:
IDENT
| STRING

Powered by Google App Engine
This is Rietveld 408576698