Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(418)

Unified Diff: Source/core/css/CSSParser.cpp

Issue 16081003: [CSS] -webkit-var must be case sensitive according to specs (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/css/variables/case-sensitive-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSParser.cpp
diff --git a/Source/core/css/CSSParser.cpp b/Source/core/css/CSSParser.cpp
index 1a3dedcc7d8134eb11b45028a266a09274da0037..be417b95aafbdbb2bacb7dc1dba219a055bc7135 100644
--- a/Source/core/css/CSSParser.cpp
+++ b/Source/core/css/CSSParser.cpp
@@ -9341,6 +9341,16 @@ static inline bool isEqualToCSSIdentifier(CharacterType* cssString, const char*
}
template <typename CharacterType>
+static inline bool isEqualToCSSCaseSensitiveIdentifier(CharacterType* string, const char* constantString)
+{
alancutter (OOO until 2018) 2013/05/29 13:19:44 I would add an ASSERT(*constantString) here lest t
+ do {
+ if (*string++ != *constantString++)
+ return false;
+ } while (*constantString);
+ return true;
+}
+
+template <typename CharacterType>
static CharacterType* checkAndSkipEscape(CharacterType* currentCharacter)
{
// Returns with 0, if escape check is failed. Otherwise
@@ -10258,7 +10268,7 @@ inline bool CSSParser::detectCSSVariablesToken(int length)
if (length < sizeof("-webkit-var-*") - 1)
return false;
CharacterType* name = tokenStart<CharacterType>();
- return name[11] == '-' && isIdentifierStartAfterDash(name + 12) && isEqualToCSSIdentifier(name + 1, "webkit-var");
+ return name[11] == '-' && isIdentifierStartAfterDash(name + 12) && isEqualToCSSCaseSensitiveIdentifier(name + 1, "webkit-var");
}
« no previous file with comments | « LayoutTests/fast/css/variables/case-sensitive-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698