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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGParserUtilities.h

Issue 1527993002: Tidy up SVGParserUtilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Extra math for Android. Created 5 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2002, 2003 The Karbon Developers 2 * Copyright (C) 2002, 2003 The Karbon Developers
3 * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2013 Apple Inc. All rights reserved. 4 * Copyright (C) 2013 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
11 * This library is distributed in the hope that it will be useful, 11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details. 14 * Library General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Library General Public License 16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to 17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA. 19 * Boston, MA 02110-1301, USA.
20 */ 20 */
21 21
22 #ifndef SVGParserUtilities_h 22 #ifndef SVGParserUtilities_h
23 #define SVGParserUtilities_h 23 #define SVGParserUtilities_h
24 24
25 #include "core/html/parser/HTMLParserIdioms.h" 25 #include "core/html/parser/HTMLParserIdioms.h"
26 #include "core/svg/SVGTransform.h"
27 #include "platform/text/ParserUtilities.h"
28 #include "wtf/HashSet.h"
29
30 typedef std::pair<unsigned, unsigned> UnicodeRange;
31 typedef Vector<UnicodeRange> UnicodeRanges;
32 26
33 namespace blink { 27 namespace blink {
34 28
35 class FloatPoint;
36
37 enum WhitespaceMode { 29 enum WhitespaceMode {
38 DisallowWhitespace = 0, 30 DisallowWhitespace = 0,
39 AllowLeadingWhitespace = 0x1, 31 AllowLeadingWhitespace = 0x1,
40 AllowTrailingWhitespace = 0x2, 32 AllowTrailingWhitespace = 0x2,
41 AllowLeadingAndTrailingWhitespace = AllowLeadingWhitespace | AllowTrailingWh itespace 33 AllowLeadingAndTrailingWhitespace = AllowLeadingWhitespace | AllowTrailingWh itespace
42 }; 34 };
43 35
44 bool parseNumber(const LChar*& ptr, const LChar* end, float& number, WhitespaceM ode = AllowLeadingAndTrailingWhitespace); 36 bool parseNumber(const LChar*& ptr, const LChar* end, float& number, WhitespaceM ode = AllowLeadingAndTrailingWhitespace);
45 bool parseNumber(const UChar*& ptr, const UChar* end, float& number, WhitespaceM ode = AllowLeadingAndTrailingWhitespace); 37 bool parseNumber(const UChar*& ptr, const UChar* end, float& number, WhitespaceM ode = AllowLeadingAndTrailingWhitespace);
46 bool parseNumberOptionalNumber(const String& s, float& h, float& v); 38 bool parseNumberOptionalNumber(const String& s, float& h, float& v);
(...skipping 16 matching lines...) Expand all
63 return false; 55 return false;
64 if (skipOptionalSVGSpaces(ptr, end)) { 56 if (skipOptionalSVGSpaces(ptr, end)) {
65 if (ptr < end && *ptr == delimiter) { 57 if (ptr < end && *ptr == delimiter) {
66 ptr++; 58 ptr++;
67 skipOptionalSVGSpaces(ptr, end); 59 skipOptionalSVGSpaces(ptr, end);
68 } 60 }
69 } 61 }
70 return ptr < end; 62 return ptr < end;
71 } 63 }
72 64
73 template<typename CharType>
74 bool parseAndSkipTransformType(const CharType*& ptr, const CharType* end, SVGTra nsformType&);
75 SVGTransformType parseTransformType(const String&);
76
77 } // namespace blink 65 } // namespace blink
78 66
79 #endif // SVGParserUtilities_h 67 #endif // SVGParserUtilities_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698