WebKit Bugzilla
Attachment 349202 Details for
Bug 189436
: [iOS] uiController.typeCharacterUsingHardwareKeyboard() for down arrow and right arrow does not dispatch DOM keydown events
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Layout test
LayoutTest.patch (text/plain), 4.32 KB, created by
Daniel Bates
on 2018-09-07 15:14:17 PDT
(
hide
)
Description:
Layout test
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2018-09-07 15:14:17 PDT
Size:
4.32 KB
patch
obsolete
>From 19382cb2674a644b4963b0daf221021800d17423 Mon Sep 17 00:00:00 2001 >From: Daniel Bates <dabates@apple.com> >Date: Fri, 7 Sep 2018 14:06:01 -0700 >Subject: [PATCH] Add test case for keydown and keyup events for arrow keys in > non-editable content. > >--- > ...-keys-in-non-editable-element-expected.txt | 11 ++++ > ...up-arrow-keys-in-non-editable-element.html | 64 +++++++++++++++++++ > 2 files changed, 75 insertions(+) > create mode 100644 LayoutTests/fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element-expected.txt > create mode 100644 LayoutTests/fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element.html > >diff --git a/LayoutTests/fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element-expected.txt b/LayoutTests/fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element-expected.txt >new file mode 100644 >index 00000000000..ab05c3f0848 >--- /dev/null >+++ b/LayoutTests/fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element-expected.txt >@@ -0,0 +1,11 @@ >+This tests that DOM keydown and keyup events are dispatched to a non-editable <body> on iOS when pressing the arrow keys on a hardware keyboard. To run this test manually, verify that two messages are emitted when you press the following keys: â, â, â, â. >+ >+type: keydown, key: UIKeyInputUpArrow, code: Unidentified, keyIdentifier: Unidentified, keyCode: 0, charCode: 0, keyCode: 0, which: 0 >+type: keyup, key: UIKeyInputUpArrow, code: Unidentified, keyIdentifier: Unidentified, keyCode: 0, charCode: 0, keyCode: 0, which: 0 >+type: keydown, key: UIKeyInputDownArrow, code: Unidentified, keyIdentifier: Unidentified, keyCode: 0, charCode: 0, keyCode: 0, which: 0 >+type: keyup, key: UIKeyInputDownArrow, code: Unidentified, keyIdentifier: Unidentified, keyCode: 0, charCode: 0, keyCode: 0, which: 0 >+type: keydown, key: UIKeyInputLeftArrow, code: Unidentified, keyIdentifier: Unidentified, keyCode: 0, charCode: 0, keyCode: 0, which: 0 >+type: keyup, key: UIKeyInputLeftArrow, code: Unidentified, keyIdentifier: Unidentified, keyCode: 0, charCode: 0, keyCode: 0, which: 0 >+type: keydown, key: UIKeyInputRightArrow, code: Unidentified, keyIdentifier: Unidentified, keyCode: 0, charCode: 0, keyCode: 0, which: 0 >+type: keyup, key: UIKeyInputRightArrow, code: Unidentified, keyIdentifier: Unidentified, keyCode: 0, charCode: 0, keyCode: 0, which: 0 >+ >diff --git a/LayoutTests/fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element.html b/LayoutTests/fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element.html >new file mode 100644 >index 00000000000..cf925062bd5 >--- /dev/null >+++ b/LayoutTests/fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element.html >@@ -0,0 +1,64 @@ >+<!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 onkeydown="handleKeyDown(event)" onkeyup="handleKeyUp(event)"> >+<p>This tests that DOM keydown and keyup events are dispatched to a non-editable <body> on iOS when pressing the arrow keys on a hardware keyboard. To run this test manually, verify that two messages are emitted when you press the following keys: ↑, ↓, ←, →.</p> >+<pre id="console"></pre> >+<script> >+var remainingKeysToPress = ["upArrow", "downArrow", "leftArrow", "rightArrow"] >+ >+async function nextKeyPress() >+{ >+ if (!remainingKeysToPress.length) { >+ if (window.testRunner) >+ testRunner.notifyDone(); >+ return; >+ } >+ let nextKey = remainingKeysToPress.shift(); >+ UIHelper.typeCharacter(nextKey); >+} >+ >+function handleKeyDown(event) >+{ >+ logKeyEvent(event); >+} >+ >+function handleKeyUp(event) >+{ >+ logKeyEvent(event); >+ nextKeyPress(); >+} >+ >+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(", ")); >+} >+ >+function runTest() >+{ >+ if (!window.testRunner) >+ return; >+ nextKeyPress(); >+} >+ >+runTest(); >+</script> >+</body> >+</html> >-- >2.17.1 (Apple Git-112) >
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 189436
: 349202