[iOS] Normalize character string based on key code
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Nov 2018 17:20:28 +0000 (17:20 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Nov 2018 17:20:28 +0000 (17:20 +0000)
commit2a4bca831c361a0ebbf74b4c08536cea058f3658
treea03b9281610cbc1c2bd6d06943659144d4cf3411
parentfe7408e01cd0a554b46f29402fcbc14b8fd99b40
[iOS] Normalize character string based on key code
https://bugs.webkit.org/show_bug.cgi?id=191120

Reviewed by Tim Horton.

Source/WebCore:

Following r236417 (https://bugs.webkit.org/show_bug.cgi?id=189604) we always have a valid key code
for a special key (e.g. page up) and can simplify the character string normalization code.

No functionality changed. So, no new tests.

* platform/ios/WebEvent.mm:
(normalizedStringWithAppKitCompatibilityMapping): Modified to take a key code and wrote algorithm
in terms of it.

(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
Pass the key code for the event to normalizedStringWithAppKitCompatibilityMapping().

Source/WebCore/PAL:

Remove forward declarations that are no longer needed now that we check key code.

* pal/spi/ios/UIKitSPI.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/ios/UIKitSPI.h
Source/WebCore/platform/ios/WebEvent.mm