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

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

Issue 1636503003: Error reporting for SVGLength and SVGLengthList (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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGParsingError.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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::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::ExpectedLength:
36 return std::make_pair("Expected length, ", ".");
35 case SVGParseStatus::ExpectedNumber: 37 case SVGParseStatus::ExpectedNumber:
36 return std::make_pair("Expected number, ", "."); 38 return std::make_pair("Expected number, ", ".");
37 case SVGParseStatus::NegativeValue: 39 case SVGParseStatus::NegativeValue:
38 return std::make_pair("A negative value is not valid. (", ")"); 40 return std::make_pair("A negative value is not valid. (", ")");
39 case SVGParseStatus::ParsingFailed: 41 case SVGParseStatus::ParsingFailed:
40 default: 42 default:
41 ASSERT_NOT_REACHED(); 43 ASSERT_NOT_REACHED();
42 break; 44 break;
43 } 45 }
44 return std::make_pair("", ""); 46 return std::make_pair("", "");
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 100
99 auto message = messageForStatus(status()); 101 auto message = messageForStatus(status());
100 builder.append(message.first); 102 builder.append(message.first);
101 appendValue(builder, *this, value); 103 appendValue(builder, *this, value);
102 builder.append(message.second); 104 builder.append(message.second);
103 } 105 }
104 return builder.toString(); 106 return builder.toString();
105 } 107 }
106 108
107 } // namespace blink 109 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGParsingError.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698