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

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

Issue 2179563002: Revert of Remove platform/text/ParserUtilities.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/SVGTransformList.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGTransformList.cpp b/third_party/WebKit/Source/core/svg/SVGTransformList.cpp
index a1c17fc2763364034e777ffb89318dad6edec5d1..32ac2b1a4f673f252a44fa02c7f1afacb3b3c1c1 100644
--- a/third_party/WebKit/Source/core/svg/SVGTransformList.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGTransformList.cpp
@@ -26,7 +26,7 @@
#include "core/SVGNames.h"
#include "core/svg/SVGParserUtilities.h"
#include "core/svg/SVGTransformDistance.h"
-#include "platform/ParsingUtilities.h"
+#include "platform/text/ParserUtilities.h"
#include "wtf/text/StringBuilder.h"
#include "wtf/text/WTFString.h"
@@ -64,6 +64,13 @@
namespace {
+const LChar skewXDesc[] = {'s', 'k', 'e', 'w', 'X'};
+const LChar skewYDesc[] = {'s', 'k', 'e', 'w', 'Y'};
+const LChar scaleDesc[] = {'s', 'c', 'a', 'l', 'e'};
+const LChar translateDesc[] = {'t', 'r', 'a', 'n', 's', 'l', 'a', 't', 'e'};
+const LChar rotateDesc[] = {'r', 'o', 't', 'a', 't', 'e'};
+const LChar matrixDesc[] = {'m', 'a', 't', 'r', 'i', 'x'};
+
template<typename CharType>
SVGTransformType parseAndSkipTransformType(const CharType*& ptr, const CharType* end)
{
@@ -71,20 +78,20 @@
return SVG_TRANSFORM_UNKNOWN;
if (*ptr == 's') {
- if (skipToken(ptr, end, "skewX"))
+ if (skipString(ptr, end, skewXDesc, WTF_ARRAY_LENGTH(skewXDesc)))
return SVG_TRANSFORM_SKEWX;
- if (skipToken(ptr, end, "skewY"))
+ if (skipString(ptr, end, skewYDesc, WTF_ARRAY_LENGTH(skewYDesc)))
return SVG_TRANSFORM_SKEWY;
- if (skipToken(ptr, end, "scale"))
+ if (skipString(ptr, end, scaleDesc, WTF_ARRAY_LENGTH(scaleDesc)))
return SVG_TRANSFORM_SCALE;
return SVG_TRANSFORM_UNKNOWN;
}
- if (skipToken(ptr, end, "translate"))
+ if (skipString(ptr, end, translateDesc, WTF_ARRAY_LENGTH(translateDesc)))
return SVG_TRANSFORM_TRANSLATE;
- if (skipToken(ptr, end, "rotate"))
+ if (skipString(ptr, end, rotateDesc, WTF_ARRAY_LENGTH(rotateDesc)))
return SVG_TRANSFORM_ROTATE;
- if (skipToken(ptr, end, "matrix"))
+ if (skipString(ptr, end, matrixDesc, WTF_ARRAY_LENGTH(matrixDesc)))
return SVG_TRANSFORM_MATRIX;
return SVG_TRANSFORM_UNKNOWN;
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.cpp ('k') | third_party/WebKit/Source/core/svg/SVGViewSpec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698