<?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>55560</bug_id>
          
          <creation_ts>2011-03-02 01:03:58 -0800</creation_ts>
          <short_desc>[chromium] Changing the value of an input element doesn&apos;t cancel IME composition</short_desc>
          <delta_ts>2013-04-11 13:23:17 -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>HTML Editing</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>hbono</cc>
    
    <cc>ojan</cc>
    
    <cc>schenney</cc>
    
    <cc>suzhe</cc>
    
    <cc>tkent</cc>
    
    <cc>tony</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>360656</commentid>
    <comment_count>0</comment_count>
      <attachid>84382</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-03-02 01:03:58 -0800</bug_when>
    <thetext>Created attachment 84382
demo

On Safari, modifying the value of an input element cancels IME composition and removes the marked text.  However, on chromium, this does not happen.

See the attached demo.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361296</commentid>
    <comment_count>1</comment_count>
    <who name="Hironori Bono">hbono</who>
    <bug_when>2011-03-02 18:52:49 -0800</bug_when>
    <thetext>(In reply to comment #0)
&gt; Created an attachment (id=84382) [details]
&gt; demo
&gt; 
&gt; On Safari, modifying the value of an input element cancels IME composition and removes the marked text.  However, on chromium, this does not happen.
&gt; 
&gt; See the attached demo.

I once implemented a change that canceled an ongoing composition when the input-element value is changed by JS. But, it caused some site-compatibility problems (especially Google Suggest). (Google Suggest replaces the text with its suggestion when typing a down key or an up key. If we cancel an ongoing composition when the input-element value is changed, it cancels the composition.)

Regards,

Hironori Bono</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361308</commentid>
    <comment_count>2</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-03-02 19:16:44 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; I once implemented a change that canceled an ongoing composition when the input-element value is changed by JS. But, it caused some site-compatibility problems (especially Google Suggest). (Google Suggest replaces the text with its suggestion when typing a down key or an up key. If we cancel an ongoing composition when the input-element value is changed, it cancels the composition.)

This shouldn&apos;t be an issue for Japanese IME because down arrow key, space bar, etc... is always caught by IME and won&apos;t be sent to the website.  Which means that suggest won&apos;t be replacing the text until the user confirms the current composition, and I think this is a correct behavior.

Now, there&apos;s a bug in Chromium that Chinese IME doesn&apos;t stop the propagation of a down arrow key even if it&apos;s used to select a different composition candidate.  So the down arrow key used to select a different candidate causes google.co.jp to replace the input&apos;s value.  But once we fix this bug, a down arrow key used to select a composition candidate is always caught by IME, and we shouldn&apos;t have the said issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361322</commentid>
    <comment_count>3</comment_count>
    <who name="Hironori Bono">hbono</who>
    <bug_when>2011-03-02 19:57:16 -0800</bug_when>
    <thetext>(In reply to comment #2)

&gt; This shouldn&apos;t be an issue for Japanese IME because down arrow key, space bar, etc... is always caught by IME and won&apos;t be sent to the website.

It is up to an IME itself whether to consume these keys. That is, we can implement an IME that does not consume a down-arrow key or a space key at least on Windows. (Mac and Linux use IMEs to compose accented alphabets. These IMEs do not consume a down key, do they?)

&gt; Which means that suggest won&apos;t be replacing the text until the user confirms the current composition, and I think this is a correct behavior.

I think this is just a matter of tastes. Some people like browsers to allow JS to replace the composition text while a user is composing text, other people not. (It seems Google suggest like to replace the composition text while a user is composing text.) It may be better to talk with JavaScript developers about it?

&gt; Now, there&apos;s a bug in Chromium that Chinese IME doesn&apos;t stop the propagation of a down arrow key even if it&apos;s used to select a different composition candidate.  So the down arrow key used to select a different candidate causes google.co.jp to replace the input&apos;s value.  But once we fix this bug, a down arrow key used to select a composition candidate is always caught by IME, and we shouldn&apos;t have the said issue.

If I recall correctly, Chromium replaces a key code with 229 (VK_PROCESSKEY) when an IME says it handles a key event. So, if Chromium sends a key event without replacing its key code when an IME says it does not handle the key event. :)

Regards,

Hironori Bono</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361326</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-03-02 20:06:07 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; &gt; Which means that suggest won&apos;t be replacing the text until the user confirms the current composition, and I think this is a correct behavior.
&gt; 
&gt; I think this is just a matter of tastes. Some people like browsers to allow JS to replace the composition text while a user is composing text, other people not. (It seems Google suggest like to replace the composition text while a user is composing text.) It may be better to talk with JavaScript developers about it?

There&apos;s an ongoing thread on whatwg about this.  But I don&apos;t think Chrome&apos;s current behavior can be correct or intended.

To see the bug, open the attached test and type &quot;nihao&quot; with Chinese IME on Windows or Mac.  Then press down array key.  The text is replaced by henhao but &quot;henha&quot; is still marked and looks as if I&apos;m compositing &quot;henha&quot; but if I continue to type &quot;ma&quot; still with IME, then I observe that &quot;henhaomao&quot; is shown inside the input element.

This is all because WebCore expects IME be canceling composition when selection is changed but Chrome doesn&apos;t.

&gt; &gt; Now, there&apos;s a bug in Chromium that Chinese IME doesn&apos;t stop the propagation of a down arrow key even if it&apos;s used to select a different composition candidate.  So the down arrow key used to select a different candidate causes google.co.jp to replace the input&apos;s value.  But once we fix this bug, a down arrow key used to select a composition candidate is always caught by IME, and we shouldn&apos;t have the said issue.
&gt; 
&gt; If I recall correctly, Chromium replaces a key code with 229 (VK_PROCESSKEY) when an IME says it handles a key event. So, if Chromium sends a key event without replacing its key code when an IME says it does not handle the key event. :)

It&apos;s still odd that Safari and Chrome behave differently.  In my opinion, we should match Safari&apos;s behavior at least on Mac.  If Google Suggest is broken on Safari, then it seems like Google Suggest should be fixed to work for Safari.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361342</commentid>
    <comment_count>5</comment_count>
    <who name="Hironori Bono">hbono</who>
    <bug_when>2011-03-02 20:38:45 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; It&apos;s still odd that Safari and Chrome behave differently.  In my opinion, we should match Safari&apos;s behavior at least on Mac.  If Google Suggest is broken on Safari, then it seems like Google Suggest should be fixed to work for Safari.

I&apos;m wondering why this bug is filed to webkit. It would be better to file this issue to crbug.com because this issue seems to be an issue of Chrome front-end.

Regards,

Hironori Bono</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>509289</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-11-25 16:09:46 -0800</bug_when>
    <thetext>http://crbug.com/105450</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>84382</attachid>
            <date>2011-03-02 01:03:58 -0800</date>
            <delta_ts>2011-03-02 01:03:58 -0800</delta_ts>
            <desc>demo</desc>
            <filename>set-value-on-input-ime-composition.html</filename>
            <type>text/html</type>
            <size>1261</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8Ym9keT4KPHA+VGhpcyB0ZXN0IGVuc3VyZXMgV2ViS2l0
IGNsZWFycyBtYXJrZWQgdGV4dCBpbnNpZGUgYW4gaW5wdXQgZWxlbWVudCB3aGVuIHRoZSB2YWx1
ZSB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