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

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

Issue 8135023: Merge 96290 - REGRESSION(r93858): Can't type anything into input elements when maxlength is great... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 2 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 | « LayoutTests/fast/forms/input-text-paste-maxlength-expected.txt ('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) 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 // Step 8 209 // Step 8
210 Vector<UChar, 16> digits; 210 Vector<UChar, 16> digits;
211 while (position < end) { 211 while (position < end) {
212 if (!isASCIIDigit(*position)) 212 if (!isASCIIDigit(*position))
213 break; 213 break;
214 digits.append(*position++); 214 digits.append(*position++);
215 } 215 }
216 216
217 // Step 9 217 // Step 9
218 value = sign * charactersToIntStrict(digits.data(), digits.size()); 218 bool ok;
219 return true; 219 value = sign * charactersToIntStrict(digits.data(), digits.size(), &ok);
220 return ok;
220 } 221 }
221 222
222 // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-non-nega tive-integers 223 // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-non-nega tive-integers
223 bool parseHTMLNonNegativeInteger(const String& input, unsigned int& value) 224 bool parseHTMLNonNegativeInteger(const String& input, unsigned int& value)
224 { 225 {
225 // Step 1 226 // Step 1
226 // Step 2 227 // Step 2
227 const UChar* position = input.characters(); 228 const UChar* position = input.characters();
228 const UChar* end = position + input.length(); 229 const UChar* end = position + input.length();
229 230
(...skipping 24 matching lines...) Expand all
254 255
255 // Step 8 256 // Step 8
256 Vector<UChar, 16> digits; 257 Vector<UChar, 16> digits;
257 while (position < end) { 258 while (position < end) {
258 if (!isASCIIDigit(*position)) 259 if (!isASCIIDigit(*position))
259 break; 260 break;
260 digits.append(*position++); 261 digits.append(*position++);
261 } 262 }
262 263
263 // Step 9 264 // Step 9
264 value = charactersToUIntStrict(digits.data(), digits.size()); 265 bool ok;
265 return true; 266 value = charactersToUIntStrict(digits.data(), digits.size(), &ok);
267 return ok;
266 } 268 }
267 269
268 } 270 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/input-text-paste-maxlength-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698