No subject
Mon Jan 28 08:41:14 PST 2013
9446">r149446</a> by <serya at chromium.org>
Source/WebCore:
Added a new rule "declaration_recovery:" which covers any kind =
of
"invalid_block_list maybe_space" sequence. By appending this ne=
w
rule to every rule reductable to "declaration:" we can remove s=
ome
redundant rules and improve error recovery of some others that
were only accepting exactly one error.
One of the rules being removed was preventing invalid blocks in a
declaration to invalidate the whole declaration. The rule was
reporting the syntax error but at the same time accepting the
invalid block as part of a valid declaration.
* css/CSSGrammar.y.in:
LayoutTests:
* fast/css/parsing-error-recovery.html: Added 2 new test cases.</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 (150802 =
=3D> 150803)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/ChangeLog 2013-05-28 14:08:55 =
UTC (rev 150802)
+++ trunk/LayoutTests/ChangeLog 2013-05-28 14:31:11 UTC (rev 150803)
</span><span class=3D"lines">@@ -1,3 +1,14 @@
</span><ins>+2013-05-28 Sergio Villar Senin <svillar at igalia.com>
+
+ Invalid block doesn't make declaration invalid
+ https://bugs.webkit.org/show_bug.cgi?id=3D115709
+
+ Reviewed by Andreas Kling.
+
+ From Blink r149446 by <serya at chromium.org>
+
+ * fast/css/parsing-error-recovery.html: Added 2 new test cases.
+
</ins><span class=3D"cx"> 2013-05-28 =C3=81d=C3=A1m Kallai <kadam at in=
f.u-szeged.hu>
</span><span class=3D"cx">=20
</span><span class=3D"cx"> [Qt] Unreviewed gardening. Unskip now =
passing tests.
</span></span></pre></div>
<a id=3D"trunkLayoutTestsfastcssparsingerrorrecoveryhtml"></a>
<div class=3D"modfile"><h4>Modified: trunk/LayoutTests/fast/css/parsing-e=
rror-recovery.html (150802 =3D> 150803)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/fast/css/parsing-error-recover=
y.html 2013-05-28 14:08:55 UTC (rev 150802)
+++ trunk/LayoutTests/fast/css/parsing-error-recovery.html 2013-05-28 14:=
31:11 UTC (rev 150803)
</span><span class=3D"lines">@@ -48,6 +48,18 @@
</span><span class=3D"cx"> display:none;
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><ins>+ #test6 {
+ display: none !important;
+ display: block !important {invalid_block};
+ }
+
+ #test7 {
+ display: none !important;
+ }
+ #test7 {
+ display: block !important {invalid_block}
+ }
+
</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">@@ -60,6 +72,8 @@
</span><span class=3D"cx"> <div class=3D"to_be_hidden" id=3D=
"test3">FAIL: Test 3</div>
</span><span class=3D"cx"> <div class=3D"to_be_hidden" id=3D=
"test4">FAIL: Test 4</div>
</span><span class=3D"cx"> <div class=3D"to_be_hidden" id=3D=
"test5">FAIL: Test 5</div>
</span><ins>+ <div class=3D"to_be_hidden" id=3D"test6&=
quot;>FAIL: Test 6</div>
+ <div class=3D"to_be_hidden" id=3D"test7">FAI=
L: Test 7</div>
</ins><span class=3D"cx"> <div class=3D"to_be_shown" id=3D=
"last">PASS</div>
</span><span class=3D"cx"> </body>
</span><span class=3D"cx"> </html>
</span></span></pre></div>
<a id=3D"trunkSourceWebCoreChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (1508=
02 =3D> 150803)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/ChangeLog 2013-05-28 14:08:=
55 UTC (rev 150802)
+++ trunk/Source/WebCore/ChangeLog 2013-05-28 14:31:11 UTC (rev 150803)
</span><span class=3D"lines">@@ -1,3 +1,25 @@
</span><ins>+2013-05-28 Sergio Villar Senin <svillar at igalia.com>
+
+ Invalid block doesn't make declaration invalid
+ https://bugs.webkit.org/show_bug.cgi?id=3D115709
+
+ Reviewed by Andreas Kling.
+
+ From Blink r149446 by <serya at chromium.org>
+
+ Added a new rule "declaration_recovery:" which covers =
any kind of
+ "invalid_block_list maybe_space" sequence. By appendin=
g this new
+ rule to every rule reductable to "declaration:" we can=
remove some
+ redundant rules and improve error recovery of some others that
+ were only accepting exactly one error.
+
+ One of the rules being removed was preventing invalid blocks in =
a
+ declaration to invalidate the whole declaration. The rule was
+ reporting the syntax error but at the same time accepting the
+ invalid block as part of a valid declaration.
+
+ * css/CSSGrammar.y.in:
+
</ins><span class=3D"cx"> 2013-05-28 Andreas Kling <akling at apple.com=
>
</span><span class=3D"cx">=20
</span><span class=3D"cx"> Move dispatching of focus-related even=
ts from Node to Element.
</span></span></pre></div>
<a id=3D"trunkSourceWebCorecssCSSGrammaryin"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGrammar.=
y.in (150802 =3D> 150803)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/css/CSSGrammar.y.in 2013-05=
-28 14:08:55 UTC (rev 150802)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in 2013-05-28 14:31:11 UTC (rev=
150803)
</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 68
</del><ins>+%expect 65
</ins><span class=3D"cx"> #else
</span><del>-%expect 67
</del><ins>+%expect 64
</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">@@ -336,7 +336,6 @@
</span><span class=3D"cx"> %type <string> element_name
</span><span class=3D"cx"> %type <string> attr_name
</span><span class=3D"cx">=20
</span><del>-%type <location> errors
</del><span class=3D"cx"> %type <location> error_location
</span><span class=3D"cx">=20
</span><span class=3D"cx"> %%
</span><span class=3D"lines">@@ -1545,14 +1544,6 @@
</span><span class=3D"cx"> parser->markPropertyStart();
</span><span class=3D"cx"> $$ =3D $1;
</span><span class=3D"cx"> }
</span><del>- | declaration error_location invalid_block_list maybe_sp=
ace {
- parser->syntaxError($2);
- $$ =3D false;
- }
- | declaration error_location invalid_block_list ';' maybe_space {
- parser->syntaxError($2);
- $$ =3D false;
- }
</del><span class=3D"cx"> | decl_list_recovery ';' maybe_space {
</span><span class=3D"cx"> parser->markPropertyStart();
</span><span class=3D"cx"> $$ =3D false;
</span><span class=3D"lines">@@ -1604,51 +1595,34 @@
</span><span class=3D"cx"> parser->markPropertyEnd($5, isPrope=
rtyParsed);
</span><span class=3D"cx"> }
</span><span class=3D"cx"> |
</span><del>- property errors {
- parser->syntaxError($2);
</del><ins>+ property declaration_recovery {
</ins><span class=3D"cx"> $$ =3D false;
</span><span class=3D"cx"> }
</span><span class=3D"cx"> |
</span><del>- property ':' maybe_space errors expr prio {
- /* The default movable type template has letter-spacing: .none; =
Handle this by looking for
- error tokens at the start of an expr, recover the expr and then =
treat as an error, cleaning
- up and deleting the shifted expr. */
- parser->syntaxError($4);
- parser->markPropertyEnd(false, false);
- $$ =3D false;
- }
- |
- property ':' maybe_space expr prio error {
</del><ins>+ property ':' maybe_space expr prio declaration_recovery {
</ins><span class=3D"cx"> /* When we encounter something like p {=
color: red !important fail;} we should drop the declaration */
</span><span class=3D"cx"> parser->markPropertyEnd(false, fals=
e);
</span><span class=3D"cx"> $$ =3D false;
</span><span class=3D"cx"> }
</span><span class=3D"cx"> |
</span><del>- IMPORTANT_SYM maybe_space error_location {
</del><ins>+ IMPORTANT_SYM maybe_space declaration_recovery {
</ins><span class=3D"cx"> /* Handle this case: div { text-align: =
center; !important } Just reduce away the stray !important. */
</span><del>- parser->syntaxError($3);
</del><span class=3D"cx"> $$ =3D false;
</span><span class=3D"cx"> }
</span><span class=3D"cx"> |
</span><del>- property ':' maybe_space error_location {
- /* div { font-family: } Just reduce away this property with no v=
alue. */
- parser->syntaxError($4);
- parser->markPropertyEnd(false, false);
- $$ =3D false;
- }
- |
- property ':' maybe_space errors {
</del><ins>+ property ':' maybe_space declaration_recovery {
</ins><span class=3D"cx"> /* if we come across rules with invalid=
values like this case: p { weight: *; }, just discard the rule */
</span><del>- parser->syntaxError($4);
</del><span class=3D"cx"> parser->markPropertyEnd(false, false=
);
</span><span class=3D"cx"> $$ =3D false;
</span><span class=3D"cx"> }
</span><del>- |
- property error_location invalid_block {
- /* if we come across: div { color{;color:maroon} }, ignore every=
thing within curly brackets */
</del><ins>+ ;
+
+declaration_recovery:
+ error error_location {
</ins><span class=3D"cx"> parser->syntaxError($2);
</span><del>- $$ =3D false;
</del><span class=3D"cx"> }
</span><ins>+ | declaration_recovery invalid_block
+ | declaration_recovery error
</ins><span class=3D"cx"> ;
</span><span class=3D"cx">=20
</span><span class=3D"cx"> property:
</span><span class=3D"lines">@@ -2001,12 +1975,6 @@
</span><span class=3D"cx"> | invalid_block_list error invalid_block
</span><span class=3D"cx"> ;
</span><span class=3D"cx">=20
</span><del>-errors:
- error error_location {
- $$ =3D $2;
- }
- ;
-
</del><span class=3D"cx"> error_location: {
</span><span class=3D"cx"> $$ =3D parser->currentLocation();
</span><span class=3D"cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>
More information about the webkit-changes
mailing list