| Index: Source/core/svg/SVGNumber.cpp
|
| diff --git a/Source/core/svg/SVGNumber.cpp b/Source/core/svg/SVGNumber.cpp
|
| index 8e91bbf76e8522e1512bb0a12f9d3494ceb600b0..b50bd1bbfba0154c082d8815ffa3265dde70cd84 100644
|
| --- a/Source/core/svg/SVGNumber.cpp
|
| +++ b/Source/core/svg/SVGNumber.cpp
|
| @@ -62,7 +62,7 @@ String SVGNumber::valueAsString() const
|
| template<typename CharType>
|
| bool SVGNumber::parse(const CharType*& ptr, const CharType* end)
|
| {
|
| - if (!parseNumber(ptr, end, m_value, AllowLeadingAndTrailingWhitespace)) {
|
| + if (!parseNumber(ptr, end, m_value, false)) {
|
| m_value = 0;
|
| return false;
|
| }
|
| @@ -127,12 +127,21 @@ PassRefPtr<SVGNumber> SVGNumberAcceptPercentage::clone() const
|
|
|
| void SVGNumberAcceptPercentage::setValueAsString(const String& string, ExceptionState& exceptionState)
|
| {
|
| - bool valid = parseNumberOrPercentage(string, m_value);
|
| -
|
| - if (!valid) {
|
| - exceptionState.throwDOMException(SyntaxError, "The value provided ('" + string + "') is invalid.");
|
| + if (string.isEmpty()) {
|
| m_value = 0;
|
| + return;
|
| }
|
| +
|
| + if (string.endsWith('%')) {
|
| + SVGNumber::setValueAsString(string.left(string.length() - 1), exceptionState);
|
| + if (exceptionState.hadException())
|
| + return;
|
| +
|
| + m_value /= 100.0f;
|
| + return;
|
| + }
|
| +
|
| + SVGNumber::setValueAsString(string, exceptionState);
|
| }
|
|
|
| SVGNumberAcceptPercentage::SVGNumberAcceptPercentage(float value)
|
|
|