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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 void SVGRect::parse(const CharType*& ptr, const CharType* end, ExceptionState& e
xceptionState) | 67 void SVGRect::parse(const CharType*& ptr, const CharType* end, ExceptionState& e
xceptionState) |
68 { | 68 { |
69 const CharType* start = ptr; | 69 const CharType* start = ptr; |
70 | 70 |
71 skipOptionalSVGSpaces(ptr, end); | 71 skipOptionalSVGSpaces(ptr, end); |
72 | 72 |
73 float x = 0.0f; | 73 float x = 0.0f; |
74 float y = 0.0f; | 74 float y = 0.0f; |
75 float width = 0.0f; | 75 float width = 0.0f; |
76 float height = 0.0f; | 76 float height = 0.0f; |
77 bool valid = parseNumber(ptr, end, x) && parseNumber(ptr, end, y) && parseNu
mber(ptr, end, width) && parseNumber(ptr, end, height, false); | 77 bool valid = parseNumber(ptr, end, x) && parseNumber(ptr, end, y) && parseNu
mber(ptr, end, width) && parseNumber(ptr, end, height, DisallowWhitespace); |
78 | 78 |
79 if (!valid) { | 79 if (!valid) { |
80 exceptionState.throwDOMException(SyntaxError, "Problem parsing rect \""
+ String(start, end - start) + "\""); | 80 exceptionState.throwDOMException(SyntaxError, "Problem parsing rect \""
+ String(start, end - start) + "\""); |
81 setInvalid(); | 81 setInvalid(); |
82 return; | 82 return; |
83 } | 83 } |
84 | 84 |
85 skipOptionalSVGSpaces(ptr, end); | 85 skipOptionalSVGSpaces(ptr, end); |
86 if (ptr < end) { // nothing should come after the last, fourth number | 86 if (ptr < end) { // nothing should come after the last, fourth number |
87 exceptionState.throwDOMException(SyntaxError, "Problem parsing rect \""
+ String(start, end - start) + "\""); | 87 exceptionState.throwDOMException(SyntaxError, "Problem parsing rect \""
+ String(start, end - start) + "\""); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 return -1; | 160 return -1; |
161 } | 161 } |
162 | 162 |
163 void SVGRect::setInvalid() | 163 void SVGRect::setInvalid() |
164 { | 164 { |
165 m_value = FloatRect(0.0f, 0.0f, 0.0f, 0.0f); | 165 m_value = FloatRect(0.0f, 0.0f, 0.0f, 0.0f); |
166 m_isValid = false; | 166 m_isValid = false; |
167 } | 167 } |
168 | 168 |
169 } | 169 } |
OLD | NEW |