Web Replay: capture and replay keyboard events
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Mar 2014 00:52:46 +0000 (00:52 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Mar 2014 00:52:46 +0000 (00:52 +0000)
commit51c051467706d171079bb6220867197e5c6549f4
tree0f77dd8307441e56d91091bf05d7496563e07dfc
parentf6f47d9e5c18a3460a0fef097b802411d15b2e25
Web Replay: capture and replay keyboard events
https://bugs.webkit.org/show_bug.cgi?id=130314

Reviewed by Joseph Pecoraro.

.:

* ManualTests/inspector/replay-keyboard-events.html: Added.

Source/WebCore:

Upstream support for capturing and replaying non-IME keyboard input.
This works similarly to mouse events. It introduces optional fields and
macros to encode/decode them.

Test: ManualTests/inspector/replay-keyboard-events.html

* replay/ReplayInputDispatchMethods.cpp:
(WebCore::HandleKeyPress::dispatch):
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<NondeterministicInputBase>::encodeValue):
(JSC::EncodingTraits<NondeterministicInputBase>::decodeValue): Switch existing
encode/decode calls to use the shortening macros.
(JSC::EncodingTraits<KeypressCommand>::encodeValue): Added.
(JSC::EncodingTraits<KeypressCommand>::decodeValue): Added.
(JSC::PlatformKeyboardEventAppKit::PlatformKeyboardEventAppKit): Subclass
PlatformKeyboardEvent so that we can set AppKit-specific members not
initialized through the main constructors.
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue): Added.
(JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue): Added.
* replay/SerializationMethods.h:
* replay/UserInputBridge.cpp:
(WebCore::UserInputBridge::UserInputBridge): initialize m_state inside a guard.
(WebCore::UserInputBridge::handleKeyEvent): fill in the implementation.
* replay/WebInputs.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ChangeLog
ManualTests/inspector/replay-keyboard-events.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/replay/ReplayInputDispatchMethods.cpp
Source/WebCore/replay/SerializationMethods.cpp
Source/WebCore/replay/SerializationMethods.h
Source/WebCore/replay/UserInputBridge.cpp
Source/WebCore/replay/WebInputs.json