No subject


Mon Jan 28 08:41:14 PST 2013


9265">r149265</a> by &lt;serya at chromium.org&gt;

Source/WebCore:

CSS logging was disabled in <a href=3D"http://trac.webkit.org/projects/we=
bkit/changeset/147028">r147028</a> to prevent message overflow in
the inspector console. This change restores it by modifying the
CSS grammar in order to reduce as much consecutive errors as
possible in 'declaration_list' and 'decl_list' rules.

This way, for rules like 'x { color: ### }' only the first '#'
will be reported as error (instead of 3 identical errors).

The rule 'declaration' still produces multiple errors, because it
does not eat as much errors as possible. So in order not to create
a complex risky patch we just disable logging in the parser for
that rule.

* css/CSSGrammar.y.in:
* css/CSSParser.cpp:
(WebCore::CSSParser::CSSParser):
(WebCore::CSSParser::parseSheet):
(WebCore::CSSParser::syntaxError):
(WebCore::CSSParser::isLoggingErrors):
(WebCore::CSSParser::rewriteSpecifiers):
* css/CSSParser.h:
(CSSParser):

LayoutTests:

Unskipped console-css-warnings.html now that it's working.

* TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href=3D"#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a=
></li>
<li><a href=3D"#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestE=
xpectations</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>
<li><a href=3D"#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/c=
ss/CSSParser.cpp</a></li>
<li><a href=3D"#trunkSourceWebCorecssCSSParserh">trunk/Source/WebCore/css=
/CSSParser.h</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 (150790 =
=3D> 150791)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/ChangeLog	2013-05-28 07:18:16 =
UTC (rev 150790)
+++ trunk/LayoutTests/ChangeLog	2013-05-28 07:21:02 UTC (rev 150791)
</span><span class=3D"lines">@@ -1,3 +1,16 @@
</span><ins>+2013-05-28  Sergio Villar Senin  &lt;svillar at igalia.com&gt;
+
+        Web Inspector: Enable CSS logging
+        https://bugs.webkit.org/show_bug.cgi?id=3D113401
+
+        Reviewed by Benjamin Poulain.
+
+        From Blink r149265 by &lt;serya at chromium.org&gt;
+
+        Unskipped console-css-warnings.html now that it's working.
+
+        * TestExpectations:
+
</ins><span class=3D"cx"> 2013-05-27  Claudio Saavedra  &lt;csaavedra at iga=
lia.com&gt;
</span><span class=3D"cx">=20
</span><span class=3D"cx">         [CSS] -webkit-var prefix is case-sensi=
tive
</span></span></pre></div>
<a id=3D"trunkLayoutTestsTestExpectations"></a>
<div class=3D"modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (=
150790 =3D> 150791)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/TestExpectations	2013-05-28 07=
:18:16 UTC (rev 150790)
+++ trunk/LayoutTests/TestExpectations	2013-05-28 07:21:02 UTC (rev 15079=
1)
</span><span class=3D"lines">@@ -8,9 +8,6 @@
</span><span class=3D"cx"> # pending implementation completion and featur=
e enabling
</span><span class=3D"cx"> webkit.org/b/109570 media/track/regions-webvtt=
 [ Skip ]
</span><span class=3D"cx">=20
</span><del>-# pending CSS grammar refactoring
-webkit.org/b/113401 inspector/console/console-css-warnings.html [ Skip ]
-
</del><span class=3D"cx"> # media/video-seek-after-end.html is flaky
</span><span class=3D"cx"> webkit.org/b/116293 media/video-seek-after-end=
.html [ Pass Failure ]
</span><span class=3D"cx">=20
</span></span></pre></div>
<a id=3D"trunkSourceWebCoreChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (1507=
90 =3D> 150791)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/ChangeLog	2013-05-28 07:18:=
16 UTC (rev 150790)
+++ trunk/Source/WebCore/ChangeLog	2013-05-28 07:21:02 UTC (rev 150791)
</span><span class=3D"lines">@@ -1,3 +1,35 @@
</span><ins>+2013-05-28  Sergio Villar Senin  &lt;svillar at igalia.com&gt;
+
+        Web Inspector: Enable CSS logging
+        https://bugs.webkit.org/show_bug.cgi?id=3D113401
+
+        Reviewed by Benjamin Poulain.
+
+        From Blink r149265 by &lt;serya at chromium.org&gt;
+
+        CSS logging was disabled in r147028 to prevent message overflow =
in
+        the inspector console. This change restores it by modifying the
+        CSS grammar in order to reduce as much consecutive errors as
+        possible in 'declaration_list' and 'decl_list' rules.
+
+        This way, for rules like 'x { color: ### }' only the first '#'
+        will be reported as error (instead of 3 identical errors).
+
+        The rule 'declaration' still produces multiple errors, because i=
t
+        does not eat as much errors as possible. So in order not to crea=
te
+        a complex risky patch we just disable logging in the parser for
+        that rule.
+
+        * css/CSSGrammar.y.in:
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::CSSParser):
+        (WebCore::CSSParser::parseSheet):
+        (WebCore::CSSParser::syntaxError):
+        (WebCore::CSSParser::isLoggingErrors):
+        (WebCore::CSSParser::rewriteSpecifiers):
+        * css/CSSParser.h:
+        (CSSParser):
+
</ins><span class=3D"cx"> 2013-05-27  Patrick Gansterer  &lt;paroga at webki=
t.org&gt;
</span><span class=3D"cx">=20
</span><span class=3D"cx">         Build fix for WinCE after r150730.
</span></span></pre></div>
<a id=3D"trunkSourceWebCorecssCSSGrammaryin"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGrammar.=
y.in (150790 =3D> 150791)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/css/CSSGrammar.y.in	2013-05=
-28 07:18:16 UTC (rev 150790)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in	2013-05-28 07:21:02 UTC (rev=
 150791)
</span><span class=3D"lines">@@ -1532,12 +1532,10 @@
</span><span class=3D"cx">     | decl_list {
</span><span class=3D"cx">         $$ =3D $1;
</span><span class=3D"cx">     }
</span><del>-    | errors decl_list_recovery {
-        parser-&gt;syntaxError($1, CSSParser::PropertyDeclarationError);
</del><ins>+    | decl_list_recovery {
</ins><span class=3D"cx">         $$ =3D false;
</span><span class=3D"cx">     }
</span><del>-    | decl_list errors decl_list_recovery {
-        parser-&gt;syntaxError($2, CSSParser::PropertyDeclarationError);
</del><ins>+    | decl_list decl_list_recovery {
</ins><span class=3D"cx">         $$ =3D $1;
</span><span class=3D"cx">     }
</span><span class=3D"cx">     ;
</span><span class=3D"lines">@@ -1555,8 +1553,7 @@
</span><span class=3D"cx">         parser-&gt;syntaxError($2);
</span><span class=3D"cx">         $$ =3D false;
</span><span class=3D"cx">     }
</span><del>-    | errors decl_list_recovery ';' maybe_space {
-        parser-&gt;syntaxError($1, CSSParser::PropertyDeclarationError);
</del><ins>+    | decl_list_recovery ';' maybe_space {
</ins><span class=3D"cx">         parser-&gt;markPropertyStart();
</span><span class=3D"cx">         $$ =3D false;
</span><span class=3D"cx">     }
</span><span class=3D"lines">@@ -1566,16 +1563,18 @@
</span><span class=3D"cx">         if ($2)
</span><span class=3D"cx">             $$ =3D $2;
</span><span class=3D"cx">     }
</span><del>-    | decl_list errors decl_list_recovery ';' maybe_space {
-        parser-&gt;syntaxError($2, CSSParser::PropertyDeclarationError);
</del><ins>+    | decl_list decl_list_recovery ';' maybe_space {
</ins><span class=3D"cx">         parser-&gt;markPropertyStart();
</span><span class=3D"cx">         $$ =3D $1;
</span><span class=3D"cx">     }
</span><span class=3D"cx">     ;
</span><span class=3D"cx">=20
</span><span class=3D"cx"> decl_list_recovery:
</span><del>-    invalid_block_list error
-    | /* empty */
</del><ins>+    error error_location {
+        parser-&gt;syntaxError($2, CSSParser::PropertyDeclarationError);
+    }
+    | decl_list_recovery invalid_block
+    | decl_list_recovery error
</ins><span class=3D"cx">     ;
</span><span class=3D"cx">=20
</span><span class=3D"cx"> declaration:
</span></span></pre></div>
<a id=3D"trunkSourceWebCorecssCSSParsercpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.c=
pp (150790 =3D> 150791)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/css/CSSParser.cpp	2013-05-2=
8 07:18:16 UTC (rev 150790)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2013-05-28 07:21:02 UTC (rev 1=
50791)
</span><span class=3D"lines">@@ -324,6 +324,7 @@
</span><span class=3D"cx">     , m_hasFontFaceOnlyValues(false)
</span><span class=3D"cx">     , m_hadSyntacticallyValidCSSRule(false)
</span><span class=3D"cx">     , m_logErrors(false)
</span><ins>+    , m_ignoreErrorsInDeclaration(false)
</ins><span class=3D"cx"> #if ENABLE(CSS_SHADERS)
</span><span class=3D"cx">     , m_inFilterRule(false)
</span><span class=3D"cx"> #endif
</span><span class=3D"lines">@@ -460,6 +461,7 @@
</span><span class=3D"cx">     m_ruleSourceDataResult =3D ruleSourceDataR=
esult;
</span><span class=3D"cx">=20
</span><span class=3D"cx">     m_logErrors =3D logErrors &amp;&amp; sheet=
-&gt;singleOwnerDocument() &amp;&amp; !sheet-&gt;baseURL().isEmpty() &amp=
;&amp; sheet-&gt;singleOwnerDocument()-&gt;page();
</span><ins>+    m_ignoreErrorsInDeclaration =3D false;
</ins><span class=3D"cx">     m_lineNumber =3D startLineNumber;
</span><span class=3D"cx">     setupParser(&quot;&quot;, string, &quot;&q=
uot;);
</span><span class=3D"cx">     cssyyparse(this);
</span><span class=3D"lines">@@ -467,6 +469,7 @@
</span><span class=3D"cx">     m_currentRuleDataStack.clear();
</span><span class=3D"cx">     m_ruleSourceDataResult =3D 0;
</span><span class=3D"cx">     m_rule =3D 0;
</span><ins>+    m_ignoreErrorsInDeclaration =3D false;
</ins><span class=3D"cx">     m_logErrors =3D false;
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><span class=3D"lines">@@ -11498,12 +11501,13 @@
</span><span class=3D"cx">         builder.append(location.token.characte=
rs16(), location.token.length());
</span><span class=3D"cx">=20
</span><span class=3D"cx">     logError(builder.toString(), location.line=
Number);
</span><ins>+
+    m_ignoreErrorsInDeclaration =3D true;
</ins><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><span class=3D"cx"> bool CSSParser::isLoggingErrors()
</span><span class=3D"cx"> {
</span><del>-    // FIXME: return logging back (https://bugs.webkit.org/s=
how_bug.cgi?id=3D113401).
-    return false;
</del><ins>+    return m_logErrors &amp;&amp; !m_ignoreErrorsInDeclaratio=
n;
</ins><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><span class=3D"cx"> void CSSParser::logError(const String&amp; mes=
sage, int lineNumber)
</span><span class=3D"lines">@@ -11949,6 +11953,7 @@
</span><span class=3D"cx">=20
</span><span class=3D"cx"> void CSSParser::markPropertyStart()
</span><span class=3D"cx"> {
</span><ins>+    m_ignoreErrorsInDeclaration =3D false;
</ins><span class=3D"cx">     if (!isExtractingSourceData())
</span><span class=3D"cx">         return;
</span><span class=3D"cx">     if (m_currentRuleDataStack-&gt;isEmpty() |=
| !m_currentRuleDataStack-&gt;last()-&gt;styleSourceData)
</span></span></pre></div>
<a id=3D"trunkSourceWebCorecssCSSParserh"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.h=
 (150790 =3D> 150791)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/css/CSSParser.h	2013-05-28 =
07:18:16 UTC (rev 150790)
+++ trunk/Source/WebCore/css/CSSParser.h	2013-05-28 07:21:02 UTC (rev 150=
791)
</span><span class=3D"lines">@@ -397,6 +397,7 @@
</span><span class=3D"cx">     bool m_hasFontFaceOnlyValues;
</span><span class=3D"cx">     bool m_hadSyntacticallyValidCSSRule;
</span><span class=3D"cx">     bool m_logErrors;
</span><ins>+    bool m_ignoreErrorsInDeclaration;
</ins><span class=3D"cx">=20
</span><span class=3D"cx"> #if ENABLE(CSS_SHADERS)
</span><span class=3D"cx">     bool m_inFilterRule;
</span></span></pre>
</div>
</div>

</body>
</html>


More information about the webkit-changes mailing list