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

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

Issue 545173003: Support scientific notation in CSS numbers/percentages/dimensions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop parseSVGNumber; Add additional TC. Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGParserUtilities.h ('k') | no next file » | 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) 2002, 2003 The Karbon Developers 2 * Copyright (C) 2002, 2003 The Karbon Developers
3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
4 * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> 4 * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org>
5 * Copyright (C) 2007, 2009, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2007, 2009, 2013 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 if (start == ptr) 139 if (start == ptr)
140 return false; 140 return false;
141 141
142 if (mode & AllowTrailingWhitespace) 142 if (mode & AllowTrailingWhitespace)
143 skipOptionalSVGSpacesOrDelimiter(ptr, end); 143 skipOptionalSVGSpacesOrDelimiter(ptr, end);
144 144
145 return true; 145 return true;
146 } 146 }
147 147
148 template <typename CharType>
149 bool parseSVGNumber(CharType* begin, size_t length, double& number)
150 {
151 const CharType* ptr = begin;
152 const CharType* end = ptr + length;
153 return genericParseNumber(ptr, end, number, AllowLeadingAndTrailingWhitespac e);
154 }
155
156 // Explicitly instantiate the two flavors of parseSVGNumber() to satisfy externa l callers
157 template bool parseSVGNumber(LChar* begin, size_t length, double&);
158 template bool parseSVGNumber(UChar* begin, size_t length, double&);
159
160 bool parseNumber(const LChar*& ptr, const LChar* end, float& number, WhitespaceM ode mode) 148 bool parseNumber(const LChar*& ptr, const LChar* end, float& number, WhitespaceM ode mode)
161 { 149 {
162 return genericParseNumber(ptr, end, number, mode); 150 return genericParseNumber(ptr, end, number, mode);
163 } 151 }
164 152
165 bool parseNumber(const UChar*& ptr, const UChar* end, float& number, WhitespaceM ode mode) 153 bool parseNumber(const UChar*& ptr, const UChar* end, float& number, WhitespaceM ode mode)
166 { 154 {
167 return genericParseNumber(ptr, end, number, mode); 155 return genericParseNumber(ptr, end, number, mode);
168 } 156 }
169 157
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 parseAndSkipTransformType(ptr, end, type); 553 parseAndSkipTransformType(ptr, end, type);
566 } else { 554 } else {
567 const UChar* ptr = string.characters16(); 555 const UChar* ptr = string.characters16();
568 const UChar* end = ptr + string.length(); 556 const UChar* end = ptr + string.length();
569 parseAndSkipTransformType(ptr, end, type); 557 parseAndSkipTransformType(ptr, end, type);
570 } 558 }
571 return type; 559 return type;
572 } 560 }
573 561
574 } 562 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGParserUtilities.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698