Changeset 142122 in webkit
- Timestamp:
- Feb 7, 2013 7:46:58 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r142119 r142122 1 2013-02-07 Kent Tamura <tkent@chromium.org> 2 3 Conversion from localized numbers to HTML numbers should accept not only localized numbers but also HTML numbers 4 https://bugs.webkit.org/show_bug.cgi?id=109160 5 6 Reviewed by Kentaro Hara. 7 8 * fast/forms/number/number-l10n-input-expected.txt: Added. 9 * fast/forms/number/number-l10n-input.html: Added. 10 1 11 2013-02-07 Stephen White <senorblanco@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r142120 r142122 1 2013-02-07 Kent Tamura <tkent@chromium.org> 2 3 Conversion from localized numbers to HTML numbers should accept not only localized numbers but also HTML numbers 4 https://bugs.webkit.org/show_bug.cgi?id=109160 5 6 Reviewed by Kentaro Hara. 7 8 For example, A French user needs to specify a number to a number input 9 field. He might use a local decimal point, like 3,141592, or he might 10 use the standard decimal point like 3.141592. We had better accept both 11 of them. 12 13 We accepted both last year, but we changed the behavior so that we 14 accept only localized numbers because we had some cases where an input 15 string can be recognized as both of a localized number and the standard 16 number. e.g. 3.141 is 3141 in French locale and 3.141 in the 17 standard. Now we introduce a simple rule that we don't accept group 18 separator at all. So users won't confuse even if we accept both of 19 decimal points. 20 21 Test: fast/forms/number/number-l10n-input.html 22 23 * platform/text/PlatformLocale.cpp: 24 (WebCore::Locale::convertFromLocalizedNumber): 25 If the specified string contains invalid characters including group 26 separators, just return the specified string. 27 1 28 2013-02-07 Xiaobo Wang <xbwang@torchmobile.com.cn> 2 29 -
trunk/Source/WebCore/platform/text/PlatformLocale.cpp
r135355 r142122 306 306 unsigned startIndex; 307 307 unsigned endIndex; 308 if (!detectSignAndGetDigitRange(input, isNegative, startIndex, endIndex)) { 309 // Input is broken. Returning an invalid number string. 310 return "*"; 311 } 308 if (!detectSignAndGetDigitRange(input, isNegative, startIndex, endIndex)) 309 return input; 312 310 313 311 StringBuilder builder; … … 318 316 unsigned symbolIndex = matchedDecimalSymbolIndex(input, i); 319 317 if (symbolIndex >= DecimalSymbolsSize) 320 return "*";318 return input; 321 319 if (symbolIndex == DecimalSeparatorIndex) 322 320 builder.append('.'); 323 else if (symbolIndex == GroupSeparatorIndex) { 324 // Ignore group separators. 325 326 } else 321 else if (symbolIndex == GroupSeparatorIndex) 322 return input; 323 else 327 324 builder.append(static_cast<UChar>('0' + symbolIndex)); 328 325 }
Note: See TracChangeset
for help on using the changeset viewer.