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

Unified Diff: Source/core/css/CSSParserValues.h

Issue 17176013: Do not report some CSS errors for code valid in other browsers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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
Index: Source/core/css/CSSParserValues.h
diff --git a/Source/core/css/CSSParserValues.h b/Source/core/css/CSSParserValues.h
index 79888d6cab00c134f090c66829fac7dc4483d960..a03ca5c16fc5ab826715537e3c1fa33dd319defe 100644
--- a/Source/core/css/CSSParserValues.h
+++ b/Source/core/css/CSSParserValues.h
@@ -101,14 +101,20 @@ struct CSSParserString {
template <size_t strLength>
bool startsWithIgnoringCase(const char (&str)[strLength]) const
{
- return startsWithIgnoringCase(str, strLength - 1);
+ return containsIgnoringCaseAt(str, strLength - 1, 0);
}
- bool startsWithIgnoringCase(const char* str, size_t strLength) const
+ template <size_t strLength>
+ bool containsIgnoringCaseAt(const char (&str)[strLength], unsigned offset) const
+ {
+ return containsIgnoringCaseAt(str, strLength - 1, offset);
+ }
+
+ bool containsIgnoringCaseAt(const char* str, size_t strLength, unsigned offset) const
{
- if (length() < strLength)
+ if (length() < strLength + offset)
return false;
- return is8Bit() ? WTF::equalIgnoringCase(str, characters8(), strLength) : WTF::equalIgnoringCase(str, characters16(), strLength);
+ return is8Bit() ? WTF::equalIgnoringCase(str, characters8() + offset, strLength) : WTF::equalIgnoringCase(str, characters16() + offset, strLength);
}
operator String() const { return is8Bit() ? String(m_data.characters8, m_length) : String(m_data.characters16, m_length); }

Powered by Google App Engine
This is Rietveld 408576698