Index: third_party/WebKit/Source/core/css/parser/CSSParserIdioms.h |
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserIdioms.h b/third_party/WebKit/Source/core/css/parser/CSSParserIdioms.h |
index b9ad905cbf7855c69a85f8d7cfa7567857c5b2b9..5e2f4e5ce925d97f79bf5b143631b4b917a114f5 100644 |
--- a/third_party/WebKit/Source/core/css/parser/CSSParserIdioms.h |
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserIdioms.h |
@@ -42,6 +42,24 @@ inline bool isCSSSpace(UChar c) |
return c == ' ' || c == '\t' || c == '\n'; |
} |
+// http://dev.w3.org/csswg/css-syntax/#name-start-code-point |
+template <typename CharacterType> |
+bool isNameStartCodePoint(CharacterType c) |
+{ |
+ if (isASCIIAlpha(c)) |
Timothy Loh
2016/04/20 04:31:11
maybe for consistency with the other two functions
rwlbuis
2016/04/20 11:18:48
Good idea, will fix before landing.
|
+ return true; |
+ if (c == '_') |
+ return true; |
+ return !isASCII(c); |
+} |
+ |
+// http://dev.w3.org/csswg/css-syntax/#name-code-point |
+template <typename CharacterType> |
+bool isNameCodePoint(CharacterType c) |
+{ |
+ return isNameStartCodePoint(c) || isASCIIDigit(c) || c == '-'; |
+} |
+ |
} |
#endif |