| 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 14 matching lines...) Expand all Loading... |
| 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::ExpectedBoolean: | 31 case SVGParseStatus::ExpectedBoolean: |
| 32 return std::make_pair("Expected 'true' or 'false', ", "."); | 32 return std::make_pair("Expected 'true' or 'false', ", "."); |
| 33 case SVGParseStatus::ExpectedEnumeration: | 33 case SVGParseStatus::ExpectedEnumeration: |
| 34 return std::make_pair("Unrecognized enumerated value, ", "."); | 34 return std::make_pair("Unrecognized enumerated value, ", "."); |
| 35 case SVGParseStatus::ExpectedNumber: |
| 36 return std::make_pair("Expected number, ", "."); |
| 35 case SVGParseStatus::NegativeValue: | 37 case SVGParseStatus::NegativeValue: |
| 36 return std::make_pair("A negative value is not valid. (", ")"); | 38 return std::make_pair("A negative value is not valid. (", ")"); |
| 37 case SVGParseStatus::ParsingFailed: | 39 case SVGParseStatus::ParsingFailed: |
| 38 default: | 40 default: |
| 39 ASSERT_NOT_REACHED(); | 41 ASSERT_NOT_REACHED(); |
| 40 break; | 42 break; |
| 41 } | 43 } |
| 42 return std::make_pair("", ""); | 44 return std::make_pair("", ""); |
| 43 } | 45 } |
| 44 | 46 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 98 |
| 97 auto message = messageForStatus(status()); | 99 auto message = messageForStatus(status()); |
| 98 builder.append(message.first); | 100 builder.append(message.first); |
| 99 appendValue(builder, *this, value); | 101 appendValue(builder, *this, value); |
| 100 builder.append(message.second); | 102 builder.append(message.second); |
| 101 } | 103 } |
| 102 return builder.toString(); | 104 return builder.toString(); |
| 103 } | 105 } |
| 104 | 106 |
| 105 } // namespace blink | 107 } // namespace blink |
| OLD | NEW |