Title: [150804] trunk/Source/WebCore
- Revision
- 150804
- Author
- ser...@webkit.org
- Date
- 2013-05-28 07:37:34 -0700 (Tue, 28 May 2013)
Log Message
Refactoring CSS grammar
https://bugs.webkit.org/show_bug.cgi?id=116679
Reviewed by Andreas Kling.
>From Blink r149948 by <se...@chromium.org>
Added "closing_parenthesis:" and "error_recovery:" to avoid code
duplication in a couple of error recovery rules. Some other rules
were also refactored which allows to reduce the the number of
shift/reduce conflicts by 2.
No new tests required as this is just a refactoring, no new
functionality added.
* css/CSSGrammar.y.in:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (150803 => 150804)
--- trunk/Source/WebCore/ChangeLog 2013-05-28 14:31:11 UTC (rev 150803)
+++ trunk/Source/WebCore/ChangeLog 2013-05-28 14:37:34 UTC (rev 150804)
@@ -1,5 +1,24 @@
2013-05-28 Sergio Villar Senin <svil...@igalia.com>
+ Refactoring CSS grammar
+ https://bugs.webkit.org/show_bug.cgi?id=116679
+
+ Reviewed by Andreas Kling.
+
+ From Blink r149948 by <se...@chromium.org>
+
+ Added "closing_parenthesis:" and "error_recovery:" to avoid code
+ duplication in a couple of error recovery rules. Some other rules
+ were also refactored which allows to reduce the the number of
+ shift/reduce conflicts by 2.
+
+ No new tests required as this is just a refactoring, no new
+ functionality added.
+
+ * css/CSSGrammar.y.in:
+
+2013-05-28 Sergio Villar Senin <svil...@igalia.com>
+
Invalid block doesn't make declaration invalid
https://bugs.webkit.org/show_bug.cgi?id=115709
Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (150803 => 150804)
--- trunk/Source/WebCore/css/CSSGrammar.y.in 2013-05-28 14:31:11 UTC (rev 150803)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in 2013-05-28 14:37:34 UTC (rev 150804)
@@ -88,9 +88,9 @@
%}
#if ENABLE_SHADOW_DOM
-%expect 65
+%expect 63
#else
-%expect 64
+%expect 62
#endif
%nonassoc LOWEST_PREC
@@ -428,6 +428,11 @@
| %prec LOWEST_PREC TOKEN_EOF
;
+closing_parenthesis:
+ ')'
+ | %prec LOWEST_PREC TOKEN_EOF
+ ;
+
charset:
CHARSET_SYM maybe_space STRING maybe_space ';' {
if (parser->m_styleSheet)
@@ -1561,11 +1566,9 @@
;
decl_list_recovery:
- error error_location {
+ error error_location error_recovery {
parser->syntaxError($2, CSSParser::PropertyDeclarationError);
}
- | decl_list_recovery invalid_block
- | decl_list_recovery error
;
declaration:
@@ -1618,11 +1621,9 @@
;
declaration_recovery:
- error error_location {
+ error error_location error_recovery {
parser->syntaxError($2);
}
- | declaration_recovery invalid_block
- | declaration_recovery error
;
property:
@@ -1654,17 +1655,15 @@
$$->addValue(parser->sinkFloatingValue($3));
}
}
- | expr invalid_block_list {
+ | expr expr_recovery {
$$ = 0;
}
- | expr invalid_block_list error {
- $$ = 0;
- }
- | expr error {
- $$ = 0;
- }
;
+expr_recovery:
+ error error_location error_recovery
+ ;
+
operator:
'/' maybe_space {
$$ = '/';
@@ -1754,7 +1753,7 @@
;
function:
- FUNCTION maybe_space expr ')' maybe_space {
+ FUNCTION maybe_space expr closing_parenthesis maybe_space {
CSSParserFunction* f = parser->createFloatingFunction();
f->name = $1;
f->args = parser->sinkFloatingValueList($3);
@@ -1762,17 +1761,9 @@
$$.unit = CSSParserValue::Function;
$$.function = f;
} |
- FUNCTION maybe_space expr TOKEN_EOF {
+ FUNCTION maybe_space closing_parenthesis maybe_space {
CSSParserFunction* f = parser->createFloatingFunction();
f->name = $1;
- f->args = parser->sinkFloatingValueList($3);
- $$.id = 0;
- $$.unit = CSSParserValue::Function;
- $$.function = f;
- } |
- FUNCTION maybe_space ')' maybe_space {
- CSSParserFunction* f = parser->createFloatingFunction();
- f->name = $1;
CSSParserValueList* valueList = parser->createFloatingValueList();
f->args = parser->sinkFloatingValueList(valueList);
$$.id = 0;
@@ -1788,7 +1779,7 @@
$$.function = f;
}
;
-
+
calc_func_term:
unary_term { $$ = $1; }
| VARFUNCTION maybe_space IDENT ')' maybe_space {
@@ -1980,5 +1971,11 @@
}
;
+error_recovery:
+ /* empty */
+ | error_recovery invalid_block
+ | error_recovery error
+ ;
+
%%
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes