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

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

Issue 1644293003: Error reporting for SVGInteger and SVGIntegerOptionalInteger (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TestExpectations; Drop redundant test. 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 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 return String::number(m_firstInteger->value()) + " " + String::number(m_seco ndInteger->value()); 76 return String::number(m_firstInteger->value()) + " " + String::number(m_seco ndInteger->value());
77 } 77 }
78 78
79 SVGParsingError SVGIntegerOptionalInteger::setValueAsString(const String& value) 79 SVGParsingError SVGIntegerOptionalInteger::setValueAsString(const String& value)
80 { 80 {
81 float x, y; 81 float x, y;
82 SVGParsingError parseStatus; 82 SVGParsingError parseStatus;
83 if (!parseNumberOptionalNumber(value, x, y)) { 83 if (!parseNumberOptionalNumber(value, x, y)) {
84 parseStatus = SVGParseStatus::ParsingFailed; 84 parseStatus = SVGParseStatus::ExpectedInteger;
85 x = y = 0; 85 x = y = 0;
86 } 86 }
87 87
88 m_firstInteger->setValue(x); 88 m_firstInteger->setValue(x);
89 m_secondInteger->setValue(y); 89 m_secondInteger->setValue(y);
90 return parseStatus; 90 return parseStatus;
91 } 91 }
92 92
93 void SVGIntegerOptionalInteger::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> othe r, SVGElement*) 93 void SVGIntegerOptionalInteger::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> othe r, SVGElement*)
94 { 94 {
(...skipping 19 matching lines...) Expand all
114 m_secondInteger->setValue(static_cast<int>(roundf(y))); 114 m_secondInteger->setValue(static_cast<int>(roundf(y)));
115 } 115 }
116 116
117 float SVGIntegerOptionalInteger::calculateDistance(PassRefPtrWillBeRawPtr<SVGPro pertyBase> other, SVGElement*) 117 float SVGIntegerOptionalInteger::calculateDistance(PassRefPtrWillBeRawPtr<SVGPro pertyBase> other, SVGElement*)
118 { 118 {
119 // FIXME: Distance calculation is not possible for SVGIntegerOptionalInteger right now. We need the distance for every single value. 119 // FIXME: Distance calculation is not possible for SVGIntegerOptionalInteger right now. We need the distance for every single value.
120 return -1; 120 return -1;
121 } 121 }
122 122
123 } // namespace blink 123 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGInteger.cpp ('k') | third_party/WebKit/Source/core/svg/SVGParsingError.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698