Title: [150682] trunk/Source/WebCore
Revision
150682
Author
ser...@webkit.org
Date
2013-05-25 01:29:42 -0700 (Sat, 25 May 2013)

Log Message

Reducing CSS code duplication in declaration list error recovery
https://bugs.webkit.org/show_bug.cgi?id=115157

Reviewed by Andreas Kling.

>From Blink r148974 by <se...@chromium.org>

Refactor "invalid_block_list error | /* empty */" in a new
decl_list_recovery rule that allows to remove 4 redundant rules.

No new test required as we're just refactoring code, no new behaviour.

* css/CSSGrammar.y.in:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (150681 => 150682)


--- trunk/Source/WebCore/ChangeLog	2013-05-25 04:20:37 UTC (rev 150681)
+++ trunk/Source/WebCore/ChangeLog	2013-05-25 08:29:42 UTC (rev 150682)
@@ -1,3 +1,19 @@
+2013-05-25  Sergio Villar Senin  <svil...@igalia.com>
+
+        Reducing CSS code duplication in declaration list error recovery
+        https://bugs.webkit.org/show_bug.cgi?id=115157
+
+        Reviewed by Andreas Kling.
+
+        From Blink r148974 by <se...@chromium.org>
+
+        Refactor "invalid_block_list error | /* empty */" in a new
+        decl_list_recovery rule that allows to remove 4 redundant rules.
+
+        No new test required as we're just refactoring code, no new behaviour.
+
+        * css/CSSGrammar.y.in:
+
 2013-05-24  Ryosuke Niwa  <rn...@webkit.org>
 
         Build fix after r150664.

Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (150681 => 150682)


--- trunk/Source/WebCore/css/CSSGrammar.y.in	2013-05-25 04:20:37 UTC (rev 150681)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in	2013-05-25 08:29:42 UTC (rev 150682)
@@ -1532,22 +1532,14 @@
     | decl_list {
         $$ = $1;
     }
-    | errors invalid_block_list error {
+    | errors decl_list_recovery {
         parser->syntaxError($1, CSSParser::PropertyDeclarationError);
         $$ = false;
     }
-    | errors {
-        parser->syntaxError($1, CSSParser::PropertyDeclarationError);
-        $$ = false;
-    }
-    | decl_list errors {
+    | decl_list errors decl_list_recovery {
         parser->syntaxError($2, CSSParser::PropertyDeclarationError);
         $$ = $1;
     }
-    | decl_list errors invalid_block_list error {
-        parser->syntaxError($2, CSSParser::PropertyDeclarationError);
-        $$ = $1;
-    }
     ;
 
 decl_list:
@@ -1563,33 +1555,29 @@
         parser->syntaxError($2);
         $$ = false;
     }
-    | errors ';' maybe_space {
+    | errors decl_list_recovery ';' maybe_space {
         parser->syntaxError($1, CSSParser::PropertyDeclarationError);
         parser->markPropertyStart();
         $$ = false;
     }
-    | errors invalid_block_list error ';' maybe_space {
-        parser->syntaxError($1, CSSParser::PropertyDeclarationError);
-        $$ = false;
-    }
     | decl_list declaration ';' maybe_space {
         parser->markPropertyStart();
         $$ = $1;
         if ($2)
             $$ = $2;
     }
-    | decl_list errors ';' maybe_space {
+    | decl_list errors decl_list_recovery ';' maybe_space {
         parser->syntaxError($2, CSSParser::PropertyDeclarationError);
         parser->markPropertyStart();
         $$ = $1;
     }
-    | decl_list errors invalid_block_list error ';' maybe_space {
-        parser->syntaxError($2, CSSParser::PropertyDeclarationError);
-        parser->markPropertyStart();
-        $$ = $1;
-    }
     ;
 
+decl_list_recovery:
+    invalid_block_list error
+    | /* empty */
+    ;
+
 declaration:
     VAR_DEFINITION maybe_space ':' maybe_space expr prio {
 #if ENABLE_CSS_VARIABLES
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to