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

Side by Side Diff: Source/core/svg/SVGRect.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/SVGPointList.cpp ('k') | Source/core/svg/SVGStringList.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) 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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGPointList.cpp ('k') | Source/core/svg/SVGStringList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698