Bug 113175 - Web Inspector: Remove console warnings for *_ prefixed CSS styles
Summary: Web Inspector: Remove console warnings for *_ prefixed CSS styles
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://crbug.com/223296
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-25 01:38 PDT by Sergey Ryazanov
Modified: 2013-03-26 05:14 PDT (History)
14 users (show)

See Also:


Attachments
Patch (3.33 KB, patch)
2013-03-25 01:41 PDT, Sergey Ryazanov
no flags Details | Formatted Diff | Diff
Patch (6.90 KB, patch)
2013-03-25 03:24 PDT, Sergey Ryazanov
no flags Details | Formatted Diff | Diff
Patch (8.51 KB, patch)
2013-03-25 05:53 PDT, Sergey Ryazanov
no flags Details | Formatted Diff | Diff
Patch (8.63 KB, patch)
2013-03-25 06:35 PDT, Sergey Ryazanov
no flags Details | Formatted Diff | Diff
Patch (8.58 KB, patch)
2013-03-25 07:36 PDT, Sergey Ryazanov
no flags Details | Formatted Diff | Diff
Patch (8.60 KB, patch)
2013-03-25 08:00 PDT, Sergey Ryazanov
no flags Details | Formatted Diff | Diff
Patch (8.47 KB, patch)
2013-03-25 08:45 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-25 01:38:57 PDT
This hack commonly used for IE-only declarations. It floods the console and should be ignored.
Comment 1 Sergey Ryazanov 2013-03-25 01:41:53 PDT
Created attachment 194801 [details]
Patch
Comment 2 Sergey Ryazanov 2013-03-25 03:24:55 PDT
Created attachment 194816 [details]
Patch
Comment 3 Pavel Feldman 2013-03-25 04:24:44 PDT
Comment on attachment 194816 [details]
Patch

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

> Source/WebCore/css/CSSParser.cpp:11288
> +    // Ignore syntax error. This trick is used for IE7:

There should be no "IE7" in CSS parser. You should filter this error later.
Comment 4 Sergey Ryazanov 2013-03-25 05:53:24 PDT
Created attachment 194834 [details]
Patch
Comment 5 Pavel Feldman 2013-03-25 06:00:28 PDT
Comment on attachment 194834 [details]
Patch

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

> Source/WebCore/css/CSSParser.cpp:11273
> +static void AppendToken(StringBuilder* builder, const CSSParserString& token)

Methods start with lower case in WebKit.

> Source/WebCore/css/CSSParser.cpp:11294
> +    builder.appendLiteral("Invalid CSS property declaration at: ");

I'd pass enum into single syntaxError and would choose title based on the enum value.

> Source/WebCore/inspector/InspectorConsoleAgent.cpp:191
> +    if (source == CSSMessageSource && message == "Invalid CSS property declaration at: *")

I'd simply look for "*", please also add a comment explaining why this happens.
Comment 6 Sergey Ryazanov 2013-03-25 06:35:35 PDT
Created attachment 194841 [details]
Patch
Comment 7 Pavel Feldman 2013-03-25 07:01:35 PDT
Comment on attachment 194841 [details]
Patch

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

> Source/WebCore/css/CSSParser.cpp:11289
> +        appendToken(&builder, location.token);

You don't need appendToken any longer, do you?

> Source/WebCore/css/CSSParser.h:80
> +        InvalidPropertyDeclaration,

PropertyDeclarationError

> Source/WebCore/inspector/InspectorConsoleAgent.cpp:192
> +    if (source == CSSMessageSource && message == "Invalid CSS property declaration at: *")

You should only look for "*" as I suggested.
Comment 8 Sergey Ryazanov 2013-03-25 07:36:56 PDT
Created attachment 194851 [details]
Patch
Comment 9 Pavel Feldman 2013-03-25 07:54:59 PDT
Comment on attachment 194851 [details]
Patch

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

> Source/WebCore/inspector/InspectorConsoleAgent.cpp:193
> +        int index = message.find(": ");

size_t

> Source/WebCore/inspector/InspectorConsoleAgent.cpp:194
> +        if (index >= 0 && (int)message.length() > index + 1 && message[index + 2] == '*')

static_cast<int>(...)
Comment 10 Sergey Ryazanov 2013-03-25 08:00:18 PDT
Comment on attachment 194851 [details]
Patch

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

>> Source/WebCore/inspector/InspectorConsoleAgent.cpp:193
>> +        int index = message.find(": ");
> 
> size_t

WTF::STring::find has int return value and may return -1.
Comment 11 Sergey Ryazanov 2013-03-25 08:00:47 PDT
Created attachment 194858 [details]
Patch
Comment 12 Pavel Feldman 2013-03-25 08:27:39 PDT
Comment on attachment 194858 [details]
Patch

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

> Source/WebCore/inspector/InspectorConsoleAgent.cpp:194
> +        if (index >= 0 && static_cast<int>(message.length()) > index + 1 && message[index + 2] == '*')

Even when message.length() > index + 1, it does not mean message[index + 2] is within range. Isn't it all just find(": *")?
Comment 13 Sergey Ryazanov 2013-03-25 08:45:17 PDT
Created attachment 194866 [details]
Patch
Comment 14 WebKit Review Bot 2013-03-25 09:31:02 PDT
Comment on attachment 194866 [details]
Patch

Clearing flags on attachment: 194866

Committed r146781: <http://trac.webkit.org/changeset/146781>
Comment 15 WebKit Review Bot 2013-03-25 09:31:06 PDT
All reviewed patches have been landed.  Closing bug.
Comment 16 PhistucK 2013-03-26 03:55:00 PDT
How about adding an option to enable all logging?
We should encourage removing hacks, too.
Comment 17 Pavel Feldman 2013-03-26 04:42:24 PDT
(In reply to comment #16)
> How about adding an option to enable all logging?
> We should encourage removing hacks, too.

Sure. This is a short term fix. The real one is to make it logged with verbose severity + filter it out on backend by default. Stay tuned.
Comment 18 PhistucK 2013-03-26 05:14:01 PDT
(In reply to comment #17)
> (In reply to comment #16)
> > How about adding an option to enable all logging?
> > We should encourage removing hacks, too.
> 
> Sure. This is a short term fix. The real one is to make it logged with verbose severity + filter it out on backend by default. Stay tuned.

I say "Yay!". :)