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

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

Issue 1620203002: Extended error reporting for SVGNumber/Point/Rect and related types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Blind is blind. Created 4 years, 11 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 return String::number(m_firstNumber->value()) + " " + String::number(m_secon dNumber->value()); 73 return String::number(m_firstNumber->value()) + " " + String::number(m_secon dNumber->value());
74 } 74 }
75 75
76 SVGParsingError SVGNumberOptionalNumber::setValueAsString(const String& value) 76 SVGParsingError SVGNumberOptionalNumber::setValueAsString(const String& value)
77 { 77 {
78 float x, y; 78 float x, y;
79 SVGParsingError parseStatus; 79 SVGParsingError parseStatus;
80 if (!parseNumberOptionalNumber(value, x, y)) { 80 if (!parseNumberOptionalNumber(value, x, y)) {
81 parseStatus = SVGParseStatus::ParsingFailed; 81 parseStatus = SVGParseStatus::ExpectedNumber;
82 x = y = 0; 82 x = y = 0;
83 } 83 }
84 84
85 m_firstNumber->setValue(x); 85 m_firstNumber->setValue(x);
86 m_secondNumber->setValue(y); 86 m_secondNumber->setValue(y);
87 return parseStatus; 87 return parseStatus;
88 } 88 }
89 89
90 void SVGNumberOptionalNumber::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElement*) 90 void SVGNumberOptionalNumber::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElement*)
91 { 91 {
(...skipping 19 matching lines...) Expand all
111 m_secondNumber->setValue(y); 111 m_secondNumber->setValue(y);
112 } 112 }
113 113
114 float SVGNumberOptionalNumber::calculateDistance(PassRefPtrWillBeRawPtr<SVGPrope rtyBase> other, SVGElement*) 114 float SVGNumberOptionalNumber::calculateDistance(PassRefPtrWillBeRawPtr<SVGPrope rtyBase> other, SVGElement*)
115 { 115 {
116 // FIXME: Distance calculation is not possible for SVGNumberOptionalNumber r ight now. We need the distance for every single value. 116 // FIXME: Distance calculation is not possible for SVGNumberOptionalNumber r ight now. We need the distance for every single value.
117 return -1; 117 return -1;
118 } 118 }
119 119
120 } 120 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGNumberList.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