<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:simon.fraser&#64;apple.com" title="Simon Fraser (smfr) &lt;simon.fraser&#64;apple.com&gt;"> <span class="fn">Simon Fraser (smfr)</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Implement keyboard event sending for iOS in WebKitTestRunner"
   href="https://bugs.webkit.org/show_bug.cgi?id=149676">bug 149676</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #262196 Flags</td>
           <td>review?
           </td>
           <td>review-
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Implement keyboard event sending for iOS in WebKitTestRunner"
   href="https://bugs.webkit.org/show_bug.cgi?id=149676#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Implement keyboard event sending for iOS in WebKitTestRunner"
   href="https://bugs.webkit.org/show_bug.cgi?id=149676">bug 149676</a>
              from <span class="vcard"><a class="email" href="mailto:simon.fraser&#64;apple.com" title="Simon Fraser (smfr) &lt;simon.fraser&#64;apple.com&gt;"> <span class="fn">Simon Fraser (smfr)</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=262196&amp;action=diff" name="attach_262196" title="Patch">attachment 262196</a> <a href="attachment.cgi?id=262196&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=262196&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=262196&amp;action=review</a>

<span class="quote">&gt; Tools/WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl:38
&gt; +    void typeCharacter(DOMString character, object callback);</span >

This should be named to make it clear whether it's a hardware keyboard event, or a software keyboard event.

<span class="quote">&gt; Tools/WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl:39
&gt; +</span >

It may make sense to add callback properties for keyboard hide/show.

<span class="quote">&gt; Tools/WebKitTestRunner/UIScriptContext/UIScriptController.cpp:88
&gt; +#if PLATFORM(IOS)
&gt; +void UIScriptController::setDidShowKeyboardCallback(JSValueRef callback)
&gt; +{
&gt; +    m_didShowKeyboardCallback = m_context.registerCallback(callback);
&gt; +    platformSetDidShowKeyboardCallback();
&gt; +}
&gt; +
&gt; +JSValueRef UIScriptController::didShowKeyboardCallback() const
&gt; +{
&gt; +    return m_context.callbackWithID(m_didShowKeyboardCallback);
&gt; +}
&gt; +#endif</span >

This should go in UIScriptControllerIOS.mm

<span class="quote">&gt; Tools/WebKitTestRunner/UIScriptContext/UIScriptController.cpp:103
&gt; +void typeCharacter(JSStringRef, JSValueRef)</span >

UIScriptController::

<span class="quote">&gt; Tools/WebKitTestRunner/UIScriptContext/UIScriptController.h:62
&gt; +#if PLATFORM(IOS)
&gt; +    void setDidShowKeyboardCallback(JSValueRef);
&gt; +    JSValueRef didShowKeyboardCallback() const;
&gt; +#endif</span >

I've avoided #idfefs here, and just stubbed the functions out for non-iOS.

<span class="quote">&gt; Tools/WebKitTestRunner/UIScriptContext/UIScriptController.h:79
&gt; +#if PLATFORM(IOS)
&gt; +    void platformSetDidShowKeyboardCallback();
&gt; +#endif</span >

Ditto.

<span class="quote">&gt; Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:66
&gt; +        _keyboardMayAcceptKeyInput = NO;</span >

The name of this property is confusing. Is it really _keyboardIsVisible?

<span class="quote">&gt; Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:139
&gt; +    [self _sendHIDEvent:IOHIDEventCreateKeyboardEvent(kCFAllocatorDefault,
&gt; +        timestamp,
&gt; +        kHIDPage_KeyboardOrKeypad,
&gt; +        usage,
&gt; +        isKeyDown,
&gt; +        kIOHIDEventOptionNone)];</span >

You're leaking the event.</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>