| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |