| 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::ExpectedAngle: |
| 32 return std::make_pair("Expected angle, ", "."); |
| 31 case SVGParseStatus::ExpectedArcFlag: | 33 case SVGParseStatus::ExpectedArcFlag: |
| 32 return std::make_pair("Expected arc flag ('0' or '1'), ", "."); | 34 return std::make_pair("Expected arc flag ('0' or '1'), ", "."); |
| 33 case SVGParseStatus::ExpectedBoolean: | 35 case SVGParseStatus::ExpectedBoolean: |
| 34 return std::make_pair("Expected 'true' or 'false', ", "."); | 36 return std::make_pair("Expected 'true' or 'false', ", "."); |
| 35 case SVGParseStatus::ExpectedEndOfArguments: | 37 case SVGParseStatus::ExpectedEndOfArguments: |
| 36 return std::make_pair("Expected ')', ", "."); | 38 return std::make_pair("Expected ')', ", "."); |
| 37 case SVGParseStatus::ExpectedEnumeration: | 39 case SVGParseStatus::ExpectedEnumeration: |
| 38 return std::make_pair("Unrecognized enumerated value, ", "."); | 40 return std::make_pair("Unrecognized enumerated value, ", "."); |
| 39 case SVGParseStatus::ExpectedInteger: | 41 case SVGParseStatus::ExpectedInteger: |
| 40 return std::make_pair("Expected integer, ", "."); | 42 return std::make_pair("Expected integer, ", "."); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 119 |
| 118 auto message = messageForStatus(status()); | 120 auto message = messageForStatus(status()); |
| 119 builder.append(message.first); | 121 builder.append(message.first); |
| 120 appendValue(builder, *this, value); | 122 appendValue(builder, *this, value); |
| 121 builder.append(message.second); | 123 builder.append(message.second); |
| 122 } | 124 } |
| 123 return builder.toString(); | 125 return builder.toString(); |
| 124 } | 126 } |
| 125 | 127 |
| 126 } // namespace blink | 128 } // namespace blink |
| OLD | NEW |