Bug 111314 - Web Inspector: Track CSS error location information.
Summary: Web Inspector: Track CSS error location information.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Sergey Ryazanov
URL: http://cebug.com/140608
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-04 06:35 PST by Sergey Ryazanov
Modified: 2013-03-21 04:44 PDT (History)
13 users (show)

See Also:


Attachments
Patch (21.84 KB, patch)
2013-03-04 06:41 PST, Sergey Ryazanov
no flags Details | Formatted Diff | Diff
Patch (8.97 KB, patch)
2013-03-04 07:43 PST, Sergey Ryazanov
no flags Details | Formatted Diff | Diff
Patch (7.12 KB, patch)
2013-03-20 09:32 PDT, Sergey Ryazanov
no flags Details | Formatted Diff | Diff
Patch (7.42 KB, patch)
2013-03-20 23:49 PDT, Sergey Ryazanov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Ryazanov 2013-03-04 06:35:04 PST
In preparation to handle CSS diagnostics (http://cebug.com/140608) grammar needs to be changed to make syntax error reporting possible and track error location information.
Comment 1 Sergey Ryazanov 2013-03-04 06:41:32 PST
Created attachment 191228 [details]
Patch
Comment 2 Sergey Ryazanov 2013-03-04 06:44:01 PST
Comment on attachment 191228 [details]
Patch

Patch extracted from https://bugs.webkit.org/show_bug.cgi?id=110483
Comment 3 Pavel Feldman 2013-03-04 06:52:13 PST
Comment on attachment 191228 [details]
Patch

I still think you should change this grammar gradually, i.e. step by step.
Comment 4 Sergey Ryazanov 2013-03-04 07:43:33 PST
Created attachment 191243 [details]
Patch
Comment 5 Pavel Feldman 2013-03-04 07:55:06 PST
Comment on attachment 191243 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=191243&action=review

> Source/WebCore/ChangeLog:5
> +        Grammar has been refactored.

You should explain what is going to happen, link to the meta bug that lists all the steps that you are going to make.

> Source/WebCore/css/CSSParser.cpp:9308
> +}

As I suggested, you should start with landing the plumbing.

> Source/WebCore/css/CSSParser.cpp:10469
> +                getCurrentToken<SrcCharacterType>(&yylval->string);

This change seems to be unrelated to what you are doing.
Comment 6 Sergey Ryazanov 2013-03-20 09:32:33 PDT
Created attachment 194079 [details]
Patch
Comment 7 Pavel Feldman 2013-03-20 23:09:22 PDT
Comment on attachment 194079 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=194079&action=review

> Source/WebCore/ChangeLog:10
> +        Test: inspector/console/console-css-warnings.html

Please explain what is changing and why.

> Source/WebCore/css/CSSGrammar.y.in:1515
> +    /* empty */ { $$ = false; }

Why did this change?

> Source/WebCore/css/CSSGrammar.y.in:1527
> +    | errors invalid_block_list error {

Here and below. Why did this change? It seems like you are replacing "error" with the sequence of "error" here.
Comment 8 Sergey Ryazanov 2013-03-20 23:49:20 PDT
Created attachment 194194 [details]
Patch
Comment 9 Sergey Ryazanov 2013-03-20 23:51:18 PDT
Comment on attachment 194079 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=194079&action=review

>> Source/WebCore/css/CSSGrammar.y.in:1515
>> +    /* empty */ { $$ = false; }
> 
> Why did this change?

Before this change the following CSS text "body {}" was handled by rule "declaration: error". It used to be acceptable before I added error reporting code. With old rgammar it'd indistinguishable from "body {#}".

>> Source/WebCore/css/CSSGrammar.y.in:1527
>> +    | errors invalid_block_list error {
> 
> Here and below. Why did this change? It seems like you are replacing "error" with the sequence of "error" here.

Because of special handling for built in nontermial 'error' resulting grammar is equivalent. Sequence of errors is always reduced to single error symbol. "error_location error invalid_block error" could be used with the same effect but this is shorter.
Comment 10 WebKit Review Bot 2013-03-21 04:44:03 PDT
Comment on attachment 194194 [details]
Patch

Clearing flags on attachment: 194194

Committed r146452: <http://trac.webkit.org/changeset/146452>
Comment 11 WebKit Review Bot 2013-03-21 04:44:07 PDT
All reviewed patches have been landed.  Closing bug.