Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[GTK] Should support key and code properties on keyboard events
https://bugs.webkit.org/show_bug.cgi?id=166759 Reviewed by Carlos Garcia Campos. Source/WebCore: This change fixes a bunch of tests which are currently failing, such as: - fast/events/arrow-keys-on-body.html - fast/events/constructors/keyboard-event-constructor.html - fast/events/key-events-in-input-button.html - fast/events/key-events-in-input-text.html - fast/events/keyboardevent-code.html - fast/events/keyboardevent-key.html * platform/PlatformKeyboardEvent.h: * platform/gtk/PlatformKeyboardEventGtk.cpp: (WebCore::PlatformKeyboardEvent::keyValueForGdkKeyCode): match web key value to GDK key symbol. (WebCore::PlatformKeyboardEvent::keyCodeForHardwareKeyCode): match web key code to hardware code as reported by GDK. (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): add web key value and code to the keyboard event upon creation. Source/WebKit2: * Shared/WebEvent.h: * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): accept web key value and code on construction. * Shared/gtk/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebKeyboardEvent): pass web key value and code on construction. Source/WTF: * wtf/FeatureDefines.h: enable key and code properties support for GTK. Tools: * WebKitTestRunner/gtk/EventSenderProxyGtk.cpp: (WTR::getGDKKeySymForKeyRef): add missing modifier keys which were being reported as 'l' and 'r' only on tests. LayoutTests: * platform/gtk/fast/events/keyboardevent-code-expected.txt: Added. Hardware codes are different for Mac and Linux for a couple of keys, so we need platform-specific results. Canonical link: https://commits.webkit.org/183955@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
13 changed files
with
974 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
190 changes: 190 additions & 0 deletions
190
LayoutTests/platform/gtk/fast/events/keyboardevent-code-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
Test the code attribute on KeyboardEvent. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
|
||
* keydown | ||
PASS keyboardEvent.code is "Space" | ||
* keyup | ||
PASS keyboardEvent.code is "Space" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "KeyA" | ||
* keyup | ||
PASS keyboardEvent.code is "KeyA" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "Backspace" | ||
* keyup | ||
PASS keyboardEvent.code is "Backspace" | ||
|
||
* keydown | ||
FAIL keyboardEvent.code should be Minus. Was Escape. | ||
* keyup | ||
FAIL keyboardEvent.code should be Minus. Was Escape. | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "ArrowLeft" | ||
* keyup | ||
PASS keyboardEvent.code is "ArrowLeft" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "ArrowRight" | ||
* keyup | ||
PASS keyboardEvent.code is "ArrowRight" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "ArrowUp" | ||
* keyup | ||
PASS keyboardEvent.code is "ArrowUp" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "ArrowDown" | ||
* keyup | ||
PASS keyboardEvent.code is "ArrowDown" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "PageUp" | ||
* keyup | ||
PASS keyboardEvent.code is "PageUp" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "PageDown" | ||
* keyup | ||
PASS keyboardEvent.code is "PageDown" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "Home" | ||
* keyup | ||
PASS keyboardEvent.code is "Home" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "End" | ||
* keyup | ||
PASS keyboardEvent.code is "End" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "Delete" | ||
* keyup | ||
PASS keyboardEvent.code is "Delete" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "ControlLeft" | ||
* keyup | ||
PASS keyboardEvent.code is "ControlLeft" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "ShiftLeft" | ||
* keyup | ||
PASS keyboardEvent.code is "ShiftLeft" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "AltLeft" | ||
* keyup | ||
PASS keyboardEvent.code is "AltLeft" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "ControlRight" | ||
* keyup | ||
PASS keyboardEvent.code is "ControlRight" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "ShiftRight" | ||
* keyup | ||
PASS keyboardEvent.code is "ShiftRight" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "AltRight" | ||
* keyup | ||
PASS keyboardEvent.code is "AltRight" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "F1" | ||
* keyup | ||
PASS keyboardEvent.code is "F1" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "F2" | ||
* keyup | ||
PASS keyboardEvent.code is "F2" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "F3" | ||
* keyup | ||
PASS keyboardEvent.code is "F3" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "F4" | ||
* keyup | ||
PASS keyboardEvent.code is "F4" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "F5" | ||
* keyup | ||
PASS keyboardEvent.code is "F5" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "F6" | ||
* keyup | ||
PASS keyboardEvent.code is "F6" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "F7" | ||
* keyup | ||
PASS keyboardEvent.code is "F7" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "F8" | ||
* keyup | ||
PASS keyboardEvent.code is "F8" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "F9" | ||
* keyup | ||
PASS keyboardEvent.code is "F9" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "F10" | ||
* keyup | ||
PASS keyboardEvent.code is "F10" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "F11" | ||
* keyup | ||
PASS keyboardEvent.code is "F11" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "F12" | ||
* keyup | ||
PASS keyboardEvent.code is "F12" | ||
|
||
* keydown | ||
FAIL keyboardEvent.code should be NumpadEnter. Was Enter. | ||
* keyup | ||
FAIL keyboardEvent.code should be NumpadEnter. Was Enter. | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "KeyA" | ||
* keyup | ||
PASS keyboardEvent.code is "KeyA" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "KeyA" | ||
* keyup | ||
PASS keyboardEvent.code is "KeyA" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "KeyA" | ||
* keyup | ||
PASS keyboardEvent.code is "KeyA" | ||
|
||
* keydown | ||
PASS keyboardEvent.code is "Digit1" | ||
* keyup | ||
PASS keyboardEvent.code is "Digit1" | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.