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

Side by Side Diff: Source/core/css/CSSGrammar.y

Issue 187353003: Implement /content/ combinator. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 %{ 1 %{
2 2
3 /* 3 /*
4 * Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org) 4 * Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 App le Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 App le Inc. All rights reserved.
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2012 Intel Corporation. All rights reserved. 8 * Copyright (C) 2012 Intel Corporation. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 | '>' maybe_space { $$ = CSSSelector::Child; } 1048 | '>' maybe_space { $$ = CSSSelector::Child; }
1049 // FIXME: implement named combinator and replace the following /shadow/, /sh adow-all/ and 1049 // FIXME: implement named combinator and replace the following /shadow/, /sh adow-all/ and
1050 // /shadow-deep/ with named combinator's implementation. 1050 // /shadow-deep/ with named combinator's implementation.
1051 | '/' IDENT '/' maybe_space { 1051 | '/' IDENT '/' maybe_space {
1052 if (!RuntimeEnabledFeatures::shadowDOMEnabled()) 1052 if (!RuntimeEnabledFeatures::shadowDOMEnabled())
1053 YYERROR; 1053 YYERROR;
1054 if ($2.equalIgnoringCase("shadow-all")) 1054 if ($2.equalIgnoringCase("shadow-all"))
1055 $$ = CSSSelector::ShadowAll; 1055 $$ = CSSSelector::ShadowAll;
1056 else if ($2.equalIgnoringCase("shadow-deep")) 1056 else if ($2.equalIgnoringCase("shadow-deep"))
1057 $$ = CSSSelector::ShadowDeep; 1057 $$ = CSSSelector::ShadowDeep;
1058 else if ($2.equalIgnoringCase("content"))
1059 $$ = CSSSelector::ShadowContent;
1058 else 1060 else
1059 YYERROR; 1061 YYERROR;
1060 } 1062 }
1061 ; 1063 ;
1062 1064
1063 maybe_unary_operator: 1065 maybe_unary_operator:
1064 unary_operator 1066 unary_operator
1065 | /* empty */ { $$ = 1; } 1067 | /* empty */ { $$ = 1; }
1066 ; 1068 ;
1067 1069
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 selector: 1134 selector:
1133 simple_selector 1135 simple_selector
1134 | selector WHITESPACE 1136 | selector WHITESPACE
1135 | selector WHITESPACE simple_selector 1137 | selector WHITESPACE simple_selector
1136 { 1138 {
1137 $$ = $3; 1139 $$ = $3;
1138 CSSParserSelector* end = $$; 1140 CSSParserSelector* end = $$;
1139 while (end->tagHistory()) 1141 while (end->tagHistory())
1140 end = end->tagHistory(); 1142 end = end->tagHistory();
1141 end->setRelation(CSSSelector::Descendant); 1143 end->setRelation(CSSSelector::Descendant);
1142 if ($1->isContentPseudoElement())
1143 end->setRelationIsAffectedByPseudoContent();
1144 end->setTagHistory(parser->sinkFloatingSelector($1)); 1144 end->setTagHistory(parser->sinkFloatingSelector($1));
1145 } 1145 }
1146 | selector combinator simple_selector { 1146 | selector combinator simple_selector {
1147 $$ = $3; 1147 $$ = $3;
1148 CSSParserSelector* end = $$; 1148 CSSParserSelector* end = $$;
1149 while (end->tagHistory()) 1149 while (end->tagHistory())
1150 end = end->tagHistory(); 1150 end = end->tagHistory();
1151 end->setRelation($2); 1151 end->setRelation($2);
1152 if ($1->isContentPseudoElement())
1153 end->setRelationIsAffectedByPseudoContent();
1154 end->setTagHistory(parser->sinkFloatingSelector($1)); 1152 end->setTagHistory(parser->sinkFloatingSelector($1));
1155 } 1153 }
1156 ; 1154 ;
1157 1155
1158 namespace_selector: 1156 namespace_selector:
1159 /* empty */ '|' { $$.clear(); } 1157 /* empty */ '|' { $$.clear(); }
1160 | '*' '|' { static const LChar star = '*'; $$.init(&star, 1); } 1158 | '*' '|' { static const LChar star = '*'; $$.init(&star, 1); }
1161 | IDENT '|' 1159 | IDENT '|'
1162 ; 1160 ;
1163 1161
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1899 1897
1900 rule_error_recovery: 1898 rule_error_recovery:
1901 /* empty */ 1899 /* empty */
1902 | rule_error_recovery error 1900 | rule_error_recovery error
1903 | rule_error_recovery invalid_square_brackets_block 1901 | rule_error_recovery invalid_square_brackets_block
1904 | rule_error_recovery invalid_parentheses_block 1902 | rule_error_recovery invalid_parentheses_block
1905 ; 1903 ;
1906 1904
1907 %% 1905 %%
1908 1906
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698