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

Unified Diff: third_party/WebKit/Source/core/svg/SVGParserUtilities.cpp

Issue 1667353003: Error reporting for number-or-percentage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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: third_party/WebKit/Source/core/svg/SVGParserUtilities.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGParserUtilities.cpp b/third_party/WebKit/Source/core/svg/SVGParserUtilities.cpp
index 1cab017b16943c11c88de6d571b3c555f71aca62..0f0ecaf0dbcc64253765de8b73153d1b33f69b23 100644
--- a/third_party/WebKit/Source/core/svg/SVGParserUtilities.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGParserUtilities.cpp
@@ -214,41 +214,4 @@ bool parseNumberOptionalNumber(const String& string, float& x, float& y)
return genericParseNumberOptionalNumber(ptr, end, x, y);
}
-template<typename CharType>
-bool genericParseNumberOrPercentage(const CharType*& ptr, const CharType* end, float& number)
-{
- if (genericParseNumber(ptr, end, number, AllowLeadingWhitespace)) {
- if (ptr == end)
- return true;
-
- bool isPercentage = (*ptr == '%');
- if (isPercentage)
- ptr++;
-
- skipOptionalSVGSpaces(ptr, end);
-
- if (isPercentage)
- number /= 100.f;
-
- return ptr == end;
- }
-
- return false;
-}
-
-bool parseNumberOrPercentage(const String& string, float& number)
-{
- if (string.isEmpty())
- return false;
-
- if (string.is8Bit()) {
- const LChar* ptr = string.characters8();
- const LChar* end = ptr + string.length();
- return genericParseNumberOrPercentage(ptr, end, number);
- }
- const UChar* ptr = string.characters16();
- const UChar* end = ptr + string.length();
- return genericParseNumberOrPercentage(ptr, end, number);
-}
-
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGParserUtilities.h ('k') | third_party/WebKit/Source/core/svg/SVGParsingError.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698