RESOLVED FIXED 116829
[CSS] -webkit-var prefix is case-sensitive
https://bugs.webkit.org/show_bug.cgi?id=116829
Summary [CSS] -webkit-var prefix is case-sensitive
Claudio Saavedra
Reported 2013-05-27 08:20:39 PDT
[CSS] -webkit-var prefix is case-sensitive
Attachments
Patch (3.66 KB, patch)
2013-05-27 08:25 PDT, Claudio Saavedra
no flags
Patch (4.44 KB, patch)
2013-05-27 12:43 PDT, Claudio Saavedra
darin: review+
Claudio Saavedra
Comment 1 2013-05-27 08:25:55 PDT
Sergio Villar Senin
Comment 2 2013-05-27 09:28:18 PDT
Comment on attachment 202987 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=202987&action=review The fix looks sane to me, just some minor comments. > Source/WebCore/css/CSSParser.cpp:9866 > + do { The first assert of the case insensitive version still applies here, not sure if adding it pays off though as this is only used by the CSS custom properties stuff. > Source/WebCore/css/CSSParser.cpp:9867 > + if ((*string++) != (*constantString++)) I guess you can omit the parentheses here > LayoutTests/fast/css/variables/case-sensitive.html:11 > + -WEBKIT-VAR-padding: 200px; What about adding something like "with no left padding" to the <p> in order to better explain test results?
Darin Adler
Comment 3 2013-05-27 12:32:56 PDT
Why is -webkit-var case sensitive when other things in CSS are not? Could you point to the specification that says it should be?
Claudio Saavedra
Comment 4 2013-05-27 12:43:34 PDT
Claudio Saavedra
Comment 5 2013-05-27 12:45:18 PDT
(In reply to comment #3) > Why is -webkit-var case sensitive when other things in CSS are not? Could you point to the specification that says it should be? "Unlike other CSS properties, custom property names are case-sensitive. The "var-" prefix must be written in lower-case. For example, VAR-FOO is invalid, because the prefix isn't "var-". While both var-foo and var-FOO are valid, they are distinct properties - using var(foo) will refer to the first one, while using var(FOO) will refer to the second." http://dev.w3.org/csswg/css-variables/#defining-variables
Darin Adler
Comment 6 2013-05-27 13:06:02 PDT
Comment on attachment 203003 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=203003&action=review > Source/WebCore/css/CSSParser.cpp:9867 > + ASSERT((*constantString >= 'a' && *constantString <= 'z') || *constantString == '-'); There is no reason to have this assertion. I know the previous reviewer suggested you add it. But the assertion above is there because it’s a precondition to calling toASCIILowerUnchecked. There’s no corresponding issue here and no need for the assertion.
Claudio Saavedra
Comment 7 2013-05-27 13:58:49 PDT
Note You need to log in before you can comment on or make changes to this bug.