Bug 137620 - Web Inspector: Poor CSS warning message with missing spaces in calc() +/- operation
Summary: Web Inspector: Poor CSS warning message with missing spaces in calc() +/- ope...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-10-10 11:55 PDT by Joseph Pecoraro
Modified: 2016-12-13 15:36 PST (History)
4 users (show)

See Also:


Attachments
[TEST] Reduction (61 bytes, text/html)
2014-10-10 11:57 PDT, Joseph Pecoraro
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.