Index: Source/core/html/parser/HTMLParserIdioms.h |
diff --git a/Source/core/html/parser/HTMLParserIdioms.h b/Source/core/html/parser/HTMLParserIdioms.h |
index 68c7ded17985dfa94a42bba0132c8fdb1b417210..8be23681fad4789b8fba1b5f0e15602ccd029eac 100644 |
--- a/Source/core/html/parser/HTMLParserIdioms.h |
+++ b/Source/core/html/parser/HTMLParserIdioms.h |
@@ -67,7 +67,8 @@ bool parseHTMLNonNegativeInteger(const String&, unsigned int&); |
// Inline implementations of some of the functions declared above. |
-inline bool isHTMLSpace(UChar character) |
+template<typename CharType> |
+inline bool isHTMLSpace(CharType character) |
{ |
// Histogram from Apple's page load test combined with some ad hoc browsing some other test suites. |
// |
@@ -82,6 +83,17 @@ inline bool isHTMLSpace(UChar character) |
return character <= ' ' && (character == ' ' || character == '\n' || character == '\t' || character == '\r' || character == '\f'); |
} |
+inline bool isHTMLSpace(UChar character) |
+{ |
+ return isHTMLSpace<UChar>(character); |
+} |
abarth-chromium
2013/09/19 18:09:52
Why is this needed?
|
+ |
+template<typename CharType> |
+inline bool isHTMLSpaceOrComma(CharType character) |
+{ |
+ return isHTMLSpace(character) || character == ','; |
+} |
+ |
inline bool isHTMLLineBreak(UChar character) |
{ |
return character <= '\r' && (character == '\n' || character == '\r'); |
@@ -89,7 +101,13 @@ inline bool isHTMLLineBreak(UChar character) |
inline bool isNotHTMLSpace(UChar character) |
{ |
- return !isHTMLSpace(character); |
+ return !isHTMLSpace<UChar>(character); |
+} |
abarth-chromium
2013/09/19 18:09:52
Why do you need these concrete specializations?
Yoav Weiss
2013/09/20 04:54:27
I've added that to avoid changing the calls to isH
abarth-chromium
2013/09/20 16:08:07
Most of the callers should be able to infer the ty
|
+ |
+template<typename CharType> |
+inline bool isNotHTMLSpace(CharType character) |
+{ |
+ return !isHTMLSpace<CharType>(character); |
} |
bool threadSafeMatch(const QualifiedName&, const QualifiedName&); |