Skip to content
Permalink
Browse files
[iOS] uiController.typeCharacterUsingHardwareKeyboard("`", ...) dispa…
…tches DOM key events for ~

https://bugs.webkit.org/show_bug.cgi?id=189325

Reviewed by Wenson Hsieh.

Tools:

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):

LayoutTests:

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.

Canonical link: https://commits.webkit.org/204405@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
dydz committed Sep 7, 2018
1 parent 0354178 commit 9802995bbe8ce89a4483926b176f4d0bbae8528a
Showing 5 changed files with 82 additions and 1 deletion.
@@ -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 Wenson Hsieh.

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 Basuke Suzuki <Basuke.Suzuki@sony.com>

[Curl][WebKitLegacy] Stop sending credential embedded in the url via XHR.
@@ -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

@@ -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>
@@ -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 Wenson Hsieh.

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 Frederic Wang <fwang@igalia.com>

[CSSOM View] Handle the scrollingElement in Element::scroll(Left/Top/Width/Height/To)
@@ -799,7 +799,6 @@ static inline bool shouldWrapWithShiftKeyEventForCharacter(NSString *key)
if (65 <= keyCode && keyCode <= 90)
return true;
switch (keyCode) {
case '`':
case '!':
case '@':
case '#':

0 comments on commit 9802995

Please sign in to comment.