Index: third_party/WebKit/Source/core/svg/SVGViewSpec.cpp |
diff --git a/third_party/WebKit/Source/core/svg/SVGViewSpec.cpp b/third_party/WebKit/Source/core/svg/SVGViewSpec.cpp |
index 353a8663158afe39d57410f8823e627f37e779aa..6bfbb2fa8a60f40cec8744ce9ad35491776b5b76 100644 |
--- a/third_party/WebKit/Source/core/svg/SVGViewSpec.cpp |
+++ b/third_party/WebKit/Source/core/svg/SVGViewSpec.cpp |
@@ -25,7 +25,7 @@ |
#include "core/dom/ExceptionCode.h" |
#include "core/svg/SVGAnimatedTransformList.h" |
#include "core/svg/SVGParserUtilities.h" |
-#include "platform/text/ParserUtilities.h" |
+#include "platform/ParsingUtilities.h" |
namespace blink { |
@@ -132,17 +132,10 @@ void SVGViewSpec::setZoomAndPan(unsigned short, ExceptionState& exceptionState) |
exceptionState.throwDOMException(NoModificationAllowedError, ExceptionMessages::readOnly()); |
} |
-static const LChar svgViewSpec[] = {'s', 'v', 'g', 'V', 'i', 'e', 'w'}; |
-static const LChar viewBoxSpec[] = {'v', 'i', 'e', 'w', 'B', 'o', 'x'}; |
-static const LChar preserveAspectRatioSpec[] = {'p', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'A', 's', 'p', 'e', 'c', 't', 'R', 'a', 't', 'i', 'o'}; |
-static const LChar transformSpec[] = {'t', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm'}; |
-static const LChar zoomAndPanSpec[] = {'z', 'o', 'o', 'm', 'A', 'n', 'd', 'P', 'a', 'n'}; |
-static const LChar viewTargetSpec[] = {'v', 'i', 'e', 'w', 'T', 'a', 'r', 'g', 'e', 't'}; |
- |
template<typename CharType> |
bool SVGViewSpec::parseViewSpecInternal(const CharType* ptr, const CharType* end) |
{ |
- if (!skipString(ptr, end, svgViewSpec, WTF_ARRAY_LENGTH(svgViewSpec))) |
+ if (!skipToken(ptr, end, "svgView")) |
return false; |
if (ptr >= end || *ptr != '(') |
@@ -151,7 +144,7 @@ bool SVGViewSpec::parseViewSpecInternal(const CharType* ptr, const CharType* end |
while (ptr < end && *ptr != ')') { |
if (*ptr == 'v') { |
- if (skipString(ptr, end, viewBoxSpec, WTF_ARRAY_LENGTH(viewBoxSpec))) { |
+ if (skipToken(ptr, end, "viewBox")) { |
if (ptr >= end || *ptr != '(') |
return false; |
ptr++; |
@@ -165,7 +158,7 @@ bool SVGViewSpec::parseViewSpecInternal(const CharType* ptr, const CharType* end |
if (ptr >= end || *ptr != ')') |
return false; |
ptr++; |
- } else if (skipString(ptr, end, viewTargetSpec, WTF_ARRAY_LENGTH(viewTargetSpec))) { |
+ } else if (skipToken(ptr, end, "viewTarget")) { |
if (ptr >= end || *ptr != '(') |
return false; |
const CharType* viewTargetStart = ++ptr; |
@@ -178,7 +171,7 @@ bool SVGViewSpec::parseViewSpecInternal(const CharType* ptr, const CharType* end |
} else |
return false; |
} else if (*ptr == 'z') { |
- if (!skipString(ptr, end, zoomAndPanSpec, WTF_ARRAY_LENGTH(zoomAndPanSpec))) |
+ if (!skipToken(ptr, end, "zoomAndPan")) |
return false; |
if (ptr >= end || *ptr != '(') |
return false; |
@@ -189,7 +182,7 @@ bool SVGViewSpec::parseViewSpecInternal(const CharType* ptr, const CharType* end |
return false; |
ptr++; |
} else if (*ptr == 'p') { |
- if (!skipString(ptr, end, preserveAspectRatioSpec, WTF_ARRAY_LENGTH(preserveAspectRatioSpec))) |
+ if (!skipToken(ptr, end, "preserveAspectRatio")) |
return false; |
if (ptr >= end || *ptr != '(') |
return false; |
@@ -200,7 +193,7 @@ bool SVGViewSpec::parseViewSpecInternal(const CharType* ptr, const CharType* end |
return false; |
ptr++; |
} else if (*ptr == 't') { |
- if (!skipString(ptr, end, transformSpec, WTF_ARRAY_LENGTH(transformSpec))) |
+ if (!skipToken(ptr, end, "transform")) |
return false; |
if (ptr >= end || *ptr != '(') |
return false; |