Bug 137620

Summary: Web Inspector: Poor CSS warning message with missing spaces in calc() +/- operation
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: benjamin, graouts, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[TEST] Reduction none

Description Joseph Pecoraro 2014-10-10 11:55:12 PDT
* TEST
div {
    background-size: calc(50%+1px);
}

* UNEXPECTED WARNING
[Warning] Unexpected CSS token: ) (style.css, line 2)
Comment 1 Radar WebKit Bug Importer 2014-10-10 11:55:34 PDT
<rdar://problem/18613467>
Comment 2 Joseph Pecoraro 2014-10-10 11:57:29 PDT
Err, I think this comes from the CSS parser (CSSParser::syntaxError).
Comment 3 Joseph Pecoraro 2014-10-10 11:57:43 PDT
Created attachment 239640 [details]
[TEST] Reduction
Comment 4 Joseph Pecoraro 2014-10-10 12:13:08 PDT
Heck, just calc(50px) emits the warning.
Comment 5 Joseph Pecoraro 2014-10-10 13:15:56 PDT
(In reply to comment #4)
> Heck, just calc(50px) emits the warning.

Nevermind, this seemed to work fine.
Comment 6 Joseph Pecoraro 2014-10-10 13:18:58 PDT
Seems like this may be an issue with operators!

    background-size: calc(50% +1px); /* warning */
    background-size: calc(50% + 1px); /* okay */
Comment 7 Joseph Pecoraro 2014-10-10 13:21:30 PDT
(In reply to comment #6)
> Seems like this may be an issue with operators!
> 
>     background-size: calc(50% +1px); /* warning */
>     background-size: calc(50% + 1px); /* okay */

Well, this may be behaves correctly:

/*
 * The grammar requires spaces around binary ‘+’ and ‘-’ operators.
 * The '*' and '/' operators do not require spaces.
 * http://www.w3.org/TR/css3-values/#calc-syntax
 */

I'm going to leave this bug open, as we should have a better warning in this case.