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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 template<typename CharType> | 68 template<typename CharType> |
69 void SVGPoint::parse(const CharType*& ptr, const CharType* end, ExceptionState&
exceptionState) | 69 void SVGPoint::parse(const CharType*& ptr, const CharType* end, ExceptionState&
exceptionState) |
70 { | 70 { |
71 const CharType* start = ptr; | 71 const CharType* start = ptr; |
72 | 72 |
73 skipOptionalSVGSpaces(ptr, end); | 73 skipOptionalSVGSpaces(ptr, end); |
74 | 74 |
75 float x = 0.0f; | 75 float x = 0.0f; |
76 float y = 0.0f; | 76 float y = 0.0f; |
77 bool valid = parseNumber(ptr, end, x) && parseNumber(ptr, end, y, false); | 77 bool valid = parseNumber(ptr, end, x) && parseNumber(ptr, end, y, DisallowWh
itespace); |
78 | 78 |
79 if (!valid) { | 79 if (!valid) { |
80 exceptionState.throwDOMException(SyntaxError, "Problem parsing point \""
+ String(start, end - start) + "\""); | 80 exceptionState.throwDOMException(SyntaxError, "Problem parsing point \""
+ String(start, end - start) + "\""); |
81 return; | 81 return; |
82 } | 82 } |
83 | 83 |
84 skipOptionalSVGSpaces(ptr, end); | 84 skipOptionalSVGSpaces(ptr, end); |
85 if (ptr < end) { // nothing should come after the last, fourth number | 85 if (ptr < end) { // nothing should come after the last, fourth number |
86 exceptionState.throwDOMException(SyntaxError, "Problem parsing point \""
+ String(start, end - start) + "\""); | 86 exceptionState.throwDOMException(SyntaxError, "Problem parsing point \""
+ String(start, end - start) + "\""); |
87 return; | 87 return; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 138 } |
139 | 139 |
140 float SVGPoint::calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGElement* co
ntextElement) | 140 float SVGPoint::calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGElement* co
ntextElement) |
141 { | 141 { |
142 // SVGPoint is not animated by itself | 142 // SVGPoint is not animated by itself |
143 ASSERT_NOT_REACHED(); | 143 ASSERT_NOT_REACHED(); |
144 return 0.0f; | 144 return 0.0f; |
145 } | 145 } |
146 | 146 |
147 } | 147 } |
OLD | NEW |