<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>62939</bug_id>
          
          <creation_ts>2011-06-18 14:41:32 -0700</creation_ts>
          <short_desc>Issues of reformatting the text of a &quot;number&quot; field</short_desc>
          <delta_ts>2012-08-07 21:43:35 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Forms</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://stackoverflow.com/questions/5345095/chrome-auto-formats-input-number</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>65064</dependson>
    
    <dependson>76613</dependson>
    
    <dependson>78208</dependson>
    
    <dependson>78326</dependson>
    
    <dependson>93236</dependson>
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Patrick Gillespie">patorjk</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>arcain</cc>
    
    <cc>joepeck</cc>
    
    <cc>jonlee</cc>
    
    <cc>shinyak</cc>
    
    <cc>shinyak</cc>
    
    <cc>tkent</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>423263</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Gillespie">patorjk</who>
    <bug_when>2011-06-18 14:41:32 -0700</bug_when>
    <thetext>A comma is being inserted into the text of a &quot;number&quot; field. According to the HTML5 standard (http://www.whatwg.org/specs/web-apps/current-work/multipage/number-state.html#number-state):

&quot;The algorithm to convert a number to a string, given a number input, is as follows: Return a valid floating point number that represents input.&quot;

A user named &quot;arcain&quot; at Stack Overflow claims to have pinpointed the problem in Webkit and has a solution (see the top answer):

http://stackoverflow.com/questions/5345095/chrome-auto-formats-input-number

I was unable to find a bug report on the issue or contact information for arcain, and since I&apos;ve been having the same problem I figured I&apos;d write a bug report and point to his solution/analysis.

I also want to add that I can see the benefit of the formatting in some cases (so maybe it should be configurable), but developers should be able to turn it off. Since there is no &quot;year&quot; field in HTML5, it seems logical to use number instead, but with the comma, developers are unable to do that and there is no way for them (at least from what I know) to use a year field that is just a spinbox with a number in it.

Side note, the bug is also reported in Chrome here: http://code.google.com/p/chromium/issues/detail?id=78520</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>424338</commentid>
    <comment_count>1</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2011-06-21 00:58:23 -0700</bug_when>
    <thetext>The purpose of introducing LocalizedNumber was to support localized decimal separators.  Supporting group separators in parsing is also helpful for users, and it is harmless. Supporting group separators in formatting and auto-reformatting are harmfull in some cases.

So, a short term solution woud be:
 * Don&apos;t reformat the user-input value if it is a valid number, and
 * Don&apos;t use group separators in formatting in order to avoid formatting of the initial value.

I think a long term solution would be:
   Introducing a CSS property to control number formatting.
  e.g.  -webkit-number-format: [ &quot;none&quot; | &quot;auto&quot; | format-string]
    &quot;none&quot; accepts only HTML5 format.
     &quot;auto&quot; is the current locale-dependent behavior.
     format-string is like &quot;#,##0.###&quot;

Comments?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>425039</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Cain">arcain</who>
    <bug_when>2011-06-21 22:59:51 -0700</bug_when>
    <thetext>This is arcain from SO; thanks for submitting this bug report. I had been in the process of trying to reproduce the issue on Windows and Ubuntu with the lastest Webkit sources, but neither platform exhibited the issue, plus it took forever to build out test environments. When I looked closer, the LocalizedNumber* sources didn&apos;t even seem to be included in the build -- they were, however included in chromium. So, I was a bit confused over whether the issue was really webkit, or if it was chromium.
(In reply to comment #0)
&gt; A comma is being inserted into the text of a &quot;number&quot; field. According to the HTML5 standard (http://www.whatwg.org/specs/web-apps/current-work/multipage/number-state.html#number-state):
&gt; 
&gt; &quot;The algorithm to convert a number to a string, given a number input, is as follows: Return a valid floating point number that represents input.&quot;
&gt; 
&gt; A user named &quot;arcain&quot; at Stack Overflow claims to have pinpointed the problem in Webkit and has a solution (see the top answer):
&gt; 
&gt; http://stackoverflow.com/questions/5345095/chrome-auto-formats-input-number
&gt; 
&gt; I was unable to find a bug report on the issue or contact information for arcain, and since I&apos;ve been having the same problem I figured I&apos;d write a bug report and point to his solution/analysis.
&gt; 
&gt; I also want to add that I can see the benefit of the formatting in some cases (so maybe it should be configurable), but developers should be able to turn it off. Since there is no &quot;year&quot; field in HTML5, it seems logical to use number instead, but with the comma, developers are unable to do that and there is no way for them (at least from what I know) to use a year field that is just a spinbox with a number in it.
&gt; 
&gt; Side note, the bug is also reported in Chrome here: http://code.google.com/p/chromium/issues/detail?id=78520</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>425044</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Cain">arcain</who>
    <bug_when>2011-06-21 23:16:58 -0700</bug_when>
    <thetext>I agree with the approach to mitigate the current formatting issue with a quick fix, and then come back with a more comprehensive, configurable solution.

I am creating a patch for part of the short-term solution: addressing the inclusion of grouping characters. I&apos;ll attach it here for review when I have finished.

(In reply to comment #1)
&gt; The purpose of introducing LocalizedNumber was to support localized decimal separators.  Supporting group separators in parsing is also helpful for users, and it is harmless. Supporting group separators in formatting and auto-reformatting are harmfull in some cases.
&gt; 
&gt; So, a short term solution woud be:
&gt;  * Don&apos;t reformat the user-input value if it is a valid number, and
&gt;  * Don&apos;t use group separators in formatting in order to avoid formatting of the initial value.
&gt; 
&gt; I think a long term solution would be:
&gt;    Introducing a CSS property to control number formatting.
&gt;   e.g.  -webkit-number-format: [ &quot;none&quot; | &quot;auto&quot; | format-string]
&gt;     &quot;none&quot; accepts only HTML5 format.
&gt;      &quot;auto&quot; is the current locale-dependent behavior.
&gt;      format-string is like &quot;#,##0.###&quot;
&gt; 
&gt; Comments?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>439670</commentid>
    <comment_count>4</comment_count>
      <attachid>101434</attachid>
    <who name="Shinya Kawanaka">shinyak</who>
    <bug_when>2011-07-20 00:54:02 -0700</bug_when>
    <thetext>Created attachment 101434
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>439673</commentid>
    <comment_count>5</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2011-07-20 01:03:45 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; Created an attachment (id=101434) [details]
&gt; Patch

The patch resolves only the second bullet in Comment #1, right?
Will you adress the first bullet?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>439675</commentid>
    <comment_count>6</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2011-07-20 01:05:14 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; Created an attachment (id=101434) [details]
&gt; Patch

I think the patch will break fast/speech/input-appearance-numberandspeech.html.
You should add it to platform/chromium/test_expectations.txt.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>441378</commentid>
    <comment_count>7</comment_count>
    <who name="Shinya Kawanaka">shinyak</who>
    <bug_when>2011-07-23 06:51:34 -0700</bug_when>
    <thetext>kent,

Sorry for late response.

Yes, that patch addresses only the second bullet in Comment #1.
The first bullet will take more time if I fix it.

So I&apos;ve added a new bug
https://bugs.webkit.org/show_bug.cgi?id=65064
which only addresses the second bullet in Comment #1.

(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; Created an attachment (id=101434) [details] [details]
&gt; &gt; Patch
&gt; 
&gt; The patch resolves only the second bullet in Comment #1, right?
&gt; Will you adress the first bullet?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>441575</commentid>
    <comment_count>8</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2011-07-25 00:27:06 -0700</bug_when>
    <thetext>Group separators aren&apos;t inserted by the patch in Bug 65064.

We still have reformatting issues.  For example, If a user specifies a value &quot;012345678901234567890123456789&quot; and changes the focus, the field value is reformatted to &quot;12345678901234600000000000000&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>462779</commentid>
    <comment_count>9</comment_count>
    <who name="Jon Lee">jonlee</who>
    <bug_when>2011-09-06 13:07:55 -0700</bug_when>
    <thetext>&lt;rdar://problem/9730100&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>575958</commentid>
    <comment_count>10</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2012-03-11 23:08:20 -0700</bug_when>
    <thetext>This bug was fixed for platforms using LocalizedNumberICU such as Chromium. We still have the problem with platforms using LocalizedNumberMac (OS X and iOS).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>689856</commentid>
    <comment_count>11</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2012-08-07 21:43:35 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; This bug was fixed for platforms using LocalizedNumberICU such as Chromium. We still have the problem with platforms using LocalizedNumberMac (OS X and iOS).

This was fixed in Bug 93236.
Closing the bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>101434</attachid>
            <date>2011-07-20 00:54:02 -0700</date>
            <delta_ts>2011-07-25 00:19:47 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-62939-20110720165400.patch</filename>
            <type>text/plain</type>
            <size>7493</size>
            <attacher name="Shinya Kawanaka">shinyak</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogOTEzMzMKZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZyBiL1NvdXJjZS9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mVyRm9ybWF0dGVyKCk7CisgICAgUmV0YWluUHRy
PE5TTnVtYmVyRm9ybWF0dGVyPiBmb3JtYXR0ZXIgPSBudW1iZXJGb3JtYXR0ZXJGb3JEaXNwbGF5
KCk7CiAgICAgW2Zvcm1hdHRlci5nZXQoKSBzZXRNYXhpbXVtRnJhY3Rpb25EaWdpdHM6ZnJhY3Rp
b25EaWdpdHNdOwogICAgIHJldHVybiBTdHJpbmcoW2Zvcm1hdHRlci5nZXQoKSBzdHJpbmdGcm9t
TnVtYmVyOm51bWJlci5nZXQoKV0pOwogfQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>