WebKit Bugzilla
Attachment 349210 Details for
Bug 189325
: [iOS] uiController.typeCharacterUsingHardwareKeyboard("`", ...) dispatches DOM key events for ~
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch and layout test
bug-189325-20180907154707.patch (text/plain), 4.96 KB, created by
Daniel Bates
on 2018-09-07 15:47:08 PDT
(
hide
)
Description:
Patch and layout test
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2018-09-07 15:47:08 PDT
Size:
4.96 KB
patch
obsolete
>Subversion Revision: 235759 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 26e93257057a89c469b0a29a2b9bec08a9846dc9..442fdea22d8551128efc9439cd93350f7566d226 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,17 @@ >+2018-09-07 Daniel Bates <dabates@apple.com> >+ >+ [iOS] uiController.typeCharacterUsingHardwareKeyboard("`", ...) dispatches DOM key events for ~ >+ https://bugs.webkit.org/show_bug.cgi?id=189325 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Fixes an issue where the test infrastructure would incorrectly synthesized a shift key press followed >+ by a ` key press (i.e. type '~') when instructed to simulate typing a grave accent (`). Typing a >+ grave accent does not require holding the shift key. >+ >+ * WebKitTestRunner/ios/HIDEventGenerator.mm: >+ (shouldWrapWithShiftKeyEventForCharacter): >+ > 2018-09-07 Daniel Bates <dabates@apple.com> > > [iOS] Make WKWebView become the first responder to support testing key presses to non-editable elements >diff --git a/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm b/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm >index 29262a4e94a447dd0868f412b00367c3d1addaef..23ee37082af0d93a3030e6c4eb5c054195fa1cf9 100644 >--- a/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm >+++ b/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm >@@ -799,7 +799,6 @@ static inline bool shouldWrapWithShiftKeyEventForCharacter(NSString *key) > if (65 <= keyCode && keyCode <= 90) > return true; > switch (keyCode) { >- case '`': > case '!': > case '@': > case '#': >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 1a87e20ce31b07fe010c7f1f43ceb1eeeefd9dab..56d3741476986a239fee95adadc793582e22739c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2018-09-07 Daniel Bates <dabates@apple.com> >+ >+ [iOS] uiController.typeCharacterUsingHardwareKeyboard("`", ...) dispatches DOM key events for ~ >+ https://bugs.webkit.org/show_bug.cgi?id=189325 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a test to ensure that we dispatch the correct DOM key events when using uiController.typeCharacterUsingHardwareKeyboard("`") >+ (by way of UIHelper.typeCharacter()). >+ >+ * fast/events/ios/keypress-grave-accent-expected.txt: Added. >+ * fast/events/ios/keypress-grave-accent.html: Added. >+ > 2018-09-07 Daniel Bates <dabates@apple.com> > > [iOS] Arrow keys do not dispatch DOM events to non-editable elements >diff --git a/LayoutTests/fast/events/ios/keypress-grave-accent-expected.txt b/LayoutTests/fast/events/ios/keypress-grave-accent-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..79064d4d749c9a9c1078fd80f5e2d28c077d12ae >--- /dev/null >+++ b/LayoutTests/fast/events/ios/keypress-grave-accent-expected.txt >@@ -0,0 +1,7 @@ >+Tests that we dispatch DOM key events with the correct details when the grave accent key (`) is pressed on the keyboard. >+ >+ >+type: keydown, key: `, code: Backquote, keyIdentifier: U+0060, keyCode: 192, charCode: 0, keyCode: 192, which: 192 >+type: keypress, key: `, code: Backquote, keyIdentifier: , keyCode: 96, charCode: 96, keyCode: 96, which: 96 >+type: keyup, key: `, code: Unidentified, keyIdentifier: Unidentified, keyCode: 0, charCode: 0, keyCode: 0, which: 0 >+ >diff --git a/LayoutTests/fast/events/ios/keypress-grave-accent.html b/LayoutTests/fast/events/ios/keypress-grave-accent.html >new file mode 100644 >index 0000000000000000000000000000000000000000..42dfb175026cc44e975b0cf99a1e88a373507a83 >--- /dev/null >+++ b/LayoutTests/fast/events/ios/keypress-grave-accent.html >@@ -0,0 +1,48 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta name="viewport" content="width=device-width"> >+<script src="../../../resources/ui-helper.js"></script> >+<script> >+if (window.testRunner) { >+ testRunner.dumpAsText(); >+ testRunner.waitUntilDone(); >+} >+</script> >+</head> >+<body> >+<p>Tests that we dispatch DOM key events with the correct details when the grave accent key (`) is pressed on the keyboard.</p> >+<input type="text" id="input" onkeydown="logKeyEvent(event)" onkeyup="logKeyEvent(event)" onkeypress="logKeyEvent(event)"> >+<hr> >+<pre id="console"></pre> >+<script> >+var numberOfFiredKeyEvents = 0; >+var numberOfFiredKeyEventsForTestComplete = 3; >+ >+function log(message) >+{ >+ document.getElementById("console").appendChild(document.createTextNode(message + "\n")); >+} >+ >+function logKeyEvent(event) >+{ >+ let pieces = []; >+ for (let propertyName of ["type", "key", "code", "keyIdentifier", "keyCode", "charCode", "keyCode", "which"]) >+ pieces.push(`${propertyName}: ${event[propertyName]}`); >+ log(pieces.join(", ")); >+ if (++numberOfFiredKeyEvents >= numberOfFiredKeyEventsForTestComplete && window.testRunner) >+ testRunner.notifyDone(); >+} >+ >+async function runTest() >+{ >+ if (!window.testRunner) >+ return; >+ await UIHelper.activateFormControl(document.getElementById("input")); >+ await UIHelper.typeCharacter("`"); >+} >+ >+runTest(); >+</script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189325
:
348975
| 349210