<?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>204672</bug_id>
          
          <creation_ts>2019-11-28 03:08:47 -0800</creation_ts>
          <short_desc>[Win] &apos;key&apos; property of keydown KeyboardEvent doesn&apos;t have the diacritic for alphabet key following a dead key</short_desc>
          <delta_ts>2019-11-28 23:57:21 -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>Platform</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>
          <dependson>204694</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Fujii Hironori">fujii</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1593991</commentid>
    <comment_count>0</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2019-11-28 03:08:47 -0800</bug_when>
    <thetext>[Win] &apos;key&apos; property of keydown KeyboardEvent doesn&apos;t have the diacritic for alphabet key following a dead key

1. Switch the Windows keyboard layout to German
2. Start MiniBrowser
3. Open https://bug-202183-attachments.webkit.org/attachment.cgi?id=380407
4. typing [^] and [a] keys

Windows port is showing:

type:keydown key:Dead code:Equal
type:keyup key:Dead code:Equal
type:keydown key:a code:KeyA ★
type:keypress key:á code:KeyA
type:keyup key:a code:KeyA

On the other hand, Chrome and Firefox

type:keydown key:Dead code:Equal
type:keyup key:Dead code:Equal
type:keydown key:á code:KeyA ★
type:keypress key:á code:KeyA
type:keyup key:a code:KeyA</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1593993</commentid>
    <comment_count>1</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2019-11-28 03:10:21 -0800</bug_when>
    <thetext>In Chromium, InputMethodWinBase::DispatchKeyEvent retrieves queued WM_CHAR events, and sets a char information from WM_CHAR to the keydown event.

&gt;  std::vector&lt;MSG&gt; char_msgs;
&gt;  // Combines the WM_KEY* and WM_CHAR messages in the event processing flow
&gt;  // which is necessary to let Chrome IME extension to process the key event
&gt;  // and perform corresponding IME actions.
&gt;  // Chrome IME extension may wants to consume certain key events based on
&gt;  // the character information of WM_CHAR messages. Holding WM_KEY* messages
&gt;  // until WM_CHAR is processed by the IME extension is not feasible because
&gt;  // there is no way to know whether there will or not be a WM_CHAR following
&gt;  // the WM_KEY*.
&gt;  // Chrome never handles dead chars so it is safe to remove/ignore
&gt;  // WM_*DEADCHAR messages.
&gt;  MSG msg;
&gt;  while (::PeekMessage(&amp;msg, native_key_event.hwnd, WM_CHAR, WM_DEADCHAR,
&gt;                       PM_REMOVE)) {
&gt;    if (msg.message == WM_CHAR)
&gt;      char_msgs.push_back(msg);
&gt;  }
&gt;  while (::PeekMessage(&amp;msg, native_key_event.hwnd, WM_SYSCHAR, WM_SYSDEADCHAR,
&gt;                       PM_REMOVE)) {
&gt;    if (msg.message == WM_SYSCHAR)
&gt;      char_msgs.push_back(msg);
&gt;  }
(...)
&gt;  // If only 1 WM_CHAR per the key event, set it as the character of it.
&gt;  if (char_msgs.size() == 1 &amp;&amp;
&gt;      !std::iswcntrl(static_cast&lt;wint_t&gt;(char_msgs[0].wParam)))
&gt;    event-&gt;set_character(static_cast&lt;base::char16&gt;(char_msgs[0].wParam));

https://cs.chromium.org/chromium/src/ui/base/ime/win/input_method_win_base.cc?type=cs&amp;q=InputMethodWinBase::DispatchKeyEvent&amp;sq=package:chromium&amp;g=0&amp;l=193</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>