Bug 109160

Summary: Conversion from localized numbers to HTML numbers should accept not only localized numbers but also HTML numbers
Product: WebKit Reporter: Kent Tamura <tkent>
Component: FormsAssignee: Kent Tamura <tkent>
Status: RESOLVED FIXED    
Severity: Normal CC: haraken, morrita, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch 2 none

Description Kent Tamura 2013-02-07 02:37:10 PST
Conversion from localized numbers to HTML numbers should accept not only localized numbers but also HTML numbers.

For example, A French user needs to specify a number to a number input field. He might use a local decimal point, like 3,141592, or he might use the standard decimal point like 3.141592. We had better accept both of them.

We accepted both last year, but we changed the behavior so that we accept only localized numbers because of user confusion of a localized group separator and the standard decimal point, or a localized decimal point and the standard group separator. Now we introduce a simple rule that we don't accept group separator at all. So users won't confuse even if we accept both of decimal points.

crbug.com/171921 and crbug.com/174865
Comment 1 Kent Tamura 2013-02-07 02:42:23 PST
Created attachment 187030 [details]
Patch
Comment 2 Kentaro Hara 2013-02-07 02:52:36 PST
Comment on attachment 187030 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=187030&action=review

> Source/WebCore/platform/text/PlatformLocale.cpp:309
>          // Input is broken. Returning an invalid number string.

Update this comment.

> LayoutTests/fast/forms/number/number-l10n-input.html:20
> +document.execCommand('InsertText', false, '1');
> +shouldBeEqualToString('arabicInput.value', '1');

You might want to test all of '1', '1.23' and '1,23' for each input.
Comment 3 Kent Tamura 2013-02-07 03:02:32 PST
Created attachment 187037 [details]
Patch 2
Comment 4 Kentaro Hara 2013-02-07 03:05:45 PST
Comment on attachment 187037 [details]
Patch 2

Looks good.
Comment 5 Kent Tamura 2013-02-07 03:07:03 PST
Comment on attachment 187037 [details]
Patch 2

Thanks!
Comment 6 WebKit Review Bot 2013-02-07 07:48:34 PST
Comment on attachment 187037 [details]
Patch 2

Clearing flags on attachment: 187037

Committed r142122: <http://trac.webkit.org/changeset/142122>
Comment 7 WebKit Review Bot 2013-02-07 07:48:37 PST
All reviewed patches have been landed.  Closing bug.