OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/svg/SVGParsingError.h" | 5 #include "core/svg/SVGParsingError.h" |
6 | 6 |
7 #include "core/dom/QualifiedName.h" | 7 #include "core/dom/QualifiedName.h" |
8 #include "platform/JSONValues.h" | 8 #include "platform/JSONValues.h" |
9 #include "wtf/text/CharacterNames.h" | 9 #include "wtf/text/CharacterNames.h" |
10 #include "wtf/text/StringBuilder.h" | 10 #include "wtf/text/StringBuilder.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 builder.append(tagName); | 21 builder.append(tagName); |
22 builder.appendLiteral("> attribute "); | 22 builder.appendLiteral("> attribute "); |
23 builder.append(name.toString()); | 23 builder.append(name.toString()); |
24 } | 24 } |
25 | 25 |
26 std::pair<const char*, const char*> messageForStatus(SVGParseStatus status) | 26 std::pair<const char*, const char*> messageForStatus(SVGParseStatus status) |
27 { | 27 { |
28 switch (status) { | 28 switch (status) { |
29 case SVGParseStatus::TrailingGarbage: | 29 case SVGParseStatus::TrailingGarbage: |
30 return std::make_pair("Trailing garbage, ", "."); | 30 return std::make_pair("Trailing garbage, ", "."); |
| 31 case SVGParseStatus::ExpectedArcFlag: |
| 32 return std::make_pair("Expected arc flag ('0' or '1'), ", "."); |
31 case SVGParseStatus::ExpectedBoolean: | 33 case SVGParseStatus::ExpectedBoolean: |
32 return std::make_pair("Expected 'true' or 'false', ", "."); | 34 return std::make_pair("Expected 'true' or 'false', ", "."); |
33 case SVGParseStatus::ExpectedEnumeration: | 35 case SVGParseStatus::ExpectedEnumeration: |
34 return std::make_pair("Unrecognized enumerated value, ", "."); | 36 return std::make_pair("Unrecognized enumerated value, ", "."); |
35 case SVGParseStatus::ExpectedLength: | 37 case SVGParseStatus::ExpectedLength: |
36 return std::make_pair("Expected length, ", "."); | 38 return std::make_pair("Expected length, ", "."); |
| 39 case SVGParseStatus::ExpectedMoveToCommand: |
| 40 return std::make_pair("Expected moveto path command ('M' or 'm'), ", "."
); |
37 case SVGParseStatus::ExpectedNumber: | 41 case SVGParseStatus::ExpectedNumber: |
38 return std::make_pair("Expected number, ", "."); | 42 return std::make_pair("Expected number, ", "."); |
| 43 case SVGParseStatus::ExpectedPathCommand: |
| 44 return std::make_pair("Expected path command, ", "."); |
39 case SVGParseStatus::NegativeValue: | 45 case SVGParseStatus::NegativeValue: |
40 return std::make_pair("A negative value is not valid. (", ")"); | 46 return std::make_pair("A negative value is not valid. (", ")"); |
41 case SVGParseStatus::ParsingFailed: | 47 case SVGParseStatus::ParsingFailed: |
42 default: | 48 default: |
43 ASSERT_NOT_REACHED(); | 49 ASSERT_NOT_REACHED(); |
44 break; | 50 break; |
45 } | 51 } |
46 return std::make_pair("", ""); | 52 return std::make_pair("", ""); |
47 } | 53 } |
48 | 54 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 106 |
101 auto message = messageForStatus(status()); | 107 auto message = messageForStatus(status()); |
102 builder.append(message.first); | 108 builder.append(message.first); |
103 appendValue(builder, *this, value); | 109 appendValue(builder, *this, value); |
104 builder.append(message.second); | 110 builder.append(message.second); |
105 } | 111 } |
106 return builder.toString(); | 112 return builder.toString(); |
107 } | 113 } |
108 | 114 |
109 } // namespace blink | 115 } // namespace blink |
OLD | NEW |