[Mac] Set NSApplication current event while sending events directly to views
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Oct 2013 22:45:17 +0000 (22:45 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Oct 2013 22:45:17 +0000 (22:45 +0000)
commita0e046c326c83316c84aa72bea3e46e2af8341ea
tree1acae05432e76219979ec59adfc8ec84f0a9952f
parentabfde405b2566b9a8788620f8ba9325b855c0844
[Mac] Set NSApplication current event while sending events directly to views
https://bugs.webkit.org/show_bug.cgi?id=122179

Reviewed by Darin Adler.

DumpRenderTree and WebKitTestRunner send events directly to WebHMTLView or WKView,
which doesn't update [NSApp currentEvent]. But there are many places in WebKit that
use the current event.

* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseDown:withModifiers:]):
(-[EventSendingController mouseUp:withModifiers:]):
(-[EventSendingController mouseMoveToX:Y:]):
(-[EventSendingController mouseScrollByX:andY:continuously:]):
(-[EventSendingController contextClick]):
(-[EventSendingController keyDown:withModifiers:withLocation:]):
* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::mouseDown):
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):
(WTR::EventSenderProxy::keyDown):
(WTR::EventSenderProxy::mouseScrollBy):
Update the current event. We were already using the SPI in WebKit.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/DumpRenderTree/mac/EventSendingController.mm
Tools/WebKitTestRunner/mac/EventSenderProxy.mm