| 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/json/JSONValues.h" | 8 #include "platform/json/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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 return std::make_pair("Expected '(', ", "."); | 54 return std::make_pair("Expected '(', ", "."); |
| 55 case SVGParseStatus::ExpectedTransformFunction: | 55 case SVGParseStatus::ExpectedTransformFunction: |
| 56 return std::make_pair("Expected transform function, ", "."); | 56 return std::make_pair("Expected transform function, ", "."); |
| 57 case SVGParseStatus::NegativeValue: | 57 case SVGParseStatus::NegativeValue: |
| 58 return std::make_pair("A negative value is not valid. (", ")"); | 58 return std::make_pair("A negative value is not valid. (", ")"); |
| 59 case SVGParseStatus::ZeroValue: | 59 case SVGParseStatus::ZeroValue: |
| 60 return std::make_pair("A value of zero is not valid. (", ")"); | 60 return std::make_pair("A value of zero is not valid. (", ")"); |
| 61 case SVGParseStatus::ParsingFailed: | 61 case SVGParseStatus::ParsingFailed: |
| 62 return std::make_pair("Invalid value, ", "."); | 62 return std::make_pair("Invalid value, ", "."); |
| 63 default: | 63 default: |
| 64 ASSERT_NOT_REACHED(); | 64 NOTREACHED(); |
| 65 break; | 65 break; |
| 66 } | 66 } |
| 67 return std::make_pair("", ""); | 67 return std::make_pair("", ""); |
| 68 } | 68 } |
| 69 | 69 |
| 70 bool disableLocus(SVGParseStatus status) { | 70 bool disableLocus(SVGParseStatus status) { |
| 71 // Disable locus for semantic errors and generic errors (see TODO below). | 71 // Disable locus for semantic errors and generic errors (see TODO below). |
| 72 return status == SVGParseStatus::NegativeValue || | 72 return status == SVGParseStatus::NegativeValue || |
| 73 status == SVGParseStatus::ZeroValue || | 73 status == SVGParseStatus::ZeroValue || |
| 74 status == SVGParseStatus::ParsingFailed; | 74 status == SVGParseStatus::ParsingFailed; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 builder.append("Unexpected end of attribute. "); | 117 builder.append("Unexpected end of attribute. "); |
| 118 | 118 |
| 119 auto message = messageForStatus(status()); | 119 auto message = messageForStatus(status()); |
| 120 builder.append(message.first); | 120 builder.append(message.first); |
| 121 appendValue(builder, *this, value); | 121 appendValue(builder, *this, value); |
| 122 builder.append(message.second); | 122 builder.append(message.second); |
| 123 return builder.toString(); | 123 return builder.toString(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace blink | 126 } // namespace blink |
| OLD | NEW |