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

Unified Diff: third_party/WebKit/Source/core/svg/SVGParsingError.cpp

Issue 1668183002: Remove the SVG parsing "generic error" reporting special case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TestExpectations Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/SVGParsingError.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGParsingError.cpp b/third_party/WebKit/Source/core/svg/SVGParsingError.cpp
index abbe1631d8ce85153d85423b13722d05840a3afd..69084715fab2fae5b226cfb1e3ced3d2b0ab72e5 100644
--- a/third_party/WebKit/Source/core/svg/SVGParsingError.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGParsingError.cpp
@@ -55,6 +55,7 @@ std::pair<const char*, const char*> messageForStatus(SVGParseStatus status)
case SVGParseStatus::ZeroValue:
return std::make_pair("A value of zero is not valid. (", ")");
case SVGParseStatus::ParsingFailed:
+ return std::make_pair("Invalid value, ", ".");
default:
ASSERT_NOT_REACHED();
break;
@@ -102,24 +103,16 @@ String SVGParsingError::format(const String& tagName, const QualifiedName& name,
{
StringBuilder builder;
- // TODO(fs): Remove this case once enough specific errors have been added.
- if (status() == SVGParseStatus::ParsingFailed) {
- builder.appendLiteral("Invalid value for ");
- appendErrorContextInfo(builder, tagName, name);
- builder.append('=');
- appendValue(builder, *this, value);
- } else {
- appendErrorContextInfo(builder, tagName, name);
- builder.appendLiteral(": ");
+ appendErrorContextInfo(builder, tagName, name);
+ builder.appendLiteral(": ");
- if (hasLocus() && locus() == value.length())
- builder.appendLiteral("Unexpected end of attribute. ");
+ if (hasLocus() && locus() == value.length())
+ builder.appendLiteral("Unexpected end of attribute. ");
- auto message = messageForStatus(status());
- builder.append(message.first);
- appendValue(builder, *this, value);
- builder.append(message.second);
- }
+ auto message = messageForStatus(status());
+ builder.append(message.first);
+ appendValue(builder, *this, value);
+ builder.append(message.second);
return builder.toString();
}
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698