[WK2] [Mac] Implement a more-complete MouseDown/MouseUp/MouseMoveTo functions for...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2011 19:24:38 +0000 (19:24 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2011 19:24:38 +0000 (19:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=68108

This patch implements the event sender mouse events through WebKit2 UIProcess which is
closer to the real simulation than a WebProcess-only approach. The patch only supports Mac
platform as the first step so the existing code is still kept for other platforms.

Source/WebKit2:

Patch by Chang Shu <cshu@webkit.org> on 2011-09-21
Reviewed by Darin Adler.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetShouldSendEventsSynchronously):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::handleMouseEvent):
(WebKit::WebPageProxy::handleKeyboardEvent):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::setShouldSendEventsSynchronously):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::mouseEventSyncForTesting):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Patch by Chang Shu <cshu@webkit.org> on 2011-09-21
Reviewed by Darin Adler.

* WebKitTestRunner/EventSenderProxy.h:
(WTR::EventSenderProxy::EventSenderProxy):
(WTR::EventSenderProxy::leapForward):
(WTR::EventSenderProxy::currentEventTime):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::EventSendingController):
(WTR::EventSendingController::mouseDown):
(WTR::EventSendingController::mouseUp):
(WTR::EventSendingController::mouseMoveTo):
(WTR::EventSendingController::leapForward):
(WTR::EventSendingController::keyDown):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::eventTypeForMouseButtonAndAction):
(WTR::operator==):
(WTR::EventSenderProxy::updateClickCountForButton):
(WTR::EventSenderProxy::mouseDown):
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):
(WTR::EventSenderProxy::keyDown):
* WebKitTestRunner/qt/EventSenderProxyQt.cpp:
(WTR::EventSenderProxy::keyDown):
(WTR::EventSenderProxy::mouseDown):
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):

LayoutTests:

Unskip the passed tests.

Patch by Chang Shu <cshu@webkit.org> on 2011-09-21
Reviewed by Darin Adler.

* platform/mac-wk2/Skipped:
* platform/wk2/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95660 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/Skipped
LayoutTests/platform/wk2/Skipped
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPagePrivate.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Tools/ChangeLog
Tools/WebKitTestRunner/EventSenderProxy.h
Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/mac/EventSenderProxy.mm
Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp

index d8cb5e2..4000386 100644 (file)
@@ -1,3 +1,19 @@
+2011-09-21  Chang Shu  <cshu@webkit.org>
+
+        [WK2] [Mac] Implement a more-complete MouseDown/MouseUp/MouseMoveTo functions for WebKit2 EventSender
+        https://bugs.webkit.org/show_bug.cgi?id=68108
+
+        This patch implements the event sender mouse events through WebKit2 UIProcess which is
+        closer to the real simulation than a WebProcess-only approach. The patch only supports Mac
+        platform as the first step so the existing code is still kept for other platforms.
+
+        Unskip the passed tests.
+
+        Reviewed by Darin Adler.
+
+        * platform/mac-wk2/Skipped:
+        * platform/wk2/Skipped:
+
 2011-09-21  Dan Bernstein  <mitz@apple.com>
 
         <rdar://problem/9768483> REGRESSION: Crash in RenderBlock::removeFloatingObjectsBelow()
index f768156..cd1ed0d 100644 (file)
 
 # WebKitTestRunner needs an implementation of eventSender
 # <https://bugs.webkit.org/show_bug.cgi?id=42194>
-editing/deleting/delete-ligature-003.html
-editing/deleting/smart-delete-001.html
-editing/deleting/smart-delete-002.html
-editing/deleting/smart-delete-003.html
-editing/deleting/smart-delete-004.html
-editing/execCommand/findString-2.html
-editing/pasteboard/4944770-2.html
 editing/pasteboard/4947130.html
 editing/pasteboard/copy-standalone-image-crash.html
 editing/pasteboard/drag-and-drop-image-contenteditable.html
@@ -66,19 +59,12 @@ editing/pasteboard/drop-link.html
 editing/pasteboard/drop-text-events.html
 editing/pasteboard/drop-text-without-selection.html
 editing/pasteboard/emacs-cntl-y-001.html
-editing/pasteboard/emacs-ctrl-a-k-y.html
 editing/pasteboard/emacs-ctrl-k-y-001.html
 editing/pasteboard/file-input-files-access.html
 editing/pasteboard/files-during-page-drags.html
 editing/pasteboard/get-data-text-plain-drop.html
 editing/pasteboard/smart-drag-drop.html
-editing/pasteboard/smart-paste-001.html
-editing/pasteboard/smart-paste-002.html
-editing/pasteboard/smart-paste-003.html
 editing/pasteboard/smart-paste-004.html
-editing/pasteboard/smart-paste-005.html
-editing/pasteboard/smart-paste-007.html
-editing/pasteboard/smart-paste-008.html
 editing/pasteboard/subframe-dragndrop-1.html
 editing/selection/14971.html
 editing/selection/4895428-1.html
@@ -91,13 +77,11 @@ editing/selection/5354455-2.html
 editing/selection/anchor-focus2.html
 editing/selection/anchor-focus3.html
 editing/selection/button-right-click.html
-editing/selection/click-in-focusable-link-should-not-clear-selection.html
 editing/selection/click-in-margins-inside-editable-div.html
 editing/selection/click-in-padding-with-multiple-line-boxes.html
 editing/selection/contains-boundaries.html
 editing/selection/context-menu-on-text.html
 editing/selection/doubleclick-beside-cr-span.html
-editing/selection/doubleclick-crash.html
 editing/selection/doubleclick-whitespace-crash.html
 editing/selection/doubleclick-whitespace-img-crash.html
 editing/selection/doubleclick-whitespace.html
@@ -106,11 +90,8 @@ editing/selection/drag-select-rapidly.html
 editing/selection/drag-start-event-client-x-y.html
 editing/selection/drag-to-contenteditable-iframe.html
 editing/selection/empty-cell-right-click.html
-editing/selection/expanding-selections.html
-editing/selection/expanding-selections2.html
 editing/selection/extend-after-mouse-selection.html
 editing/selection/extend-selection-after-double-click.html
-editing/selection/fake-doubleclick.html
 editing/selection/fake-drag.html
 editing/selection/inline-closest-leaf-child.html
 editing/selection/last-empty-inline.html
@@ -127,14 +108,11 @@ editing/selection/user-drag-element-and-user-select-none.html
 editing/selection/word-granularity.html
 editing/spelling/context-menu-suggestions.html
 editing/spelling/spellcheck-paste.html
-editing/undo/undo-deleteWord.html
 editing/undo/undo-smart-delete-reversed-selection.html
-editing/undo/undo-smart-delete-word.html
 fast/block/positioning/hittest-on-relative-positioned-children.html
 fast/css/user-drag-none.html
 fast/dom/Window/window-postmessage-clone-frames.html
 fast/dom/Window/window-postmessage-clone.html
-fast/dom/horizontal-scrollbar-in-rtl.html
 fast/dom/vertical-scrollbar-in-rtl.html
 fast/dynamic/layer-hit-test-crash.html
 fast/encoding/mailto-always-utf-8.html
@@ -177,14 +155,11 @@ fast/events/remove-child-onscroll.html
 fast/events/right-click-focus.html
 fast/events/scroll-after-click-on-tab-index.html
 fast/events/scroll-in-scaled-page-with-overflow-hidden.html
-fast/events/scrollbar-double-click.html
-fast/events/selectstart-by-double-triple-clicks.html
 fast/events/selectstart-by-drag.html
 fast/events/selectstart-prevent-selection-on-right-click.html
 fast/events/standalone-image-drag-to-editable.html
 fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html
 fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html
-fast/events/zoom-dblclick.html
 fast/files/apply-blob-url-to-xhr.html
 fast/files/file-reader-abort.html
 fast/files/read-blob-async.html
@@ -194,14 +169,9 @@ fast/forms/drag-out-of-textarea.html
 fast/forms/get-file-upload.html
 fast/forms/input-file-re-render.html
 fast/forms/input-readonly-autoscroll.html
-fast/forms/input-text-double-click.html
 fast/forms/input-text-drag-down.html
 fast/forms/listbox-typeahead-cyrillic.html
 fast/forms/listbox-typeahead-greek.html
-fast/forms/onselect-textarea.html
-fast/forms/onselect-textfield.html
-fast/forms/option-mouseevents.html
-fast/forms/range/slider-delete-while-dragging-thumb.html
 fast/forms/range/slider-mouse-events.html
 fast/forms/range/slider-onchange-event.html
 fast/forms/select-type-ahead-non-latin.html
@@ -211,15 +181,6 @@ fast/loader/policy-delegate-action-hit-test-zoomed.html
 fast/repaint/japanese-rl-selection-repaint.html
 fast/repaint/repaint-across-writing-mode-boundary.html
 fast/repaint/selection-rl.html
-fast/text/atsui-rtl-override-selection.html
-fast/text/international/khmer-selection.html
-fast/text/offsetForPosition-complex-fallback.html
-fast/text/reset-drag-on-mouse-down.html
-fast/writing-mode/horizontal-bt-replaced-selection.html
-fast/writing-mode/japanese-lr-selection.html
-fast/writing-mode/japanese-rl-selection.html
-fast/writing-mode/vertical-lr-replaced-selection.html
-fast/writing-mode/vertical-rl-replaced-selection.html
 http/tests/local/blob/send-hybrid-blob.html
 http/tests/local/drag-over-remote-content.html
 http/tests/local/fileapi/file-last-modified.html
@@ -238,19 +199,11 @@ http/tests/security/drag-over-remote-content-iframe.html
 media/controls-right-click-on-timebar.html
 platform/mac/editing/pasteboard/dataTransfer-set-data-file-url.html
 platform/mac/editing/pasteboard/drag-selections-to-contenteditable.html
-platform/mac/editing/selection/doubleclick-should-not-expand-across-lines.html
-platform/mac/editing/selection/word-thai.html
 platform/mac/fast/forms/listbox-scrollbar-hit-test.html
-platform/mac/fast/overflow/overflow-scrollbar-hit-test.html
 plugins/clicking-missing-plugin-fires-delegate.html
 scrollbars/scrollbar-iframe-click-does-not-blur-content.html
 scrollbars/scrollevent-iframe-no-scrolling-wheel.html
-
 svg/custom/foreignObject-crash-on-hover.xml
-svg/custom/mouse-move-on-svg-container-standalone.svg
-svg/custom/mouse-move-on-svg-container.xhtml
-svg/custom/mouse-move-on-svg-root-standalone.svg
-svg/custom/mouse-move-on-svg-root.xhtml
 svg/custom/use-events-crash.svg
 
 ### END OF (1) Classified failures with bug reports
index 61e75a4..bd15a1a 100644 (file)
@@ -673,11 +673,15 @@ plugins/netscape-plugin-setwindow-size-2.html
 
 # WebKitTestRunner needs layoutTestController.setEditingBehavior
 # <https://bugs.webkit.org/show_bug.cgi?id=42689>
+editing/deleting/delete-ligature-003.html
+editing/deleting/paragraph-in-preserveNewline.html
+editing/deleting/whitespace-pre-1.html
 editing/selection/after-line-break.html
 editing/selection/rtl-move-selection-right-left.html
 editing/selection/5195166-1.html
 editing/selection/context-menu-text-selection.html
 editing/selection/directionality-after-undo-replace.html
+editing/selection/programmatic-selection-on-mac-is-directionless.html
 editing/execCommand/query-command-state.html
 editing/execCommand/query-text-alignment.html
 editing/execCommand/toggle-compound-styles.html
@@ -686,9 +690,6 @@ editing/style/iframe-onload-crash-unix.html
 editing/style/iframe-onload-crash-win.html
 fast/events/backspace-navigates-back.html
 fast/forms/selection-direction.html
-editing/deleting/paragraph-in-preserveNewline.html
-editing/deleting/whitespace-pre-1.html
-editing/selection/programmatic-selection-on-mac-is-directionless.html
 
 # WebKitTestRunner needs layoutTestController.setStopProvisionalFrameLoads
 # <https://bugs.webkit.org/show_bug.cgi?id=42691>
index 846e6ce..761ba4c 100644 (file)
@@ -1,3 +1,28 @@
+2011-09-21  Chang Shu  <cshu@webkit.org>
+
+        [WK2] [Mac] Implement a more-complete MouseDown/MouseUp/MouseMoveTo functions for WebKit2 EventSender
+        https://bugs.webkit.org/show_bug.cgi?id=68108
+
+        This patch implements the event sender mouse events through WebKit2 UIProcess which is
+        closer to the real simulation than a WebProcess-only approach. The patch only supports Mac
+        platform as the first step so the existing code is still kept for other platforms.
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageSetShouldSendEventsSynchronously):
+        * UIProcess/API/C/WKPagePrivate.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        (WebKit::WebPageProxy::handleMouseEvent):
+        (WebKit::WebPageProxy::handleKeyboardEvent):
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::setShouldSendEventsSynchronously):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::mouseEventSyncForTesting):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+
 2011-09-21  Dan Bernstein  <mitz@apple.com>
 
         WebKit2 part of: Prevent the WebKit frameworks from defining inappropriately-named Objective-C classes
index 8257304..8c18d58 100644 (file)
@@ -581,7 +581,7 @@ WKImageRef WKPageCreateSnapshotOfVisibleContent(WKPageRef)
     return 0;
 }
 
-void WKPageSetShouldSendKeyboardEventSynchronously(WKPageRef page, bool sync)
+void WKPageSetShouldSendEventsSynchronously(WKPageRef page, bool sync)
 {
-    toImpl(page)->setShouldSendKeyboardEventSynchronously(sync);
+    toImpl(page)->setShouldSendEventsSynchronously(sync);
 }
index 5f1eadb..67a3040 100644 (file)
@@ -69,7 +69,7 @@ WK_EXPORT void WKPageDrawPagesToPDF(WKPageRef page, WKFrameRef frame, uint32_t f
 // FIXME https://bugs.webkit.org/show_bug.cgi?id=66979: Remove this sync call.
 WK_EXPORT WKImageRef WKPageCreateSnapshotOfVisibleContent(WKPageRef page);
 
-WK_EXPORT void WKPageSetShouldSendKeyboardEventSynchronously(WKPageRef page, bool sync);
+WK_EXPORT void WKPageSetShouldSendEventsSynchronously(WKPageRef page, bool sync);
 
 #ifdef __cplusplus
 }
index 5789e14..0acb684 100644 (file)
@@ -180,7 +180,7 @@ WebPageProxy::WebPageProxy(PageClient* pageClient, PassRefPtr<WebProcessProxy> p
     , m_mainFrameIsPinnedToLeftSide(false)
     , m_mainFrameIsPinnedToRightSide(false)
     , m_renderTreeSize(0)
-    , m_shouldSendKeyboardEventSynchronously(false)
+    , m_shouldSendEventsSynchronously(false)
 {
 #ifndef NDEBUG
     webPageProxyCounter.increment();
@@ -832,7 +832,12 @@ void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event)
     if (event.type() == WebEvent::MouseDown)
         m_currentlyProcessedMouseDownEvent = adoptPtr(new NativeWebMouseEvent(event));
 
-    process()->send(Messages::WebPage::MouseEvent(event), m_pageID);
+    if (m_shouldSendEventsSynchronously) {
+        bool handled = false;
+        process()->sendSync(Messages::WebPage::MouseEventSyncForTesting(event), Messages::WebPage::MouseEventSyncForTesting::Reply(handled), m_pageID);
+        didReceiveEvent(event.type(), handled);
+    } else
+        process()->send(Messages::WebPage::MouseEvent(event), m_pageID);
 }
 
 void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event)
@@ -861,7 +866,7 @@ void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
     m_keyEventQueue.append(event);
 
     process()->responsivenessTimer()->start();
-    if (m_shouldSendKeyboardEventSynchronously) {
+    if (m_shouldSendEventsSynchronously) {
         bool handled = false;
         process()->sendSync(Messages::WebPage::KeyEventSyncForTesting(event), Messages::WebPage::KeyEventSyncForTesting::Reply(handled), m_pageID);
         didReceiveEvent(event.type(), handled);
index 5e3c9fb..b0ab796 100644 (file)
@@ -563,7 +563,7 @@ public:
 
     uint64_t renderTreeSize() const { return m_renderTreeSize; }
 
-    void setShouldSendKeyboardEventSynchronously(bool sync) { m_shouldSendKeyboardEventSynchronously = sync; };
+    void setShouldSendEventsSynchronously(bool sync) { m_shouldSendEventsSynchronously = sync; };
 
 private:
     WebPageProxy(PageClient*, PassRefPtr<WebProcessProxy>, WebPageGroup*, uint64_t pageID);
@@ -935,7 +935,7 @@ private:
 
     static WKPageDebugPaintFlags s_debugPaintFlags;
 
-    bool m_shouldSendKeyboardEventSynchronously;
+    bool m_shouldSendEventsSynchronously;
 };
 
 } // namespace WebKit
index e257663..a3a9b2a 100644 (file)
@@ -1049,6 +1049,25 @@ void WebPage::mouseEvent(const WebMouseEvent& mouseEvent)
     send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(mouseEvent.type()), handled));
 }
 
+void WebPage::mouseEventSyncForTesting(const WebMouseEvent& mouseEvent, bool& handled)
+{
+    // Don't try to handle any pending mouse events if a context menu is showing.
+    if (m_isShowingContextMenu) {
+        handled = true;
+        return;
+    }
+    
+    if (m_pageOverlay) {
+        // Let the page overlay handle the event.
+        handled = m_pageOverlay->mouseEvent(mouseEvent);
+    }
+
+    if (!handled) {
+        CurrentEvent currentEvent(mouseEvent);
+        handled = handleMouseEvent(mouseEvent, m_page.get());
+    }
+}
+
 static bool handleWheelEvent(const WebWheelEvent& wheelEvent, Page* page)
 {
     Frame* frame = page->mainFrame();
index ff65981..cbb88fe 100644 (file)
@@ -475,6 +475,7 @@ private:
     void executeEditCommand(const String&);
 
     void mouseEvent(const WebMouseEvent&);
+    void mouseEventSyncForTesting(const WebMouseEvent&, bool&);
     void wheelEvent(const WebWheelEvent&);
     void keyEvent(const WebKeyboardEvent&);
     void keyEventSyncForTesting(const WebKeyboardEvent&, bool&);
index 494b7ce..c26f2e3 100644 (file)
@@ -35,6 +35,7 @@ messages -> WebPage {
     KeyEvent(WebKit::WebKeyboardEvent event)
     KeyEventSyncForTesting(WebKit::WebKeyboardEvent event) -> (bool handled)
     MouseEvent(WebKit::WebMouseEvent event)
+    MouseEventSyncForTesting(WebKit::WebMouseEvent event) -> (bool handled)
     WheelEvent(WebKit::WebWheelEvent event)
 #if ENABLE(GESTURE_EVENTS)
     GestureEvent(WebKit::WebGestureEvent event)
index d33e6f1..213b54d 100644 (file)
@@ -1,3 +1,42 @@
+2011-09-21  Chang Shu  <cshu@webkit.org>
+
+        [WK2] [Mac] Implement a more-complete MouseDown/MouseUp/MouseMoveTo functions for WebKit2 EventSender
+        https://bugs.webkit.org/show_bug.cgi?id=68108
+
+        This patch implements the event sender mouse events through WebKit2 UIProcess which is
+        closer to the real simulation than a WebProcess-only approach. The patch only supports Mac
+        platform as the first step so the existing code is still kept for other platforms.
+
+        Reviewed by Darin Adler.
+
+        * WebKitTestRunner/EventSenderProxy.h:
+        (WTR::EventSenderProxy::EventSenderProxy):
+        (WTR::EventSenderProxy::leapForward):
+        (WTR::EventSenderProxy::currentEventTime):
+        * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
+        (WTR::EventSendingController::EventSendingController):
+        (WTR::EventSendingController::mouseDown):
+        (WTR::EventSendingController::mouseUp):
+        (WTR::EventSendingController::mouseMoveTo):
+        (WTR::EventSendingController::leapForward):
+        (WTR::EventSendingController::keyDown):
+        * WebKitTestRunner/InjectedBundle/EventSendingController.h:
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
+        * WebKitTestRunner/mac/EventSenderProxy.mm:
+        (WTR::eventTypeForMouseButtonAndAction):
+        (WTR::operator==):
+        (WTR::EventSenderProxy::updateClickCountForButton):
+        (WTR::EventSenderProxy::mouseDown):
+        (WTR::EventSenderProxy::mouseUp):
+        (WTR::EventSenderProxy::mouseMoveTo):
+        (WTR::EventSenderProxy::keyDown):
+        * WebKitTestRunner/qt/EventSenderProxyQt.cpp:
+        (WTR::EventSenderProxy::keyDown):
+        (WTR::EventSenderProxy::mouseDown):
+        (WTR::EventSenderProxy::mouseUp):
+        (WTR::EventSenderProxy::mouseMoveTo):
+
 2011-09-21  Dan Bernstein  <mitz@apple.com>
 
         Tools part of: Prevent the WebKit frameworks from defining inappropriately-named Objective-C classes
index 2e392f9..a5f6999 100644 (file)
@@ -33,12 +33,40 @@ class TestController;
 
 class EventSenderProxy {
 public:
-    EventSenderProxy(TestController* testController) : m_testController(testController) { }
+    EventSenderProxy(TestController* testController)
+        : m_testController(testController)
+        , m_time(0)
+        , m_position()
+        , m_leftMouseButtonDown(false)
+        , m_clickCount(0)
+        , m_clickTime(0)
+        , m_clickPosition()
+        , m_clickButton(kWKEventMouseButtonNoButton)
+        , eventNumber(0)
+    {
+    }
 
-    void keyDown(WKStringRef key, WKEventModifiers, unsigned location, double timestamp);
+    void mouseDown(unsigned button, WKEventModifiers);
+    void mouseUp(unsigned button, WKEventModifiers);
+    void mouseMoveTo(double x, double y);
+    void leapForward(int milliseconds) { m_time += milliseconds / 1000.0; }
+
+    void keyDown(WKStringRef key, WKEventModifiers, unsigned location);
 
 private:
     TestController* m_testController;
+
+    double currentEventTime() { return m_time; }
+    void updateClickCountForButton(int button);
+
+    double m_time;
+    WKPoint m_position;
+    bool m_leftMouseButtonDown;
+    int m_clickCount;
+    double m_clickTime;
+    WKPoint m_clickPosition;
+    WKEventMouseButton m_clickButton;
+    int eventNumber;
 };
 
 } // namespace WTR
index 022ec1c..09dc61f 100644 (file)
@@ -41,10 +41,12 @@ namespace WTR {
 
 static const float ZoomMultiplierRatio = 1.2f;
 
+#ifdef USE_WEBPROCESS_EVENT_SIMULATION
 static bool operator==(const WKPoint& a, const WKPoint& b)
 {
     return a.x == b.x && a.y == b.y;
 }
+#endif
 
 static WKEventModifiers parseModifier(JSStringRef modifier)
 {
@@ -96,12 +98,14 @@ PassRefPtr<EventSendingController> EventSendingController::create()
 }
 
 EventSendingController::EventSendingController()
+#ifdef USE_WEBPROCESS_EVENT_SIMULATION
     : m_time(0)
     , m_position()
     , m_clickCount(0)
     , m_clickTime(0)
     , m_clickPosition()
     , m_clickButton(kWKEventMouseButtonNoButton)
+#endif
 {
 }
 
@@ -120,8 +124,28 @@ void EventSendingController::mouseDown(int button, JSValueRef modifierArray)
     WKBundleFrameRef frame = WKBundlePageGetMainFrame(page);
     JSContextRef context = WKBundleFrameGetJavaScriptContext(frame);
     WKEventModifiers modifiers = parseModifierArray(context, modifierArray);
+
+#ifdef USE_WEBPROCESS_EVENT_SIMULATION
     updateClickCount(button);
     WKBundlePageSimulateMouseDown(page, button, m_position, m_clickCount, modifiers, m_time);
+#else
+    WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
+    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
+
+    WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
+    WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("MouseDown"));
+    WKDictionaryAddItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
+
+    WKRetainPtr<WKStringRef> buttonKey = adoptWK(WKStringCreateWithUTF8CString("Button"));
+    WKRetainPtr<WKUInt64Ref> buttonRef = WKUInt64Create(button);
+    WKDictionaryAddItem(EventSenderMessageBody.get(), buttonKey.get(), buttonRef.get());
+
+    WKRetainPtr<WKStringRef> modifiersKey = adoptWK(WKStringCreateWithUTF8CString("Modifiers"));
+    WKRetainPtr<WKUInt64Ref> modifiersRef = WKUInt64Create(modifiers);
+    WKDictionaryAddItem(EventSenderMessageBody.get(), modifiersKey.get(), modifiersRef.get());
+
+    WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
+#endif
 }
 
 void EventSendingController::mouseUp(int button, JSValueRef modifierArray)
@@ -130,22 +154,78 @@ void EventSendingController::mouseUp(int button, JSValueRef modifierArray)
     WKBundleFrameRef frame = WKBundlePageGetMainFrame(page);
     JSContextRef context = WKBundleFrameGetJavaScriptContext(frame);
     WKEventModifiers modifiers = parseModifierArray(context, modifierArray);
+
+#ifdef USE_WEBPROCESS_EVENT_SIMULATION
     updateClickCount(button);
     WKBundlePageSimulateMouseUp(page, button, m_position, m_clickCount, modifiers, m_time);
+#else
+    WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
+    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
+
+    WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
+    WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("MouseUp"));
+    WKDictionaryAddItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
+
+    WKRetainPtr<WKStringRef> buttonKey = adoptWK(WKStringCreateWithUTF8CString("Button"));
+    WKRetainPtr<WKUInt64Ref> buttonRef = WKUInt64Create(button);
+    WKDictionaryAddItem(EventSenderMessageBody.get(), buttonKey.get(), buttonRef.get());
+
+    WKRetainPtr<WKStringRef> modifiersKey = adoptWK(WKStringCreateWithUTF8CString("Modifiers"));
+    WKRetainPtr<WKUInt64Ref> modifiersRef = WKUInt64Create(modifiers);
+    WKDictionaryAddItem(EventSenderMessageBody.get(), modifiersKey.get(), modifiersRef.get());
+
+    WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
+#endif
 }
 
 void EventSendingController::mouseMoveTo(int x, int y)
 {
+#ifdef USE_WEBPROCESS_EVENT_SIMULATION
     m_position.x = x;
     m_position.y = y;
     WKBundlePageSimulateMouseMotion(InjectedBundle::shared().page()->page(), m_position, m_time);
+#else
+    WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
+    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
+
+    WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
+    WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("MouseMoveTo"));
+    WKDictionaryAddItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
+
+    WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X"));
+    WKRetainPtr<WKDoubleRef> xRef = WKDoubleCreate(x);
+    WKDictionaryAddItem(EventSenderMessageBody.get(), xKey.get(), xRef.get());
+
+    WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y"));
+    WKRetainPtr<WKDoubleRef> yRef = WKDoubleCreate(y);
+    WKDictionaryAddItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
+
+    WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
+#endif
 }
 
 void EventSendingController::leapForward(int milliseconds)
 {
+#ifdef USE_WEBPROCESS_EVENT_SIMULATION
     m_time += milliseconds / 1000.0;
+#else
+    WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
+    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
+
+    WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
+    WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("LeapForward"));
+    WKDictionaryAddItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
+
+    WKRetainPtr<WKStringRef> timeKey = adoptWK(WKStringCreateWithUTF8CString("TimeInMilliseconds"));
+    WKRetainPtr<WKUInt64Ref> timeRef = WKUInt64Create(milliseconds);
+    WKDictionaryAddItem(EventSenderMessageBody.get(), timeKey.get(), timeRef.get());
+
+    WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
+#endif
 }
 
+
+#ifdef USE_WEBPROCESS_EVENT_SIMULATION
 void EventSendingController::updateClickCount(WKEventMouseButton button)
 {
     if (m_time - m_clickTime < 1 && m_position == m_clickPosition && button == m_clickButton) {
@@ -159,6 +239,7 @@ void EventSendingController::updateClickCount(WKEventMouseButton button)
     m_clickPosition = m_position;
     m_clickButton = button;
 }
+#endif
 
 void EventSendingController::textZoomIn()
 {
@@ -234,10 +315,6 @@ void EventSendingController::keyDown(JSStringRef key, JSValueRef modifierArray,
     WKRetainPtr<WKUInt64Ref> locationRef = WKUInt64Create(location);
     WKDictionaryAddItem(EventSenderMessageBody.get(), locationKey.get(), locationRef.get());
 
-    WKRetainPtr<WKStringRef> timestampKey = adoptWK(WKStringCreateWithUTF8CString("Timestamp"));
-    WKRetainPtr<WKDoubleRef> timeRef = WKDoubleCreate(m_time);
-    WKDictionaryAddItem(EventSenderMessageBody.get(), timestampKey.get(), timeRef.get());
-
     WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
 }
 
index 02be9a9..5c8e367 100644 (file)
 #include <WebKit2/WKGeometry.h>
 #include <wtf/PassRefPtr.h>
 
+#if !PLATFORM(MAC)
+#define USE_WEBPROCESS_EVENT_SIMULATION
+#endif
+
 namespace WTR {
 
 class EventSendingController : public JSWrappable {
@@ -60,6 +64,7 @@ public:
 private:
     EventSendingController();
 
+#ifdef USE_WEBPROCESS_EVENT_SIMULATION
     void updateClickCount(WKEventMouseButton);
 
     double m_time;
@@ -69,6 +74,7 @@ private:
     double m_clickTime;
     WKPoint m_clickPosition;
     WKEventMouseButton m_clickButton;
+#endif
 };
 
 } // namespace WTR
index 1dcb6e5..132397d 100644 (file)
@@ -32,6 +32,7 @@
 #include <WebKit2/WKContextPrivate.h>
 #include <WebKit2/WKNumber.h>
 #include <WebKit2/WKPageGroup.h>
+#include <WebKit2/WKPagePrivate.h>
 #include <WebKit2/WKPreferencesPrivate.h>
 #include <WebKit2/WKRetainPtr.h>
 #include <cstdio>
@@ -535,13 +536,52 @@ WKRetainPtr<WKTypeRef> TestController::didReceiveSynchronousMessageFromInjectedB
             WKRetainPtr<WKStringRef> locationKey = adoptWK(WKStringCreateWithUTF8CString("Location"));
             unsigned location = static_cast<unsigned>(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, locationKey.get()))));
 
-            WKRetainPtr<WKStringRef> timestampKey = adoptWK(WKStringCreateWithUTF8CString("Timestamp"));
-            double timestamp = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, timestampKey.get())));
+            // Forward to WebProcess
+            WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
+            m_eventSenderProxy->keyDown(key, modifiers, location);
+            WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
+            return 0;
+        }
+
+        if (WKStringIsEqualToUTF8CString(subMessageName, "MouseDown") || WKStringIsEqualToUTF8CString(subMessageName, "MouseUp")) {
+            WKRetainPtr<WKStringRef> buttonKey = adoptWK(WKStringCreateWithUTF8CString("Button"));
+            unsigned button = static_cast<unsigned>(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, buttonKey.get()))));
+
+            WKRetainPtr<WKStringRef> modifiersKey = adoptWK(WKStringCreateWithUTF8CString("Modifiers"));
+            WKEventModifiers modifiers = static_cast<WKEventModifiers>(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, modifiersKey.get()))));
+
+            // Forward to WebProcess
+            WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
+            if (WKStringIsEqualToUTF8CString(subMessageName, "MouseDown"))
+                m_eventSenderProxy->mouseDown(button, modifiers);
+            else
+                m_eventSenderProxy->mouseUp(button, modifiers);
+            WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
+            return 0;
+        }
+
+        if (WKStringIsEqualToUTF8CString(subMessageName, "MouseMoveTo")) {
+            WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X"));
+            double x = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, xKey.get())));
+
+            WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y"));
+            double y = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, yKey.get())));
 
             // Forward to WebProcess
-            m_eventSenderProxy->keyDown(key, modifiers, location, timestamp);
+            WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
+            m_eventSenderProxy->mouseMoveTo(x, y);
+            WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
             return 0;
         }
+
+        if (WKStringIsEqualToUTF8CString(subMessageName, "LeapForward")) {
+            WKRetainPtr<WKStringRef> timeKey = adoptWK(WKStringCreateWithUTF8CString("TimeInMilliseconds"));
+            unsigned time = static_cast<unsigned>(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, timeKey.get()))));
+
+            m_eventSenderProxy->leapForward(time);
+            return 0;
+        }
+
         ASSERT_NOT_REACHED();
     }
 #endif
index 1b944f6..d82b964 100644 (file)
 #import "StringFunctions.h"
 #import "PlatformWebView.h"
 #import "TestController.h"
-#import <WebKit2/WKPagePrivate.h>
 #import <WebKit2/WKString.h>
 
 namespace WTR {
 
+enum MouseAction {
+    MouseDown,
+    MouseUp,
+    MouseDragged
+};
+
+// Match the DOM spec (sadly the DOM spec does not provide an enum)
+enum MouseButton {
+    LeftMouseButton = 0,
+    MiddleMouseButton = 1,
+    RightMouseButton = 2,
+    NoMouseButton = -1
+};
+
+static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction action)
+{
+    switch (button) {
+        case LeftMouseButton:
+            switch (action) {
+                case MouseDown:
+                    return NSLeftMouseDown;
+                case MouseUp:
+                    return NSLeftMouseUp;
+                case MouseDragged:
+                    return NSLeftMouseDragged;
+            }
+        case RightMouseButton:
+            switch (action) {
+                case MouseDown:
+                    return NSRightMouseDown;
+                case MouseUp:
+                    return NSRightMouseUp;
+                case MouseDragged:
+                    return NSRightMouseDragged;
+            }
+        default:
+            switch (action) {
+                case MouseDown:
+                    return NSOtherMouseDown;
+                case MouseUp:
+                    return NSOtherMouseUp;
+                case MouseDragged:
+                    return NSOtherMouseDragged;
+            }
+    }
+    assert(0);
+    return static_cast<NSEventType>(0);
+}
+
 static int buildModifierFlags(WKEventModifiers modifiers)
 {
     int flags = 0;
@@ -49,9 +97,95 @@ static int buildModifierFlags(WKEventModifiers modifiers)
     return flags;
 }
 
-void EventSenderProxy::keyDown(WKStringRef keyRef, WKEventModifiers modifiersRef, unsigned int keyLocation, double timestamp)
+static bool operator==(const WKPoint& a, const WKPoint& b)
+{
+    return a.x == b.x && a.y == b.y;
+}
+
+void EventSenderProxy::updateClickCountForButton(int button)
+{
+    if (m_time - m_clickTime < 1 && m_position == m_clickPosition && button == m_clickButton) {
+        ++m_clickCount;
+        m_clickTime = m_time;
+        return;
+    }
+
+    m_clickCount = 1;
+    m_clickTime = m_time;
+    m_clickPosition = m_position;
+    m_clickButton = button;
+}
+
+void EventSenderProxy::mouseDown(unsigned buttonNumber, WKEventModifiers modifiers)
 {
-    NSString* character = [NSString stringWithCString:toSTD(keyRef).c_str() 
+    updateClickCountForButton(buttonNumber);
+
+    NSEventType eventType = eventTypeForMouseButtonAndAction(buttonNumber, MouseDown);
+    NSEvent *event = [NSEvent mouseEventWithType:eventType
+                                        location:NSMakePoint(m_position.x, m_position.y)
+                                   modifierFlags:buildModifierFlags(modifiers)
+                                       timestamp:currentEventTime()
+                                    windowNumber:[m_testController->mainWebView()->platformWindow() windowNumber]
+                                         context:[NSGraphicsContext currentContext] 
+                                     eventNumber:++eventNumber 
+                                      clickCount:m_clickCount 
+                                        pressure:0.0];
+
+    NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:[event locationInWindow]];
+    if (targetView) {
+        [targetView mouseDown:event];
+        if (buttonNumber == LeftMouseButton)
+            m_leftMouseButtonDown = true;
+    }
+}
+
+void EventSenderProxy::mouseUp(unsigned buttonNumber, WKEventModifiers modifiers)
+{
+    NSEventType eventType = eventTypeForMouseButtonAndAction(buttonNumber, MouseUp);
+    NSEvent *event = [NSEvent mouseEventWithType:eventType
+                                        location:NSMakePoint(m_position.x, m_position.y)
+                                   modifierFlags:buildModifierFlags(modifiers)
+                                       timestamp:currentEventTime()
+                                    windowNumber:[m_testController->mainWebView()->platformWindow() windowNumber]
+                                         context:[NSGraphicsContext currentContext] 
+                                     eventNumber:++eventNumber 
+                                      clickCount:m_clickCount 
+                                        pressure:0.0];
+
+    NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:[event locationInWindow]];
+    targetView = targetView ? targetView : m_testController->mainWebView()->platformView();
+    assert(targetView);
+    [targetView mouseDown:event];
+    if (buttonNumber == LeftMouseButton)
+        m_leftMouseButtonDown = false;
+    m_clickTime = [event timestamp];
+    m_clickPosition = m_position;
+}
+
+void EventSenderProxy::mouseMoveTo(double x, double y)
+{
+    NSView *view = m_testController->mainWebView()->platformView();
+    NSPoint position = [view convertPoint:NSMakePoint(x, y) toView:nil];
+    m_position.x = position.x;
+    m_position.y = position.y;
+    NSEvent *event = [NSEvent mouseEventWithType:(m_leftMouseButtonDown ? NSLeftMouseDragged : NSMouseMoved)
+                                        location:position
+                                   modifierFlags:0 
+                                       timestamp:currentEventTime()
+                                    windowNumber:[[view window] windowNumber] 
+                                         context:[NSGraphicsContext currentContext] 
+                                     eventNumber:++eventNumber 
+                                      clickCount:(m_leftMouseButtonDown ? m_clickCount : 0) 
+                                        pressure:0.0];
+
+    NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:[event locationInWindow]];
+    if (targetView)
+        [targetView mouseMoved:event];
+}
+
+void EventSenderProxy::keyDown(WKStringRef key, WKEventModifiers modifiers, unsigned keyLocation)
+{
+    NSString* character = [NSString stringWithCString:toSTD(key).c_str() 
                                    encoding:[NSString defaultCStringEncoding]];
 
     NSString *eventCharacter = character;
@@ -170,19 +304,17 @@ void EventSenderProxy::keyDown(WKStringRef keyRef, WKEventModifiers modifiersRef
         charactersIgnoringModifiers = [character lowercaseString];
     }
 
-    modifierFlags |= buildModifierFlags(modifiersRef);
+    modifierFlags |= buildModifierFlags(modifiers);
 
     if (keyLocation == 0x03 /*DOM_KEY_LOCATION_NUMPAD*/)
         modifierFlags |= NSNumericPadKeyMask;
 
     // FIXME: [[[mainFrame frameView] documentView] layout];
 
-    WKPageSetShouldSendKeyboardEventSynchronously([m_testController->mainWebView()->platformView() pageRef], true);
-
     NSEvent *event = [NSEvent keyEventWithType:NSKeyDown
                         location:NSMakePoint(5, 5)
                         modifierFlags:modifierFlags
-                        timestamp:timestamp//[self currentEventTime]
+                        timestamp:currentEventTime()
                         windowNumber:[m_testController->mainWebView()->platformWindow() windowNumber]
                         context:[NSGraphicsContext currentContext]
                         characters:eventCharacter
@@ -195,7 +327,7 @@ void EventSenderProxy::keyDown(WKStringRef keyRef, WKEventModifiers modifiersRef
     event = [NSEvent keyEventWithType:NSKeyUp
                         location:NSMakePoint(5, 5)
                         modifierFlags:modifierFlags
-                        timestamp:timestamp//[self currentEventTime]
+                        timestamp:currentEventTime()
                         windowNumber:[m_testController->mainWebView()->platformWindow() windowNumber]
                         context:[NSGraphicsContext currentContext]
                         characters:eventCharacter
@@ -204,8 +336,6 @@ void EventSenderProxy::keyDown(WKStringRef keyRef, WKEventModifiers modifiersRef
                         keyCode:keyCode];
 
     [[m_testController->mainWebView()->platformWindow() firstResponder] keyUp:event];
-
-    WKPageSetShouldSendKeyboardEventSynchronously([m_testController->mainWebView()->platformView() pageRef], false);
 }
 
 } // namespace WTR
index 47eefb5..a95df1e 100644 (file)
@@ -29,6 +29,7 @@
 #include "PlatformWebView.h"
 #include "TestController.h"
 #include <QKeyEvent>
+#include <WebCore/NotImplemented.h>
 #include <WebKit2/WKPagePrivate.h>
 #include <WebKit2/WKStringQt.h>
 
@@ -57,10 +58,8 @@ Qt::KeyboardModifiers getModifiers(WKEventModifiers modifiersRef)
     return modifiers;
 }
 
-void EventSenderProxy::keyDown(WKStringRef keyRef, WKEventModifiers modifiersRef, unsigned location, double timestamp)
+void EventSenderProxy::keyDown(WKStringRef keyRef, WKEventModifiers modifiersRef, unsigned location)
 {
-    WKPageSetShouldSendKeyboardEventSynchronously(m_testController->mainWebView()->page(), true);
-
     const QString key = WKStringCopyQString(keyRef);
     QString keyText = key;
 
@@ -190,8 +189,21 @@ void EventSenderProxy::keyDown(WKStringRef keyRef, WKEventModifiers modifiersRef
     m_testController->mainWebView()->sendEvent(&event);
     QKeyEvent event2(QEvent::KeyRelease, code, modifiers, keyText);
     m_testController->mainWebView()->sendEvent(&event2);
+}
+
+void EventSenderProxy::mouseDown(unsigned, WKEventModifiers)
+{
+    notImplemented();
+}
 
-    WKPageSetShouldSendKeyboardEventSynchronously(m_testController->mainWebView()->page(), false);
+void EventSenderProxy::mouseUp(unsigned, WKEventModifiers)
+{
+    notImplemented();
+}
+
+void EventSenderProxy::mouseMoveTo(double, double)
+{
+    notImplemented();
 }
 
 } // namespace WTR