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

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

Issue 1642463004: Extended error reporting for SVG path parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "path flag" -> "arc flag" Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details. 13 * Library General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU Library General Public License 15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to 16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA. 18 * Boston, MA 02110-1301, USA.
19 */ 19 */
20 20
21 #ifndef SVGPathStringSource_h 21 #ifndef SVGPathStringSource_h
22 #define SVGPathStringSource_h 22 #define SVGPathStringSource_h
23 23
24 #include "core/CoreExport.h" 24 #include "core/CoreExport.h"
25 #include "core/svg/SVGParsingError.h"
25 #include "core/svg/SVGPathSource.h" 26 #include "core/svg/SVGPathSource.h"
26 #include "wtf/text/WTFString.h" 27 #include "wtf/text/WTFString.h"
27 28
28 namespace blink { 29 namespace blink {
29 30
30 class CORE_EXPORT SVGPathStringSource final : public SVGPathSource { 31 class CORE_EXPORT SVGPathStringSource final : public SVGPathSource {
31 public: 32 public:
32 explicit SVGPathStringSource(const String&); 33 explicit SVGPathStringSource(const String&);
33 34
35 SVGParsingError parseError() const { return m_error; }
36
34 private: 37 private:
35 bool hasMoreData() const override; 38 bool hasMoreData() const override;
36 SVGPathSegType peekSegmentType() override; 39 SVGPathSegType peekSegmentType() override;
37 PathSegmentData parseSegment() override; 40 PathSegmentData parseSegment() override;
38 41
39 void eatWhitespace(); 42 void eatWhitespace();
40 float parseNumberWithError(); 43 float parseNumberWithError();
41 bool parseArcFlagWithError(); 44 bool parseArcFlagWithError();
45 void setErrorMark(SVGParseStatus);
42 46
43 String m_string;
44 bool m_is8BitSource; 47 bool m_is8BitSource;
45 bool m_seenError;
46 48
47 union { 49 union {
48 const LChar* m_character8; 50 const LChar* m_character8;
49 const UChar* m_character16; 51 const UChar* m_character16;
50 } m_current; 52 } m_current;
51 union { 53 union {
52 const LChar* m_character8; 54 const LChar* m_character8;
53 const UChar* m_character16; 55 const UChar* m_character16;
54 } m_end; 56 } m_end;
55 57
56 SVGPathSegType m_previousCommand; 58 SVGPathSegType m_previousCommand;
59 SVGParsingError m_error;
60 String m_string;
57 }; 61 };
58 62
59 } // namespace blink 63 } // namespace blink
60 64
61 #endif // SVGPathStringSource_h 65 #endif // SVGPathStringSource_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPathParserTest.cpp ('k') | third_party/WebKit/Source/core/svg/SVGPathStringSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698