[CSS] -webkit-var prefix is case-sensitive
Created attachment 202987 [details] Patch
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?
Why is -webkit-var case sensitive when other things in CSS are not? Could you point to the specification that says it should be?
Created attachment 203003 [details] Patch
(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
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.
Committed r150776: <http://trac.webkit.org/changeset/150776>