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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGParsingError.cpp

Issue 1659513002: Error reporting for SVG transform lists (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: type -> transformType 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 unified diff | Download patch
OLDNEW
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
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: 31 case SVGParseStatus::ExpectedArcFlag:
32 return std::make_pair("Expected arc flag ('0' or '1'), ", "."); 32 return std::make_pair("Expected arc flag ('0' or '1'), ", ".");
33 case SVGParseStatus::ExpectedBoolean: 33 case SVGParseStatus::ExpectedBoolean:
34 return std::make_pair("Expected 'true' or 'false', ", "."); 34 return std::make_pair("Expected 'true' or 'false', ", ".");
35 case SVGParseStatus::ExpectedEndOfArguments:
36 return std::make_pair("Expected ')', ", ".");
35 case SVGParseStatus::ExpectedEnumeration: 37 case SVGParseStatus::ExpectedEnumeration:
36 return std::make_pair("Unrecognized enumerated value, ", "."); 38 return std::make_pair("Unrecognized enumerated value, ", ".");
37 case SVGParseStatus::ExpectedInteger: 39 case SVGParseStatus::ExpectedInteger:
38 return std::make_pair("Expected integer, ", "."); 40 return std::make_pair("Expected integer, ", ".");
39 case SVGParseStatus::ExpectedLength: 41 case SVGParseStatus::ExpectedLength:
40 return std::make_pair("Expected length, ", "."); 42 return std::make_pair("Expected length, ", ".");
41 case SVGParseStatus::ExpectedMoveToCommand: 43 case SVGParseStatus::ExpectedMoveToCommand:
42 return std::make_pair("Expected moveto path command ('M' or 'm'), ", "." ); 44 return std::make_pair("Expected moveto path command ('M' or 'm'), ", "." );
43 case SVGParseStatus::ExpectedNumber: 45 case SVGParseStatus::ExpectedNumber:
44 return std::make_pair("Expected number, ", "."); 46 return std::make_pair("Expected number, ", ".");
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 113
112 auto message = messageForStatus(status()); 114 auto message = messageForStatus(status());
113 builder.append(message.first); 115 builder.append(message.first);
114 appendValue(builder, *this, value); 116 appendValue(builder, *this, value);
115 builder.append(message.second); 117 builder.append(message.second);
116 } 118 }
117 return builder.toString(); 119 return builder.toString();
118 } 120 }
119 121
120 } // namespace blink 122 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698