[webkit-dev] CSS parsing error recovery

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


Hi,

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

 <style>
        .malformed5 {color: red; {}}
        #test5 {
            display:none;
        }
    </style>

works fine while

    <style>
        .malformed13 {color: red; color: red; {}; color: red}
        #test13 {
            display:none;
        }
    </style>

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?

Sergey
-------------- 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