OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2007 Apple Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 | 65 |
66 m_value = FloatRect(x, y, width, height); | 66 m_value = FloatRect(x, y, width, height); |
67 m_isValid = true; | 67 m_isValid = true; |
68 return SVGParseStatus::NoError; | 68 return SVGParseStatus::NoError; |
69 } | 69 } |
70 | 70 |
71 SVGParsingError SVGRect::setValueAsString(const String& string) | 71 SVGParsingError SVGRect::setValueAsString(const String& string) |
72 { | 72 { |
73 setInvalid(); | 73 setInvalid(); |
74 | 74 |
75 if (string.isNull()) | 75 if (string.isNull() || string.isEmpty()) |
fs
2016/06/03 10:42:51
isEmpty() would be an error, so probably not retur
Shanmuga Pandi
2016/06/03 13:09:31
Done.
| |
76 return SVGParseStatus::NoError; | 76 return SVGParseStatus::NoError; |
77 | 77 |
78 if (string.isEmpty()) { | |
79 m_value = FloatRect(0.0f, 0.0f, 0.0f, 0.0f); | |
80 m_isValid = true; | |
81 return SVGParseStatus::NoError; | |
82 } | |
83 | |
84 if (string.is8Bit()) { | 78 if (string.is8Bit()) { |
85 const LChar* ptr = string.characters8(); | 79 const LChar* ptr = string.characters8(); |
86 const LChar* end = ptr + string.length(); | 80 const LChar* end = ptr + string.length(); |
87 return parse(ptr, end); | 81 return parse(ptr, end); |
88 } | 82 } |
89 const UChar* ptr = string.characters16(); | 83 const UChar* ptr = string.characters16(); |
90 const UChar* end = ptr + string.length(); | 84 const UChar* end = ptr + string.length(); |
91 return parse(ptr, end); | 85 return parse(ptr, end); |
92 } | 86 } |
93 | 87 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 return -1; | 128 return -1; |
135 } | 129 } |
136 | 130 |
137 void SVGRect::setInvalid() | 131 void SVGRect::setInvalid() |
138 { | 132 { |
139 m_value = FloatRect(0.0f, 0.0f, 0.0f, 0.0f); | 133 m_value = FloatRect(0.0f, 0.0f, 0.0f, 0.0f); |
140 m_isValid = false; | 134 m_isValid = false; |
141 } | 135 } |
142 | 136 |
143 } // namespace blink | 137 } // namespace blink |
OLD | NEW |