No subject


Mon Jan 28 08:41:14 PST 2013


0205">r150205</a> by &lt;serya at chromium.org&gt;

Source/WebCore:

Add parsing recovery capabilities to functions. Errors were
correctly detected without this change but then the whole
declaration was invalidated. By using expr_recovery to handle them
we can recover from those errors and go on with the parsing.

* css/CSSGrammar.y.in:

LayoutTests:

* fast/css/parsing-error-recovery.html: added some test cases for
parsing recovery inside functions.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href=3D"#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a=
></li>
<li><a href=3D"#trunkLayoutTestsfastcssparsingerrorrecoveryhtml">trunk/La=
youtTests/fast/css/parsing-error-recovery.html</a></li>
<li><a href=3D"#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeL=
og</a></li>
<li><a href=3D"#trunkSourceWebCorecssCSSGrammaryin">trunk/Source/WebCore/=
css/CSSGrammar.y.in</a></li>
</ul>

</div>
<div id=3D"patch">
<h3>Diff</h3>
<a id=3D"trunkLayoutTestsChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (151487 =
=3D> 151488)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/ChangeLog	2013-06-12 06:05:58 =
UTC (rev 151487)
+++ trunk/LayoutTests/ChangeLog	2013-06-12 07:20:20 UTC (rev 151488)
</span><span class=3D"lines">@@ -1,3 +1,15 @@
</span><ins>+2013-06-12  Sergio Villar Senin  &lt;svillar at igalia.com&gt;
+
+        Add CSS parsing recovery to functions
+        https://bugs.webkit.org/show_bug.cgi?id=3D117500
+
+        Reviewed by Andreas Kling.
+
+        From Blink r150205 by &lt;serya at chromium.org&gt;
+
+        * fast/css/parsing-error-recovery.html: added some test cases fo=
r
+        parsing recovery inside functions.
+
</ins><span class=3D"cx"> 2013-06-11  Gyuyoung Kim  &lt;gyuyoung.kim at sams=
ung.com&gt;
</span><span class=3D"cx">=20
</span><span class=3D"cx">         Unreviewed, EFL Gardening. Unskip fast=
/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html
</span></span></pre></div>
<a id=3D"trunkLayoutTestsfastcssparsingerrorrecoveryhtml"></a>
<div class=3D"modfile"><h4>Modified: trunk/LayoutTests/fast/css/parsing-e=
rror-recovery.html (151487 =3D> 151488)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/fast/css/parsing-error-recover=
y.html	2013-06-12 06:05:58 UTC (rev 151487)
+++ trunk/LayoutTests/fast/css/parsing-error-recovery.html	2013-06-12 07:=
20:20 UTC (rev 151488)
</span><span class=3D"lines">@@ -60,6 +60,36 @@
</span><span class=3D"cx">             display: block !important {invalid=
_block}
</span><span class=3D"cx">         }
</span><span class=3D"cx">=20
</span><ins>+        #test8 {
+            color: rgb(1,});
+            display: none;
+        }
+
+        #test9 {
+            color: rgb(});
+            display: none;
+        }
+
+        #test10 {
+            width: calc(1,});
+            display: none;
+        }
+
+        #test11 {
+            width: calc(});
+            display: none;
+        }
+
+        #test12 {
+            width: -webkit-min(1,});
+            display: none;
+        }
+
+        #test13 {
+            width: -webkit-min(});
+            display: none;
+        }
+
</ins><span class=3D"cx">         /* Successfully parsed */
</span><span class=3D"cx">         #last {
</span><span class=3D"cx">             display:block;
</span><span class=3D"lines">@@ -74,6 +104,12 @@
</span><span class=3D"cx">   &lt;div class=3D&quot;to_be_hidden&quot; id=3D=
&quot;test5&quot;&gt;FAIL: Test 5&lt;/div&gt;
</span><span class=3D"cx">   &lt;div class=3D&quot;to_be_hidden&quot; id=3D=
&quot;test6&quot;&gt;FAIL: Test 6&lt;/div&gt;
</span><span class=3D"cx">   &lt;div class=3D&quot;to_be_hidden&quot; id=3D=
&quot;test7&quot;&gt;FAIL: Test 7&lt;/div&gt;
</span><ins>+  &lt;div class=3D&quot;to_be_hidden&quot; id=3D&quot;test8&=
quot;&gt;FAIL: Test 8&lt;/div&gt;
+  &lt;div class=3D&quot;to_be_hidden&quot; id=3D&quot;test9&quot;&gt;FAI=
L: Test 9&lt;/div&gt;
+  &lt;div class=3D&quot;to_be_hidden&quot; id=3D&quot;test10&quot;&gt;FA=
IL: Test 10&lt;/div&gt;
+  &lt;div class=3D&quot;to_be_hidden&quot; id=3D&quot;test11&quot;&gt;FA=
IL: Test 11&lt;/div&gt;
+  &lt;div class=3D&quot;to_be_hidden&quot; id=3D&quot;test12&quot;&gt;FA=
IL: Test 12&lt;/div&gt;
+  &lt;div class=3D&quot;to_be_hidden&quot; id=3D&quot;test13&quot;&gt;FA=
IL: Test 13&lt;/div&gt;
</ins><span class=3D"cx">   &lt;div class=3D&quot;to_be_shown&quot; id=3D=
&quot;last&quot;&gt;PASS&lt;/div&gt;
</span><span class=3D"cx"> &lt;/body&gt;
</span><span class=3D"cx"> &lt;/html&gt;
</span></span></pre></div>
<a id=3D"trunkSourceWebCoreChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (1514=
87 =3D> 151488)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/ChangeLog	2013-06-12 06:05:=
58 UTC (rev 151487)
+++ trunk/Source/WebCore/ChangeLog	2013-06-12 07:20:20 UTC (rev 151488)
</span><span class=3D"lines">@@ -1,3 +1,19 @@
</span><ins>+2013-06-12  Sergio Villar Senin  &lt;svillar at igalia.com&gt;
+
+        Add CSS parsing recovery to functions
+        https://bugs.webkit.org/show_bug.cgi?id=3D117500
+
+        Reviewed by Andreas Kling.
+
+        From Blink r150205 by &lt;serya at chromium.org&gt;
+
+        Add parsing recovery capabilities to functions. Errors were
+        correctly detected without this change but then the whole
+        declaration was invalidated. By using expr_recovery to handle th=
em
+        we can recover from those errors and go on with the parsing.
+
+        * css/CSSGrammar.y.in:
+
</ins><span class=3D"cx"> 2013-06-11  Christophe Dumez  &lt;ch.dumez at sisa=
.samsung.com&gt;
</span><span class=3D"cx">=20
</span><span class=3D"cx">         Unreviewed, rolling out r151378.
</span></span></pre></div>
<a id=3D"trunkSourceWebCorecssCSSGrammaryin"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGrammar.=
y.in (151487 =3D> 151488)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/css/CSSGrammar.y.in	2013-06=
-12 06:05:58 UTC (rev 151487)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in	2013-06-12 07:20:20 UTC (rev=
 151488)
</span><span class=3D"lines">@@ -88,9 +88,9 @@
</span><span class=3D"cx"> %}
</span><span class=3D"cx">=20
</span><span class=3D"cx"> #if ENABLE_SHADOW_DOM
</span><del>-%expect 33
</del><ins>+%expect 32
</ins><span class=3D"cx"> #else
</span><del>-%expect 32
</del><ins>+%expect 31
</ins><span class=3D"cx"> #endif
</span><span class=3D"cx">=20
</span><span class=3D"cx"> %nonassoc LOWEST_PREC
</span><span class=3D"lines">@@ -1700,13 +1700,13 @@
</span><span class=3D"cx"> #endif
</span><span class=3D"cx">   }
</span><span class=3D"cx">   /* FIXME: according to the specs a function =
can have a unary_operator in front. I know no case where this makes sense=
 */
</span><del>-  | function {
</del><ins>+  | function maybe_space {
</ins><span class=3D"cx">       $$ =3D $1;
</span><span class=3D"cx">   }
</span><del>-  | calc_function {
</del><ins>+  | calc_function maybe_space {
</ins><span class=3D"cx">       $$ =3D $1;
</span><span class=3D"cx">   }
</span><del>-  | min_or_max_function {
</del><ins>+  | min_or_max_function maybe_space {
</ins><span class=3D"cx">       $$ =3D $1;
</span><span class=3D"cx">   }
</span><span class=3D"cx">   | '%' maybe_space { /* Handle width: %; */
</span><span class=3D"lines">@@ -1753,7 +1753,7 @@
</span><span class=3D"cx">   ;
</span><span class=3D"cx">=20
</span><span class=3D"cx"> function:
</span><del>-    FUNCTION maybe_space expr closing_parenthesis maybe_spac=
e {
</del><ins>+    FUNCTION maybe_space expr closing_parenthesis {
</ins><span class=3D"cx">         CSSParserFunction* f =3D parser-&gt;cre=
ateFloatingFunction();
</span><span class=3D"cx">         f-&gt;name =3D $1;
</span><span class=3D"cx">         f-&gt;args =3D parser-&gt;sinkFloating=
ValueList($3);
</span><span class=3D"lines">@@ -1761,7 +1761,7 @@
</span><span class=3D"cx">         $$.unit =3D CSSParserValue::Function;
</span><span class=3D"cx">         $$.function =3D f;
</span><span class=3D"cx">     } |
</span><del>-    FUNCTION maybe_space closing_parenthesis maybe_space {
</del><ins>+    FUNCTION maybe_space closing_parenthesis {
</ins><span class=3D"cx">         CSSParserFunction* f =3D parser-&gt;cre=
ateFloatingFunction();
</span><span class=3D"cx">         f-&gt;name =3D $1;
</span><span class=3D"cx">         CSSParserValueList* valueList =3D pars=
er-&gt;createFloatingValueList();
</span><span class=3D"lines">@@ -1770,7 +1770,7 @@
</span><span class=3D"cx">         $$.unit =3D CSSParserValue::Function;
</span><span class=3D"cx">         $$.function =3D f;
</span><span class=3D"cx">     } |
</span><del>-    FUNCTION maybe_space error {
</del><ins>+    FUNCTION maybe_space expr_recovery closing_parenthesis {
</ins><span class=3D"cx">         CSSParserFunction* f =3D parser-&gt;cre=
ateFloatingFunction();
</span><span class=3D"cx">         f-&gt;name =3D $1;
</span><span class=3D"cx">         f-&gt;args =3D nullptr;
</span><span class=3D"lines">@@ -1883,7 +1883,7 @@
</span><span class=3D"cx">   ;
</span><span class=3D"cx">=20
</span><span class=3D"cx"> calc_function:
</span><del>-    CALCFUNCTION maybe_space calc_func_expr calc_maybe_space=
 closing_parenthesis maybe_space {
</del><ins>+    CALCFUNCTION maybe_space calc_func_expr calc_maybe_space =
closing_parenthesis {
</ins><span class=3D"cx">         CSSParserFunction* f =3D parser-&gt;cre=
ateFloatingFunction();
</span><span class=3D"cx">         f-&gt;name =3D $1;
</span><span class=3D"cx">         f-&gt;args =3D parser-&gt;sinkFloating=
ValueList($3);
</span><span class=3D"lines">@@ -1891,7 +1891,7 @@
</span><span class=3D"cx">         $$.unit =3D CSSParserValue::Function;
</span><span class=3D"cx">         $$.function =3D f;
</span><span class=3D"cx">     }
</span><del>-    | CALCFUNCTION maybe_space error {
</del><ins>+    | CALCFUNCTION maybe_space expr_recovery closing_parenthe=
sis {
</ins><span class=3D"cx">         YYERROR;
</span><span class=3D"cx">     }
</span><span class=3D"cx">     ;
</span><span class=3D"lines">@@ -1907,7 +1907,7 @@
</span><span class=3D"cx">     ;
</span><span class=3D"cx">=20
</span><span class=3D"cx"> min_or_max_function:
</span><del>-    min_or_max maybe_space calc_func_expr_list closing_paren=
thesis maybe_space {
</del><ins>+    min_or_max maybe_space calc_func_expr_list closing_parent=
hesis {
</ins><span class=3D"cx">         CSSParserFunction* f =3D parser-&gt;cre=
ateFloatingFunction();
</span><span class=3D"cx">         f-&gt;name =3D $1;
</span><span class=3D"cx">         f-&gt;args =3D parser-&gt;sinkFloating=
ValueList($3);
</span><span class=3D"lines">@@ -1915,7 +1915,7 @@
</span><span class=3D"cx">         $$.unit =3D CSSParserValue::Function;
</span><span class=3D"cx">         $$.function =3D f;
</span><span class=3D"cx">     }=20
</span><del>-    | min_or_max maybe_space error {
</del><ins>+    | min_or_max maybe_space expr_recovery closing_parenthesi=
s {
</ins><span class=3D"cx">         YYERROR;
</span><span class=3D"cx">     }
</span><span class=3D"cx">     ;
</span></span></pre>
</div>
</div>

</body>
</html>


More information about the webkit-changes mailing list