Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: Source/core/svg/SVGPoint.cpp

Issue 302643004: [SVG2] Allow leading and trailing whitespace in svg attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@relax_todouble_wtf
Patch Set: split tests to combat slow xp trybots Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/svg/SVGParserUtilities.cpp ('k') | Source/core/svg/SVGPointList.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGParserUtilities.cpp ('k') | Source/core/svg/SVGPointList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698