[iOS] No DOM keypress event emitted for cursor key commands when non-editable element...
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Mar 2019 17:59:50 +0000 (17:59 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Mar 2019 17:59:50 +0000 (17:59 +0000)
commit1ccba1df34ca2b6ef07995bfada216d7d6042cd9
tree31447f31b63de13e05a9a4ad502c72292ecf83f7
parent1d7c90fc691e9f9f1e4123ca4bca9b356f9fd957
[iOS] No DOM keypress event emitted for cursor key commands when non-editable element is focused
https://bugs.webkit.org/show_bug.cgi?id=195626
<rdar://problem/48810626>

Reviewed by Wenson Hsieh.

Source/WebKit:

Following the UIKit fix <rdar://problem/47333786> WebKit will be asked whether it can perform some
more actions, including cursor movements and more editing actions. All such actions are only applicable
to editable elements. By responding NO to UIKit for such actions when we are not in an editable element
we avoid the need to do such bookkeeping ourselves as UIKit will forward our response back to us
on return from -handleKeyTextCommandForCurrentEvent, called from -[WKContentView _interpretKeyEvent].
WebKit is then in a position to try to handle the event or in the case of all standard text editing
key commands at the time of writing (e.g. Control + a) tell WebCore that it did not handle the event
so that WebCore can continue the DOM key event dispatch algorithm. For standard text editing key
commands, such as Control + a, we will emit a DOM keypress event for the 'a'.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformAction:withSender:]):

LayoutTests:

Add some tests. These tests depend on UIKit work.

* fast/events/ios/key-events-control-expected.txt: Added.
* fast/events/ios/key-events-control.html: Copied from LayoutTests/fast/events/ios/key-events-meta-alt-combinations.html.
* fast/events/ios/key-events-meta-expected.txt: Added.
* fast/events/ios/key-events-meta.html: Copied from LayoutTests/fast/events/ios/key-events-meta-alt-combinations.html.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243082 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/ios/key-events-control-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/ios/key-events-control.html [new file with mode: 0644]
LayoutTests/fast/events/ios/key-events-meta-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/ios/key-events-meta.html [new file with mode: 0644]
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm