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

Unified Diff: Source/core/html/parser/HTMLParserIdioms.h

Issue 293423002: Refactor srcset parser to align it with spec changes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed ASSERT Created 6 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 | « Source/core/html/HTMLImageElement.cpp ('k') | Source/core/html/parser/HTMLSrcsetParser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLParserIdioms.h
diff --git a/Source/core/html/parser/HTMLParserIdioms.h b/Source/core/html/parser/HTMLParserIdioms.h
index cd4fa9c11d4df6946ba5d5b34aec3d9cdc300d9c..d5ab2899638cb3e85f2db1c628e615d1466b947d 100644
--- a/Source/core/html/parser/HTMLParserIdioms.h
+++ b/Source/core/html/parser/HTMLParserIdioms.h
@@ -36,11 +36,6 @@ class TextEncoding;
namespace WebCore {
-// Space characters as defined by the HTML specification.
-bool isHTMLSpace(UChar);
-bool isHTMLLineBreak(UChar);
-bool isNotHTMLSpace(UChar);
-
// Strip leading and trailing whitespace as defined by the HTML specification.
String stripLeadingAndTrailingHTMLSpaces(const String&);
template<size_t inlineCapacity>
@@ -69,8 +64,7 @@ typedef Vector<pair<String, String> > HTMLAttributeList;
// The returned encoding might not be valid.
WTF::TextEncoding encodingFromMetaAttributes(const HTMLAttributeList&);
-// Inline implementations of some of the functions declared above.
-
+// Space characters as defined by the HTML specification.
template<typename CharType>
inline bool isHTMLSpace(CharType character)
{
@@ -88,9 +82,15 @@ inline bool isHTMLSpace(CharType character)
}
template<typename CharType>
+inline bool isComma(CharType character)
+{
+ return character == ',';
+}
+
+template<typename CharType>
inline bool isHTMLSpaceOrComma(CharType character)
{
- return isHTMLSpace<CharType>(character) || character == ',';
+ return isComma(character) || isHTMLSpace(character);
}
inline bool isHTMLLineBreak(UChar character)
« no previous file with comments | « Source/core/html/HTMLImageElement.cpp ('k') | Source/core/html/parser/HTMLSrcsetParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698