<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - The keypress event is never fired in Sogou IME"
   href="https://bugs.webkit.org/show_bug.cgi?id=170368">170368</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>The keypress event is never fired in Sogou IME
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Safari 10
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Keywords</th>
          <td>InRadar
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>HTML Events
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bdakin&#64;apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>ap&#64;webkit.org, bdakin&#64;apple.com, charleyroy&#64;google.com, dbates&#64;webkit.org, rniwa&#64;webkit.org, ssaviano&#64;google.com, webkit-bug-importer&#64;group.apple.com, webkit-unassigned&#64;lists.webkit.org, wenson_hsieh&#64;apple.com
          </td>
        </tr>

        <tr>
          <th>Depends on</th>
          <td>169209
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This bug represents this action item: The keypress event is never fired in Sogou IME 

+++ This bug was initially created as a clone of <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - keyCodes of the keydown and keyup events do not match in Sogou IME"
   href="show_bug.cgi?id=169209">Bug #169209</a> +++

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 (<a href="http://pinyin.sogou.com/mac/">http://pinyin.sogou.com/mac/</a>).

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

In a content editable, press a punctuation character (eg. the key '.' to get '。', ',' to get ',', 'Shift+1' to get '!' - 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 ',')

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 ',' and with keycode 12290 for '。'

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 <a href="https://w3c.github.io/uievents/#events-composition-key-events">https://w3c.github.io/uievents/#events-composition-key-events</a>.</pre>
        </div>
      </p>

        <div id="referenced">
          <hr style="border: 1px dashed #969696">
          <b>Referenced Bugs:</b>
          <ul>
              <li>
                [<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - keyCodes of the keydown and keyup events do not match in Sogou IME"
   href="https://bugs.webkit.org/show_bug.cgi?id=169209">Bug 169209</a>] keyCodes of the keydown and keyup events do not match in Sogou IME
              </li>
          </ul>
        </div>
        <br>

      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>