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

Side by Side Diff: Source/core/html/parser/HTMLParserIdioms.cpp

Issue 18031012: parseHTMLInteger shouldn't bloatCharacters() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | « no previous file | 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) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 value = sign * charactersToIntStrict(digits.characters16(), digits.lengt h(), &ok); 200 value = sign * charactersToIntStrict(digits.characters16(), digits.lengt h(), &ok);
201 return ok; 201 return ok;
202 } 202 }
203 203
204 // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-integers 204 // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-integers
205 bool parseHTMLInteger(const String& input, int& value) 205 bool parseHTMLInteger(const String& input, int& value)
206 { 206 {
207 // Step 1 207 // Step 1
208 // Step 2 208 // Step 2
209 unsigned length = input.length(); 209 unsigned length = input.length();
210 if (length && input.is8Bit()) { 210 if (!length || input.is8Bit()) {
211 const LChar* start = input.characters8(); 211 const LChar* start = input.characters8();
212 return parseHTMLIntegerInternal(start, start + length, value); 212 return parseHTMLIntegerInternal(start, start + length, value);
213 } 213 }
214 214
215 const UChar* start = input.bloatedCharacters(); 215 const UChar* start = input.characters16();
216 return parseHTMLIntegerInternal(start, start + length, value); 216 return parseHTMLIntegerInternal(start, start + length, value);
217 } 217 }
218 218
219 template <typename CharacterType> 219 template <typename CharacterType>
220 static bool parseHTMLNonNegativeIntegerInternal(const CharacterType* position, c onst CharacterType* end, unsigned& value) 220 static bool parseHTMLNonNegativeIntegerInternal(const CharacterType* position, c onst CharacterType* end, unsigned& value)
221 { 221 {
222 // Step 3 222 // Step 3
223 while (position < end) { 223 while (position < end) {
224 if (!isHTMLSpace(*position)) 224 if (!isHTMLSpace(*position))
225 break; 225 break;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 { 290 {
291 return threadSafeEqual(a.localName().impl(), b.localName().impl()); 291 return threadSafeEqual(a.localName().impl(), b.localName().impl());
292 } 292 }
293 293
294 bool threadSafeMatch(const HTMLIdentifier& localName, const QualifiedName& qName ) 294 bool threadSafeMatch(const HTMLIdentifier& localName, const QualifiedName& qName )
295 { 295 {
296 return threadSafeEqual(localName.asStringImpl(), qName.localName().impl()); 296 return threadSafeEqual(localName.asStringImpl(), qName.localName().impl());
297 } 297 }
298 298
299 } 299 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698