<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 event order of keydown/keyup events and composition events are wrong on macOS"
   href="https://bugs.webkit.org/show_bug.cgi?id=165004">165004</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>The event order of keydown/keyup events and composition events are wrong on macOS
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>URL</th>
          <td>https://dvcs.w3.org/hg/d4e/raw-file/tip/key-event-test.html
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>macOS 10.12
          </td>
        </tr>

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

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

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

        <tr>
          <th>Component</th>
          <td>Event Handling
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>masayuki&#64;d-toybox.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I tested this on:

* Safari Technology Preview Release 18 (Safari 10.1, WebKit 12603.1.12)
* Safari Version 10.0.1 (12602.2.14.0.7)

STR:

1. Load <a href="https://dvcs.w3.org/hg/d4e/raw-file/tip/key-event-test.html">https://dvcs.w3.org/hg/d4e/raw-file/tip/key-event-test.html</a>
2. Change active keyboard layout to &quot;Hiragana&quot; of Japanese IME
3. Type &quot;a&quot; key of ANSI keyboard layout mapping

Expected Result:

event order should be:

1. keydown
2. compositionstart
3. compositionupdate
4. input
5. keyup

Actual Result:

1. compositionstart
2. compositionupdate
3. input
4. keydown
5. keyup

This is really different from the spec:
<a href="https://w3c.github.io/uievents/#events-composition-key-events">https://w3c.github.io/uievents/#events-composition-key-events</a>

Google Chrome works as expected. Firefox doesn't fire keyup event since it's traditional behavior &lt;<a href="https://bugzil.la/354358">https://bugzil.la/354358</a>&gt; but the order is correct.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>