[webkit-dev] CSS parsing error recovery

Sergey Ryazanov serya at chromium.org
Thu Mar 28 06:24:05 PDT 2013


Working on CSS error reporting I found that CSS grammar (Source/WebCore/css/
CSSGrammar.y.in <http://cssgrammar.y.in/>) handles invalid_block's in
different parts of CSS declaration differently.

For instance, in current grammar test

        .malformed5 {color: red; {}}
        #test5 {

works fine while

        .malformed13 {color: red; color: red; {}; color: red}
        #test13 {

fails. In the second case parser log shows it drops opening brace and
closing braces considers as and of the rule.

I have a patch that fixes it: https://bugs.webkit.org/show_bug.cgi?id=112880

It makes error recovery in the end and in the middle (when error is
following by semicolon) of delcaration list equivalent.

Does anybody feel comfortable to review it?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20130328/0b8f75bf/attachment.html>

More information about the webkit-dev mailing list