Bug 115802 - Allow blank spaces before colon (:) on CSS variable definition
Summary: Allow blank spaces before colon (:) on CSS variable definition
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sergio Villar Senin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-08 07:21 PDT by Sergio Villar Senin
Modified: 2013-05-08 08:18 PDT (History)
9 users (show)

See Also:


Attachments
Patch (3.53 KB, patch)
2013-05-08 07:25 PDT, Sergio Villar Senin
no flags Details | Formatted Diff | Diff
Patch (3.53 KB, patch)
2013-05-08 07:27 PDT, Sergio Villar Senin
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Villar Senin 2013-05-08 07:21:08 PDT
Something like:

  :root {
      -webkit-var-mycolor : red;
  }

won't define a new CSS variable "mycolor" because there is a space before the colon.
Comment 1 Sergio Villar Senin 2013-05-08 07:25:52 PDT
Created attachment 201071 [details]
Patch
Comment 2 Sergio Villar Senin 2013-05-08 07:27:04 PDT
Created attachment 201072 [details]
Patch
Comment 3 Darin Adler 2013-05-08 07:30:18 PDT
Comment on attachment 201072 [details]
Patch

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

r=me, but please do this without adding a new production

> Source/WebCore/css/CSSGrammar.y.in:1623
> -    VAR_DEFINITION ':' maybe_space expr prio {
> +    var_definition ':' maybe_space expr prio {
>  #if ENABLE_CSS_VARIABLES
>          parser->storeVariableDeclaration($1, parser->sinkFloatingValueList($4), $5);
>          $$ = true;

It’s unnecessary to add a new production for this. Instead you should just add the maybe_space to this production, and change $4 to $5 and $5 to $6.
Comment 4 Sergio Villar Senin 2013-05-08 08:18:37 PDT
Committed r149740: <http://trac.webkit.org/changeset/149740>