<?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>170368</bug_id>
          
          <creation_ts>2017-03-31 17:00:42 -0700</creation_ts>
          <short_desc>The keypress event is never fired in Sogou IME</short_desc>
          <delta_ts>2019-02-06 22:08:16 -0800</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>Safari 10</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=170369</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>169209</dependson>
    
    <dependson>170369</dependson>
    
    <dependson>170370</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Beth Dakin">bdakin</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>bdakin</cc>
    
    <cc>charleyroy</cc>
    
    <cc>dbates</cc>
    
    <cc>rniwa</cc>
    
    <cc>ssaviano</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit-unassigned</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1293374</commentid>
    <comment_count>0</comment_count>
    <who name="Beth Dakin">bdakin</who>
    <bug_when>2017-03-31 17:00:42 -0700</bug_when>
    <thetext>This bug represents this action item: The keypress event is never fired in Sogou IME 

+++ This bug was initially created as a clone of Bug #169209 +++

I tested this on:

* Safari Technology Preview Release 23 (Safari 10.2, WebKit 12604.1.5)
* Safari Version 10.0.3 (12602.4.8)

I am using the Sogou IME (http://pinyin.sogou.com/mac/).

I am using this JS fiddle to log events, but any event logger will show this: https://jsfiddle.net/c1g6rahm/2/

In a content editable, press a punctuation character (eg. the key &apos;.&apos; to get &apos;。&apos;, &apos;,&apos; to get &apos;，&apos;, &apos;Shift+1&apos; to get &apos;！&apos; - notice they are full width).

Obtained event trace:
1. textInput
2. input
3. keydown - 229 (WIN_IME key)
4. keyup - 188 (in this case I pressed &apos;,&apos;)

This is problematic for a number of reasons:
1. There is no compositionstart/compositionupdate/composition end events, which there should be when using keydown WIN_IME
2. The textInput/input events are not between keydown/keyup, which they should be (they are when pressing regular ASCII/latin characters)
3. There is no keypress event fired. For example, Chrome fires a keypress with keycode 65292 for &apos;，&apos; and with keycode 12290 for &apos;。&apos;

The combination of these make it very hard to detect that these specific characters were selected without relying on the contents of the contenteditable. This also diverges from the spec at https://w3c.github.io/uievents/#events-composition-key-events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1294277</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2017-04-04 16:55:24 -0700</bug_when>
    <thetext>This is (or at least was) intentional behavior. We only fire keypress events when inline input is not in use. 

Is there a formal spec that Chrome behavior conforms to? Do other browsers agree?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1294324</commentid>
    <comment_count>2</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2017-04-04 19:15:32 -0700</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #1)
&gt; This is (or at least was) intentional behavior. We only fire keypress events
&gt; when inline input is not in use. 
&gt; 
&gt; Is there a formal spec that Chrome behavior conforms to? Do other browsers
&gt; agree?

So I think the problem here is that we&apos;re not firing either composition event or keypress instead of either.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1340488</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2017-08-20 15:40:02 -0700</bug_when>
    <thetext>Wenson, didn&apos;t you fix a bug like this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1340489</commentid>
    <comment_count>4</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2017-08-20 15:44:28 -0700</bug_when>
    <thetext>(In reply to Ryosuke Niwa from comment #3)
&gt; Wenson, didn&apos;t you fix a bug like this?

I think you might be thinking of https://bugs.webkit.org/show_bug.cgi?id=164369 or https://bugs.webkit.org/show_bug.cgi?id=164324, which are a bit different in that they&apos;re concerned with input and composition events rather than key events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1503221</commentid>
    <comment_count>5</comment_count>
    <who name="Lucas Forschler">lforschler</who>
    <bug_when>2019-02-06 09:18:41 -0800</bug_when>
    <thetext>Mass move bugs into the DOM component.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1503640</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-02-06 22:08:16 -0800</bug_when>
    <thetext>This is an editing bug.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>