<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:simon.fraser@apple.com" title="Simon Fraser (smfr) <simon.fraser@apple.com>"> <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@apple.com" title="Simon Fraser (smfr) <simon.fraser@apple.com>"> <span class="fn">Simon Fraser (smfr)</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=262196&action=diff" name="attach_262196" title="Patch">attachment 262196</a> <a href="attachment.cgi?id=262196&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=262196&action=review">https://bugs.webkit.org/attachment.cgi?id=262196&action=review</a>
<span class="quote">> Tools/WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl:38
> + 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">> Tools/WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl:39
> +</span >
It may make sense to add callback properties for keyboard hide/show.
<span class="quote">> Tools/WebKitTestRunner/UIScriptContext/UIScriptController.cpp:88
> +#if PLATFORM(IOS)
> +void UIScriptController::setDidShowKeyboardCallback(JSValueRef callback)
> +{
> + m_didShowKeyboardCallback = m_context.registerCallback(callback);
> + platformSetDidShowKeyboardCallback();
> +}
> +
> +JSValueRef UIScriptController::didShowKeyboardCallback() const
> +{
> + return m_context.callbackWithID(m_didShowKeyboardCallback);
> +}
> +#endif</span >
This should go in UIScriptControllerIOS.mm
<span class="quote">> Tools/WebKitTestRunner/UIScriptContext/UIScriptController.cpp:103
> +void typeCharacter(JSStringRef, JSValueRef)</span >
UIScriptController::
<span class="quote">> Tools/WebKitTestRunner/UIScriptContext/UIScriptController.h:62
> +#if PLATFORM(IOS)
> + void setDidShowKeyboardCallback(JSValueRef);
> + JSValueRef didShowKeyboardCallback() const;
> +#endif</span >
I've avoided #idfefs here, and just stubbed the functions out for non-iOS.
<span class="quote">> Tools/WebKitTestRunner/UIScriptContext/UIScriptController.h:79
> +#if PLATFORM(IOS)
> + void platformSetDidShowKeyboardCallback();
> +#endif</span >
Ditto.
<span class="quote">> Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:66
> + _keyboardMayAcceptKeyInput = NO;</span >
The name of this property is confusing. Is it really _keyboardIsVisible?
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:139
> + [self _sendHIDEvent:IOHIDEventCreateKeyboardEvent(kCFAllocatorDefault,
> + timestamp,
> + kHIDPage_KeyboardOrKeypad,
> + usage,
> + isKeyDown,
> + 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>