Title: [220000] trunk
Revision
220000
Author
csaave...@igalia.com
Date
2017-07-28 03:27:03 -0700 (Fri, 28 Jul 2017)

Log Message

[WPE] Implement EventSenderProxy in WTR
https://bugs.webkit.org/show_bug.cgi?id=173419

Reviewed by Žan Doberšek.

Add the implementation of EventSenderProxy to the WTR. This
allows us to extend the coverage of the test suite in WKWPE.

.:

* Source/cmake/FindLibxkbcommon.cmake: Added.

Tools:

* WebKitTestRunner/EventSenderProxy.h:
* WebKitTestRunner/PlatformWPE.cmake: Add dependency on
libxkbcommon needed to deal with key events.
* WebKitTestRunner/wpe/EventSenderProxyWPE.cpp:
(WTR::EventSenderProxy::EventSenderProxy):
(WTR::senderButtonToWPEButton):
(WTR::EventSenderProxy::mouseDown):
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):
(WTR::EventSenderProxy::mouseScrollBy):
(WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSenderProxy::leapForward):
(WTR::wkEventModifiersToWPE):
(WTR::getXKBKeySymForKeyRef):
(WTR::EventSenderProxy::keyDown):
(WTR::EventSenderProxy::addTouchPoint):
(WTR::EventSenderProxy::updateTouchPoint):
(WTR::EventSenderProxy::setTouchModifier):
(WTR::EventSenderProxy::setTouchPointRadius):
(WTR::EventSenderProxy::getUpdatedTouchEvents):
(WTR::EventSenderProxy::removeUpdatedTouchEvents):
(WTR::EventSenderProxy::prepareAndDispatchTouchEvent):
(WTR::EventSenderProxy::touchStart):
(WTR::EventSenderProxy::touchMove):
(WTR::EventSenderProxy::touchEnd):
(WTR::EventSenderProxy::touchCancel):
(WTR::EventSenderProxy::clearTouchPoints):
(WTR::EventSenderProxy::releaseTouchPoint):
(WTR::EventSenderProxy::cancelTouchPoint):

LayoutTests:

* platform/wpe/TestExpectations: Unskip fast/events tests, marking failures
that are related to features not yet implemented in WPE. Also remove other
tests that are now passing thanks to having event injection.
* platform/wpe/fast/dom/HTMLTableColElement/resize-table-using-col-width-expected.txt: Update.
* platform/wpe/fast/dynamic/layer-hit-test-crash-expected.txt: Update.
* platform/wpe/fast/events/clientXY-in-zoom-and-scroll-expected.txt: Added.
* platform/wpe/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.txt: Update.

Modified Paths

Added Paths

Diff

Modified: trunk/ChangeLog (219999 => 220000)


--- trunk/ChangeLog	2017-07-28 07:53:17 UTC (rev 219999)
+++ trunk/ChangeLog	2017-07-28 10:27:03 UTC (rev 220000)
@@ -1,3 +1,15 @@
+2017-07-28  Claudio Saavedra  <csaave...@igalia.com>
+
+        [WPE] Implement EventSenderProxy in WTR
+        https://bugs.webkit.org/show_bug.cgi?id=173419
+
+        Reviewed by Žan Doberšek.
+
+        Add the implementation of EventSenderProxy to the WTR. This
+        allows us to extend the coverage of the test suite in WKWPE.
+
+        * Source/cmake/FindLibxkbcommon.cmake: Added.
+
 2017-07-28  Zan Dobersek  <zdober...@igalia.com>
 
         Unreviewed. Bumping the patch version for WPEWebKit library to 20170728.

Modified: trunk/LayoutTests/ChangeLog (219999 => 220000)


--- trunk/LayoutTests/ChangeLog	2017-07-28 07:53:17 UTC (rev 219999)
+++ trunk/LayoutTests/ChangeLog	2017-07-28 10:27:03 UTC (rev 220000)
@@ -1,3 +1,21 @@
+2017-07-28  Claudio Saavedra  <csaave...@igalia.com>
+
+        [WPE] Implement EventSenderProxy in WTR
+        https://bugs.webkit.org/show_bug.cgi?id=173419
+
+        Reviewed by Žan Doberšek.
+
+        Add the implementation of EventSenderProxy to the WTR. This
+        allows us to extend the coverage of the test suite in WKWPE.
+
+        * platform/wpe/TestExpectations: Unskip fast/events tests, marking failures
+        that are related to features not yet implemented in WPE. Also remove other
+        tests that are now passing thanks to having event injection.
+        * platform/wpe/fast/dom/HTMLTableColElement/resize-table-using-col-width-expected.txt: Update.
+        * platform/wpe/fast/dynamic/layer-hit-test-crash-expected.txt: Update.
+        * platform/wpe/fast/events/clientXY-in-zoom-and-scroll-expected.txt: Added.
+        * platform/wpe/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.txt: Update.
+
 2017-07-27  Oleksandr Skachkov  <gskach...@gmail.com>
 
         [ES] Add support finally to Promise

Modified: trunk/LayoutTests/platform/wpe/TestExpectations (219999 => 220000)


--- trunk/LayoutTests/platform/wpe/TestExpectations	2017-07-28 07:53:17 UTC (rev 219999)
+++ trunk/LayoutTests/platform/wpe/TestExpectations	2017-07-28 10:27:03 UTC (rev 220000)
@@ -103,18 +103,6 @@
 Bug(WPE) ietestcenter/css3/multicolumn/column-width-applies-to-015.htm [ ImageOnlyFailure ]
 Bug(WPE) ietestcenter/css3/valuesandunits/units-000.htm [ ImageOnlyFailure ]
 
-Bug(WPE) scrollbars/scroll-rtl-or-bt-layer.html [ Timeout ]
-Bug(WPE) scrollbars/scrollbar-drag-thumb-with-large-content.html [ Failure ]
-Bug(WPE) scrollbars/scrollbar-miss-mousemove-disabled.html [ Failure ]
-Bug(WPE) scrollbars/scrolling-backward-by-page-accounting-bottom-fixed-elements-on-keyboard-spacebar.html [ Failure ]
-Bug(WPE) scrollbars/scrolling-backward-by-page-on-keyboard-spacebar.html [ Failure ]
-Bug(WPE) scrollbars/scrolling-by-page-accounting-oversized-fixed-elements-on-keyboard-spacebar.html [ Failure ]
-Bug(WPE) scrollbars/scrolling-by-page-accounting-top-fixed-elements-on-keyboard-spacebar.html [ Failure ]
-Bug(WPE) scrollbars/scrolling-by-page-accounting-top-fixed-elements-with-negative-top-on-keyboard-spacebar.html [ Failure ]
-Bug(WPE) scrollbars/scrolling-by-page-ignoring-hidden-fixed-elements-on-keyboard-spacebar.html [ Failure ]
-Bug(WPE) scrollbars/scrolling-by-page-ignoring-transparent-fixed-elements-on-keyboard-spacebar.html [ Failure ]
-Bug(WPE) scrollbars/scrolling-by-page-on-keyboard-spacebar.html [ Failure ]
-
 # These are prone to run in parallel, consuming all the memory on the system.
 Bug(WPE) js/stringimpl-to-jsstring-on-large-strings-1.html [ Skip ]
 Bug(WPE) js/stringimpl-to-jsstring-on-large-strings-2.html [ Skip ]
@@ -218,7 +206,6 @@
 Bug(WPE) fast/dynamic/window-resize-scrollbars-test.html [ Timeout ]
 
 Bug(WPE) fast/encoding [ Pass ]
-Bug(WPE) fast/encoding/mailto-always-utf-8.html [ Timeout ]
 
 fast/events/constructors/keyboard-event-constructor.html [ Pass ]
 
@@ -230,7 +217,6 @@
 Bug(WPE) fast/parser/entities-in-xhtml.xhtml [ Failure ]
 Bug(WPE) fast/parser/external-entities-in-xslt.xml [ Failure ]
 Bug(WPE) fast/parser/nested-fragment-parser-crash.html [ Failure ]
-Bug(WPE) fast/parser/tabindex-parsing.html [ Failure ]
 Bug(WPE) fast/parser/xml-colon-entity.html [ Failure ]
 Bug(WPE) fast/parser/xml-declaration-missing-ending-mark.html [ Failure ]
 
@@ -260,6 +246,244 @@
 Bug(WPE) fast/constructors [ Pass ]
 Bug(WPE) fast/cookies [ Pass ]
 Bug(WPE) fast/custom-elements [ Pass ]
+
+Bug(WPE) fast/events [ Pass ]
+# These tests were moved on r187990 from platform/ios-simulator/ios/fast/events/touch
+webkit.org/b/148940 fast/events/touch/document-create-touch-list-ios.html [ Skip ]
+webkit.org/b/148940 fast/events/touch/gesture-event-basic.html [ Skip ]
+webkit.org/b/148940 fast/events/touch/input-touch-target.html [ Skip ]
+webkit.org/b/148940 fast/events/touch/inserted-fragment-touch-target.html [ Skip ]
+webkit.org/b/148940 fast/events/touch/moved-touch-target.html [ Skip ]
+webkit.org/b/148940 fast/events/touch/multi-touch-some-without-handlers.html [ Skip ]
+webkit.org/b/148940 fast/events/touch/ontouchstart-active-selector.html [ Skip ]
+webkit.org/b/148940 fast/events/touch/removed-fragment-touch-target.html [ Skip ]
+webkit.org/b/148940 fast/events/touch/removed-touch-target.html [ Skip ]
+webkit.org/b/148940 fast/events/touch/text-node-touch-target.html [ Skip ]
+webkit.org/b/148940 fast/events/touch/textarea-touch-target.html [ Skip ]
+webkit.org/b/148940 fast/events/touch/touch-event-frames.html [ Skip ]
+webkit.org/b/148940 fast/events/touch/touch-event-pageXY.html [ Skip ]
+webkit.org/b/148940 fast/events/touch/zoomed-touch-event-pageXY.html [ Skip ]
+
+# Need support for internals.settings.setDeviceSupportsMouse
+fast/events/touch/scroll-without-mouse-lacks-mousemove-events.html [ Skip ]
+# ENABLE_TOUCH_SLIDER is disabled in WPE.
+fast/events/touch/touch-slider.html [ Skip ]
+# WPE does not support touch event canceling
+webkit.org/b/128172 fast/events/touch/send-oncancel-event.html [ Skip ]
+fast/events/touch/touch-input-element-change-documents.html
+
+webkit.org/b/174673 fast/events/arrow-keys-on-body.html [ Failure ]
+webkit.org/b/174673 fast/events/keyboardevent-code.html [ Failure ]
+webkit.org/b/174673 fast/events/keyboardevent-key.html [ Failure ]
+webkit.org/b/174673 fast/events/key-events-in-input-button.html [ Failure ]
+webkit.org/b/174673 fast/events/key-events-in-input-text.html [ Failure ]
+
+# clickCount related failures
+webkit.org/b/174674 fast/events/click-count.html [ Failure ]
+webkit.org/b/174674 fast/events/dblclick-addEventListener.html [ Failure ]
+webkit.org/b/174674 fast/events/mouse-click-events.html [ Failure ]
+webkit.org/b/174674 fast/events/selectstart-by-double-triple-clicks.html [ Failure ]
+webkit.org/b/174674 fast/events/zoom-dblclick.html [ Failure ]
+
+webkit.org/b/84692 fast/events/attempt-scroll-with-no-scrollbars.html [ Failure ]
+
+# ENABLE_PROXIMITY_EVENTS is OFF in WPE.
+fast/events/constructors/device-proximity-event-constructor.html [ Skip ]
+
+# ENABLE_DRAG_SUPPORT is OFF in WPE.
+fast/events/5056619.html [ Skip ]
+fast/events/before-input-events-prevent-drag-and-drop.html [ Skip ]
+fast/events/bogus-dropEffect-effectAllowed.html [ Skip ]
+fast/events/clear-drag-state.html [ Skip ]
+fast/events/do-not-drag-and-drop-data-detectors-link.html [ Skip ]
+fast/events/drag-and-drop-autoscroll-inner-frame.html [ Skip ]
+fast/events/drag-and-drop-autoscroll.html [ Skip ]
+fast/events/drag-and-drop-dataTransfer-types-nocrash.html [ Skip ]
+fast/events/drag-and-drop-fire-drag-dragover.html [ Skip ]
+fast/events/drag-and-drop-link-containing-block.html [ Skip ]
+fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html [ Skip ]
+fast/events/drag-and-drop-link-into-focused-contenteditable.html [ Skip ]
+fast/events/drag-and-drop-link.html [ Skip ]
+fast/events/drag-and-drop-set-drag-data-arguments.html [ Skip ]
+fast/events/drag-and-drop-subframe-dataTransfer.html [ Skip ]
+fast/events/drag-and-drop.html [ Skip ]
+fast/events/drag-customData.html [ Skip ]
+fast/events/drag-dataTransferItemList-file-handling.html [ Skip ]
+fast/events/drag-display-none-element.html [ Skip ]
+fast/events/drag-image-filename.html [ Skip ]
+fast/events/drag-in-frames.html [ Skip ]
+fast/events/drag-outside-window.html [ Skip ]
+fast/events/drag-parent-node.html [ Skip ]
+fast/events/drag-select-when-zoomed-with-header.html [ Skip ]
+fast/events/drag-select-when-zoomed.html [ Skip ]
+fast/events/drag-selects-image.html [ Skip ]
+fast/events/drag-text-with-clear.html [ Skip ]
+fast/events/draggable-div-customdata.html [ Skip ]
+fast/events/draggable-div-nodata.html [ Skip ]
+fast/events/dropzone-001.html [ Skip ]
+fast/events/dropzone-002.html [ Skip ]
+fast/events/dropzone-003.html [ Skip ]
+fast/events/dropzone-005.html [ Skip ]
+fast/events/event-attribute.html [ Skip ]
+fast/events/mousedown-inside-dragstart-should-not-cause-crash.html [ Skip ]
+fast/events/ondragenter.html [ Skip ]
+fast/events/remove-target-with-shadow-in-drag.html [ Skip ]
+fast/events/resources/drag-in-frames-left.html [ Skip ]
+fast/events/resources/drag-in-frames-right.html [ Skip ]
+fast/events/shift-drag-selection-on-image-triggers-drag-n-drop.html [ Skip ]
+fast/events/shift-drag-selection-on-link-triggers-drag-n-drop.html [ Skip ]
+fast/events/touch/gesture/long-press-on-draggable-element-triggers-drag.html [ Skip ]
+fast/events/touch/gesture/resources/drag-inside-iframe2.html [ Skip ]
+fast/events/touch/gesture/resources/drag-inside-nested-iframes3.html [ Skip ]
+
+# Tests below are copied from wk2 expectations, because we've marked
+#  as passing the whole fast/events directory.
+
+# WebKitTestRunner needs testRunner.abortModal
+# <https://bugs.webkit.org/show_bug.cgi?id=69548>
+fast/events/beforeunload-showModalDialog.html
+fast/events/pagehide-showModalDialog.html
+fast/events/scroll-event-during-modal-dialog.html
+fast/events/show-modal-dialog-onblur-onfocus.html
+fast/events/unload-showModalDialog.html
+
+# WebKitTestRunner needs an implementation of eventSender.beginDragWithFiles
+# https://bugs.webkit.org/show_bug.cgi?id=64285
+fast/events/data-transfer-files-attribute-identity.html
+fast/events/drag-file-crash.html
+fast/events/drag-to-navigate.html
+fast/events/drop-handler-should-not-stop-navigate.html
+fast/events/drop-with-file-paths.html
+fast/events/dropzone-004.html
+fast/events/file-input-hidden-in-ondrop.html
+fast/events/input-element-display-none-in-dragleave-crash.html
+fast/events/only-valid-drop-targets-receive-file-drop.html
+fast/events/prevent-drag-to-navigate.html
+
+# WebKitTestRunner needs textInputController
+# <https://bugs.webkit.org/show_bug.cgi?id=42337>
+fast/events/ime-composition-events-001.html
+
+# testRunner.setWindowIsKey() has no effect on the web process side in WebKit2
+# https://bugs.webkit.org/show_bug.cgi?id=81736 rdar://problem/11088268
+fast/events/blur-focus-window-should-blur-focus-element.html
+
+# eventSender.dragMode is unimplemented in WKTR
+# Mac: https://bugs.webkit.org/show_bug.cgi?id=68552
+fast/events/controlclick-no-onclick.html
+fast/events/moving-text-should-fire-drop-and-dragend-events.html
+fast/events/moving-text-should-fire-drop-and-dragend-events-2.html
+fast/events/ondrop-text-html.html
+
+# WTR needs an implementation for eventSender.continuousMouseScrollBy
+# https://bugs.webkit.org/show_bug.cgi?id=69417
+fast/events/wheelevent-direction-inverted-from-device.html
+
+# The tests below need gardening after the EventSenderWPE has been added.
+# Most of them are probably failing because of missing support of event related
+# features in WPE.
+webkit.org/b/173419 fast/events/autoscroll-in-overflow-hidden-html.html [ Failure ]
+webkit.org/b/173419 fast/events/autoscroll-in-textarea.html [ Failure ]
+webkit.org/b/173419 fast/events/autoscroll-in-textfield.html [ Failure ]
+webkit.org/b/173419 fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div.html [ Failure ]
+webkit.org/b/173419 fast/events/before-input-prevent-paste.html [ Failure ]
+webkit.org/b/173419 fast/events/click-focus-control.html [ Failure ]
+webkit.org/b/173419 fast/events/click-range-slider.html [ Failure ]
+webkit.org/b/173419 fast/events/constructors/media-stream-event-constructor.html [ Failure ]
+webkit.org/b/173419 fast/events/constructors/mouse-event-constructor.html [ Failure ]
+webkit.org/b/173419 fast/events/constructors/overconstrained-error-event-constructor.html [ Failure ]
+webkit.org/b/173419 fast/events/constructors/wheel-event-constructor.html [ Failure ]
+webkit.org/b/173419 fast/events/content-changed-during-drop.html [ Failure ]
+webkit.org/b/173419 fast/events/context-activated-by-key-event.html [ Failure ]
+webkit.org/b/173419 fast/events/continuous-platform-wheelevent-in-scrolling-div.html [ Failure ]
+webkit.org/b/173419 fast/events/crash-on-mutate-during-drop.html [ Failure ]
+webkit.org/b/173419 fast/events/frame-tab-focus.html [ Failure ]
+webkit.org/b/173419 fast/events/ime-compositionend-on-selection-change.html [ Failure ]
+webkit.org/b/173419 fast/events/input-events-drag-and-drop.html [ Failure ]
+webkit.org/b/173419 fast/events/input-events-insert-by-drop.html [ Failure ]
+webkit.org/b/173419 fast/events/input-events-paste-data.html [ Failure ]
+webkit.org/b/173419 fast/events/input-events-paste-rich-datatransfer.html [ Failure ]
+webkit.org/b/173419 fast/events/js-keyboard-event-creation.html [ Failure ]
+webkit.org/b/173419 fast/events/keydown-1.html [ Failure ]
+webkit.org/b/173419 fast/events/keydown-numpad-keys.html [ Failure ]
+webkit.org/b/173419 fast/events/mouse-cursor-image-set.html [ Failure ]
+webkit.org/b/173419 fast/events/mouse-drag-from-frame-to-other-frame.html [ Failure ]
+webkit.org/b/173419 fast/events/mouse-drag-from-frame.html [ Failure ]
+webkit.org/b/173419 fast/events/mouseenterleave-on-subframe.html [ Failure ]
+webkit.org/b/173419 fast/events/mouseover-button.html [ Failure ]
+webkit.org/b/173419 fast/events/mouseover-mouseout.html [ Failure ]
+webkit.org/b/173419 fast/events/mouseover-mouseout2.html [ Failure ]
+webkit.org/b/173419 fast/events/mouseup-from-button2.html [ Failure ]
+webkit.org/b/173419 fast/events/no-scroll-on-input-text-selection.html [ Failure ]
+webkit.org/b/173419 fast/events/node-event-anchor-lock.html [ Failure ]
+webkit.org/b/173419 fast/events/offsetX-offsetY.html [ Failure ]
+webkit.org/b/173419 fast/events/onchange-range-slider.html [ Failure ]
+webkit.org/b/173419 fast/events/option-tab.html [ Failure ]
+webkit.org/b/173419 fast/events/page-scaled-mouse-click-iframe.html [ Failure ]
+webkit.org/b/173419 fast/events/platform-wheelevent-in-scrolling-div.html [ Failure ]
+webkit.org/b/173419 fast/events/platform-wheelevent-paging-x-in-non-scrolling-div.html [ Failure ]
+webkit.org/b/173419 fast/events/platform-wheelevent-paging-x-in-non-scrolling-page.html [ Failure ]
+webkit.org/b/173419 fast/events/platform-wheelevent-paging-x-in-scrolling-div.html [ Failure ]
+webkit.org/b/173419 fast/events/platform-wheelevent-paging-x-in-scrolling-page.html [ Failure ]
+webkit.org/b/173419 fast/events/platform-wheelevent-paging-xy-in-scrolling-div.html [ Failure ]
+webkit.org/b/173419 fast/events/platform-wheelevent-paging-xy-in-scrolling-page.html [ Failure ]
+webkit.org/b/173419 fast/events/platform-wheelevent-paging-y-in-non-scrolling-div.html [ Failure ]
+webkit.org/b/173419 fast/events/platform-wheelevent-paging-y-in-non-scrolling-page.html [ Failure ]
+webkit.org/b/173419 fast/events/platform-wheelevent-paging-y-in-scrolling-div.html [ Failure ]
+webkit.org/b/173419 fast/events/platform-wheelevent-paging-y-in-scrolling-page.html [ Failure ]
+webkit.org/b/173419 fast/events/scroll-in-scaled-page-with-overflow-hidden.html [ Failure ]
+webkit.org/b/173419 fast/events/selectstart-by-drag.html [ Failure ]
+webkit.org/b/173419 fast/events/selectstart-by-single-click-with-shift.html [ Failure ]
+webkit.org/b/173419 fast/events/sequential-focus-navigation-starting-point.html [ Failure ]
+webkit.org/b/173419 fast/events/shadow-event-path-2.html [ Failure ]
+webkit.org/b/173419 fast/events/shadow-event-path.html [ Failure ]
+webkit.org/b/173419 fast/events/special-key-events-in-input-text.html [ Failure ]
+webkit.org/b/173419 fast/events/tabindex-focus-blur-all.html [ Failure ]
+webkit.org/b/173419 fast/events/touch/basic-multi-touch-events-limited.html [ Failure ]
+webkit.org/b/173419 fast/events/touch/basic-multi-touch-events.html [ Failure ]
+webkit.org/b/173419 fast/events/touch/document-create-touch-list.html [ Failure ]
+webkit.org/b/173419 fast/events/touch/document-create-touch.html [ Failure ]
+webkit.org/b/173419 fast/events/touch/emulate-touch-events.html [ Failure ]
+webkit.org/b/173419 fast/events/touch/touch-before-pressing-spin-button.html [ Failure ]
+webkit.org/b/173419 fast/events/webkit-media-key-events-constructor.html [ Failure ]
+webkit.org/b/173419 fast/events/wheelevent-basic.html [ Failure ]
+webkit.org/b/173419 fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html [ Failure ]
+webkit.org/b/173419 fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html [ Failure ]
+webkit.org/b/173419 fast/events/autoscroll-main-document.html [ Timeout ]
+webkit.org/b/173419 fast/events/autoscroll-should-not-stop-on-keypress.html [ Timeout ]
+webkit.org/b/173419 fast/events/autoscroll-when-zoomed.html [ Timeout ]
+webkit.org/b/173419 fast/events/before-input-prevent-insert-replacement.html [ Timeout ]
+webkit.org/b/173419 fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html [ Timeout ]
+webkit.org/b/173419 fast/events/clipboard-dataTransferItemList.html [ Timeout ]
+webkit.org/b/173419 fast/events/drag-dataTransferItemList.html [ Timeout ]
+webkit.org/b/173419 fast/events/event-view-toString.html [ Timeout ]
+webkit.org/b/173419 fast/events/frame-detached-in-mousedown.html [ Timeout ]
+webkit.org/b/173419 fast/events/iframe-onmousemove.html [ Timeout ]
+webkit.org/b/173419 fast/events/input-event-insert-replacement.html [ Timeout ]
+webkit.org/b/173419 fast/events/mouse-force-changed.html [ Timeout ]
+webkit.org/b/173419 fast/events/mouse-force-down.html [ Timeout ]
+webkit.org/b/173419 fast/events/mouse-force-up.html [ Timeout ]
+webkit.org/b/173419 fast/events/mouse-moved-remove-frame-crash.html [ Timeout ]
+webkit.org/b/173419 fast/events/page-visibility-iframe-delete-test.html [ Timeout ]
+webkit.org/b/173419 fast/events/page-visibility-iframe-move-test.html [ Timeout ]
+webkit.org/b/173419 fast/events/page-visibility-iframe-propagation-test.html [ Timeout ]
+webkit.org/b/173419 fast/events/page-visibility-onvisibilitychange.html [ Timeout ]
+webkit.org/b/173419 fast/events/page-visibility-transition-test.html [ Timeout ]
+webkit.org/b/173419 fast/events/popup-blocking-click-in-iframe.html [ Timeout ]
+webkit.org/b/173419 fast/events/scroll-after-click-on-tab-index.html [ Timeout ]
+webkit.org/b/173419 fast/events/standalone-image-drag-to-editable.html [ Timeout ]
+webkit.org/b/173419 fast/events/touch/emulated-touch-iframe.html [ Timeout ]
+webkit.org/b/173419 fast/events/touch/multi-touch-grouped-targets.html [ Timeout ]
+webkit.org/b/173419 fast/events/touch/multi-touch-inside-nested-iframes.html [ Timeout ]
+webkit.org/b/173419 fast/events/touch/page-scaled-touch-gesture-click.html [ Timeout ]
+webkit.org/b/173419 fast/events/touch/touch-target-limited.html [ Timeout ]
+webkit.org/b/173419 fast/events/touch/touch-target.html [ Timeout ]
+webkit.org/b/173419 fast/events/wheel-event-destroys-frame.html [ Timeout ]
+
+fast/events/ios [ Skip ]
+fast/events/touch/ios [ Skip ]
+fast/events/touch/gesture [ Skip ]
+
 Bug(WPE) fast/eventsource [ Pass ]
 Bug(WPE) fast/gradients [ Pass ]
 Bug(WPE) fast/leaks [ Pass ]
@@ -312,12 +536,10 @@
 Bug(WPE) fast/dom/HTMLTemplateElement [ Pass ]
 Bug(WPE) fast/dom/HTMLTextAreaElement [ Pass ]
 Bug(WPE) fast/dom/MutationObserver [ Pass ]
-Bug(WPE) fast/dom/MutationObserver/end-of-task-delivery.html [ Timeout ]
-Bug(WPE) fast/dom/MutationObserver/inline-event-listener.html [ Timeout ]
+webkit.org/b/78290 fast/dom/MutationObserver/end-of-task-delivery.html [ Failure ]
 Bug(WPE) fast/dom/NavigatorContentUtils [ Pass ]
 Bug(WPE) fast/dom/NavigatorContentUtils/is-protocol-handler-registered.html [ Failure ]
 Bug(WPE) fast/dom/Node [ Pass ]
-Bug(WPE) fast/dom/Node/mutation-blur.html [ Timeout ]
 Bug(WPE) fast/dom/NodeList [ Pass ]
 Bug(WPE) fast/dom/Orientation [ Pass ]
 Bug(WPE) fast/dom/Range [ Pass ]
@@ -334,7 +556,6 @@
 Bug(WPE) storage/indexeddb/modern/index-3-private.html [ Crash ]
 Bug(WPE) storage/indexeddb/modern/worker-getall.html [ Timeout ]
 Bug(WPE) storage/domstorage/events/basic-body-attribute.html [ Failure ]
-webkit.org/b/173419 storage/domstorage/sessionstorage/set-item-synchronous-keydown.html [ Failure ]
 Bug(WPE) storage/indexeddb/basics-workers.html [ Failure ]
 Bug(WPE) storage/indexeddb/cursor-advance-workers.html [ Failure ]
 Bug(WPE) storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-workers.html [ Failure ]

Modified: trunk/LayoutTests/platform/wpe/fast/dom/HTMLTableColElement/resize-table-using-col-width-expected.txt (219999 => 220000)


--- trunk/LayoutTests/platform/wpe/fast/dom/HTMLTableColElement/resize-table-using-col-width-expected.txt	2017-07-28 07:53:17 UTC (rev 219999)
+++ trunk/LayoutTests/platform/wpe/fast/dom/HTMLTableColElement/resize-table-using-col-width-expected.txt	2017-07-28 10:27:03 UTC (rev 220000)
@@ -3,30 +3,30 @@
 layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
-      RenderTable {TABLE} at (0,0) size 238x50 [border: (1px outset #808080)]
+      RenderTable {TABLE} at (0,0) size 662x50 [border: (1px outset #808080)]
         RenderTableCol {COLGROUP} at (0,0) size 0x0
           RenderTableCol {COL} at (0,0) size 0x0
           RenderTableCol {COL} at (0,0) size 0x0
           RenderTableCol {COL} at (0,0) size 0x0
-        RenderTableSection {TBODY} at (1,1) size 236x48
-          RenderTableRow {TR} at (0,2) size 236x21
-            RenderTableCell {TD} at (2,2) size 76x21 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
+        RenderTableSection {TBODY} at (1,1) size 660x48
+          RenderTableRow {TR} at (0,2) size 660x21
+            RenderTableCell {TD} at (2,2) size 500x21 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
               RenderText {#text} at (2,2) size 72x17
                 text run at (2,2) width 72: "col 1 row 1"
-            RenderTableCell {TD} at (80,2) size 76x21 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (504,2) size 76x21 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
               RenderText {#text} at (2,2) size 72x17
                 text run at (2,2) width 72: "col 2 row 1"
-            RenderTableCell {TD} at (158,2) size 76x21 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]
+            RenderTableCell {TD} at (582,2) size 76x21 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]
               RenderText {#text} at (2,2) size 72x17
                 text run at (2,2) width 72: "col 3 row 1"
-          RenderTableRow {TR} at (0,25) size 236x21
-            RenderTableCell {TD} at (2,25) size 76x21 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
+          RenderTableRow {TR} at (0,25) size 660x21
+            RenderTableCell {TD} at (2,25) size 500x21 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
               RenderText {#text} at (2,2) size 72x17
                 text run at (2,2) width 72: "col 1 row 2"
-            RenderTableCell {TD} at (80,25) size 76x21 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (504,25) size 76x21 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]
               RenderText {#text} at (2,2) size 72x17
                 text run at (2,2) width 72: "col 2 row 2"
-            RenderTableCell {TD} at (158,25) size 76x21 [border: (1px inset #808080)] [r=1 c=2 rs=1 cs=1]
+            RenderTableCell {TD} at (582,25) size 76x21 [border: (1px inset #808080)] [r=1 c=2 rs=1 cs=1]
               RenderText {#text} at (2,2) size 72x17
                 text run at (2,2) width 72: "col 3 row 3"
       RenderBlock (anonymous) at (0,50) size 784x30

Modified: trunk/LayoutTests/platform/wpe/fast/dynamic/layer-hit-test-crash-expected.txt (219999 => 220000)


--- trunk/LayoutTests/platform/wpe/fast/dynamic/layer-hit-test-crash-expected.txt	2017-07-28 07:53:17 UTC (rev 219999)
+++ trunk/LayoutTests/platform/wpe/fast/dynamic/layer-hit-test-crash-expected.txt	2017-07-28 10:27:03 UTC (rev 220000)
@@ -15,3 +15,4 @@
   RenderBlock (positioned) zI: 1 {DIV} at (50,50) size 200x200 [bgcolor=#FFFF00]
 layer at (70,50) size 100x100
   RenderBlock (positioned) zI: 5 {DIV} at (20,0) size 100x100 [bgcolor=#FF0000]
+caret: position 0 of child 1 {DIV} of child 3 {DIV} of body

Added: trunk/LayoutTests/platform/wpe/fast/events/clientXY-in-zoom-and-scroll-expected.txt (0 => 220000)


--- trunk/LayoutTests/platform/wpe/fast/events/clientXY-in-zoom-and-scroll-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/wpe/fast/events/clientXY-in-zoom-and-scroll-expected.txt	2017-07-28 10:27:03 UTC (rev 220000)
@@ -0,0 +1,27 @@
+Base
+PASS event.clientX is 100
+PASS event.clientY is 100
+PASS event.pageX is 100
+PASS event.pageY is 100
+
+Just zoomed
+PASS event.clientX is 83
+PASS event.clientY is 83
+PASS event.pageX is 83
+PASS event.pageY is 83
+
+Just scrolled
+PASS event.clientX is 100
+PASS event.clientY is 100
+PASS event.pageX is 150
+PASS event.pageY is 150
+
+Zoomed and scrolled
+PASS event.clientX is 83
+PASS event.clientY is 83
+PASS event.pageX is 133
+PASS event.pageY is 133
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/LayoutTests/platform/wpe/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.txt (219999 => 220000)


--- trunk/LayoutTests/platform/wpe/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.txt	2017-07-28 07:53:17 UTC (rev 219999)
+++ trunk/LayoutTests/platform/wpe/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.txt	2017-07-28 10:27:03 UTC (rev 220000)
@@ -8,7 +8,7 @@
           text run at (0,0) width 755: "Test passes if the images of all the cats scroll when the box is scrolled. (Presence of cats behind the double border is UA"
           text run at (0,17) width 74: "dependent)."
       RenderBlock {DIV} at (0,342) size 784x0
-layer at (8,66) size 292x292 clip at (58,116) size 177x177 scrollHeight 272
+layer at (8,66) size 292x292 clip at (58,116) size 177x177 scrollY 95 scrollHeight 272
   RenderBlock {DIV} at (0,50) size 292x292 [border: (50px double #000000)]
     RenderText {#text} at (50,50) size 173x272
       text run at (50,50) width 140: "Filler Text Filler Text "

Added: trunk/Source/cmake/FindLibxkbcommon.cmake (0 => 220000)


--- trunk/Source/cmake/FindLibxkbcommon.cmake	                        (rev 0)
+++ trunk/Source/cmake/FindLibxkbcommon.cmake	2017-07-28 10:27:03 UTC (rev 220000)
@@ -0,0 +1,35 @@
+# - Try to find libxkbcommon.
+# Once done, this will define
+#
+#  LIBXKBCOMMON_FOUND - system has libxkbcommon.
+#  LIBXKBCOMMON_INCLUDE_DIRS - the libxkbcommon include directories
+#  LIBXKBCOMMON_LIBRARIES - link these to use libxkbcommon.
+#
+# Copyright (C) 2014 Igalia S.L.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
+# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+find_package(PkgConfig)
+pkg_check_modules(LIBXKBCOMMON xkbcommon)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBXKBCOMMON DEFAULT_MSG LIBXKBCOMMON_FOUND)

Modified: trunk/Tools/ChangeLog (219999 => 220000)


--- trunk/Tools/ChangeLog	2017-07-28 07:53:17 UTC (rev 219999)
+++ trunk/Tools/ChangeLog	2017-07-28 10:27:03 UTC (rev 220000)
@@ -1,3 +1,43 @@
+2017-07-28  Claudio Saavedra  <csaave...@igalia.com>
+
+        [WPE] Implement EventSenderProxy in WTR
+        https://bugs.webkit.org/show_bug.cgi?id=173419
+
+        Reviewed by Žan Doberšek.
+
+        Add the implementation of EventSenderProxy to the WTR. This
+        allows us to extend the coverage of the test suite in WKWPE.
+
+        * WebKitTestRunner/EventSenderProxy.h:
+        * WebKitTestRunner/PlatformWPE.cmake: Add dependency on
+        libxkbcommon needed to deal with key events.
+        * WebKitTestRunner/wpe/EventSenderProxyWPE.cpp:
+        (WTR::EventSenderProxy::EventSenderProxy):
+        (WTR::senderButtonToWPEButton):
+        (WTR::EventSenderProxy::mouseDown):
+        (WTR::EventSenderProxy::mouseUp):
+        (WTR::EventSenderProxy::mouseMoveTo):
+        (WTR::EventSenderProxy::mouseScrollBy):
+        (WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases):
+        (WTR::EventSenderProxy::leapForward):
+        (WTR::wkEventModifiersToWPE):
+        (WTR::getXKBKeySymForKeyRef):
+        (WTR::EventSenderProxy::keyDown):
+        (WTR::EventSenderProxy::addTouchPoint):
+        (WTR::EventSenderProxy::updateTouchPoint):
+        (WTR::EventSenderProxy::setTouchModifier):
+        (WTR::EventSenderProxy::setTouchPointRadius):
+        (WTR::EventSenderProxy::getUpdatedTouchEvents):
+        (WTR::EventSenderProxy::removeUpdatedTouchEvents):
+        (WTR::EventSenderProxy::prepareAndDispatchTouchEvent):
+        (WTR::EventSenderProxy::touchStart):
+        (WTR::EventSenderProxy::touchMove):
+        (WTR::EventSenderProxy::touchEnd):
+        (WTR::EventSenderProxy::touchCancel):
+        (WTR::EventSenderProxy::clearTouchPoints):
+        (WTR::EventSenderProxy::releaseTouchPoint):
+        (WTR::EventSenderProxy::cancelTouchPoint):
+
 2017-07-27  Brady Eidson  <beid...@apple.com>
 
         Part 2 of: Rename DatabaseProcess to StorageProcess.

Modified: trunk/Tools/WebKitTestRunner/EventSenderProxy.h (219999 => 220000)


--- trunk/Tools/WebKitTestRunner/EventSenderProxy.h	2017-07-28 07:53:17 UTC (rev 219999)
+++ trunk/Tools/WebKitTestRunner/EventSenderProxy.h	2017-07-28 10:27:03 UTC (rev 220000)
@@ -38,6 +38,11 @@
 #include <wtf/HashSet.h>
 #endif
 
+#if PLATFORM(WPE)
+#include <wpe/input.h>
+#include <wtf/HashSet.h>
+#endif
+
 #if PLATFORM(COCOA)
 OBJC_CLASS NSEvent;
 #endif
@@ -114,6 +119,12 @@
     void sendUpdatedTouchEvents();
 #endif
 
+#if PLATFORM(WPE)
+    Vector<struct wpe_input_touch_event_raw> getUpdatedTouchEvents();
+    void removeUpdatedTouchEvents();
+    void prepareAndDispatchTouchEvent(enum wpe_input_touch_event_type);
+#endif
+
     double m_time;
     WKPoint m_position;
     bool m_leftMouseButtonDown;
@@ -128,6 +139,11 @@
     unsigned m_mouseButtonCurrentlyDown;
     Vector<GUniquePtr<GdkEvent>> m_touchEvents;
     HashSet<int> m_updatedTouchEvents;
+#elif PLATFORM(WPE)
+    struct wpe_view_backend* m_viewBackend;
+    uint32_t m_buttonState;
+    Vector<struct wpe_input_touch_event_raw> m_touchEvents;
+    HashSet<unsigned, DefaultHash<unsigned>::Hash, WTF::UnsignedWithZeroKeyHashTraits<unsigned>> m_updatedTouchEvents;
 #endif
 };
 

Modified: trunk/Tools/WebKitTestRunner/PlatformWPE.cmake (219999 => 220000)


--- trunk/Tools/WebKitTestRunner/PlatformWPE.cmake	2017-07-28 07:53:17 UTC (rev 219999)
+++ trunk/Tools/WebKitTestRunner/PlatformWPE.cmake	2017-07-28 10:27:03 UTC (rev 220000)
@@ -1,5 +1,6 @@
 find_package(LibGBM REQUIRED)
 find_package(WPEBackend-mesa REQUIRED)
+find_package(Libxkbcommon 0.4.0 REQUIRED)
 
 add_custom_target(WebKitTestRunner-forwarding-headers
     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${WEBKIT_TESTRUNNER_DIR} --output ${FORWARDING_HEADERS_DIR} --platform wpe
@@ -23,6 +24,7 @@
     ${CAIRO_INCLUDE_DIRS}
     ${GLIB_INCLUDE_DIRS}
     ${LIBGBM_INCLUDE_DIRS}
+    ${LIBXKBCOMMON_INCLUDE_DIRS}
     ${WPE_MESA_INCLUDE_DIRS}
 )
 
@@ -30,6 +32,7 @@
     ${CAIRO_LIBRARIES}
     ${GLIB_LIBRARIES}
     ${LIBGBM_LIBRARIES}
+    ${LIBXKBCOMMON_LIBRARIES}
     ${WPE_MESA_LIBRARIES}
 )
 

Modified: trunk/Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp (219999 => 220000)


--- trunk/Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp	2017-07-28 07:53:17 UTC (rev 219999)
+++ trunk/Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp	2017-07-28 10:27:03 UTC (rev 220000)
@@ -26,8 +26,34 @@
 #include "config.h"
 #include "EventSenderProxy.h"
 
+#include "HeadlessViewBackend.h"
+#include "NotImplemented.h"
+#include "PlatformWebView.h"
+#include "TestController.h"
+#include <wpe/view-backend.h>
+#include <xkbcommon/xkbcommon-keysyms.h>
+#include <xkbcommon/xkbcommon.h>
+
 namespace WTR {
 
+// Key event location code defined in DOM Level 3.
+enum KeyLocationCode {
+    DOMKeyLocationStandard      = 0x00,
+    DOMKeyLocationLeft          = 0x01,
+    DOMKeyLocationRight         = 0x02,
+    DOMKeyLocationNumpad        = 0x03
+};
+
+enum ButtonState {
+    ButtonReleased = 0,
+    ButtonPressed = 1
+};
+
+enum PointerAxis {
+    VerticalScroll = 0,
+    HorizontalScroll = 1
+};
+
 EventSenderProxy::EventSenderProxy(TestController* testController)
     : m_testController(testController)
     , m_time(0)
@@ -35,7 +61,9 @@
     , m_clickCount(0)
     , m_clickTime(0)
     , m_clickButton(kWKEventMouseButtonNoButton)
+    , m_buttonState(ButtonReleased)
 {
+    m_viewBackend = m_testController->mainWebView()->platformWindow()->backend();
 }
 
 EventSenderProxy::~EventSenderProxy()
@@ -42,80 +70,311 @@
 {
 }
 
-void EventSenderProxy::mouseDown(unsigned, WKEventModifiers)
+unsigned senderButtonToWPEButton(unsigned senderButton)
 {
+    // Tests using the EventSender have a different numbering ordering than the one
+    // that the WPE port expects. Shuffle these here.
+    switch (senderButton) {
+    case 0:
+        return 1;
+    case 1:
+        return 3;
+    case 2:
+        return 2;
+    default:
+        return senderButton;
+    }
 }
 
-void EventSenderProxy::mouseUp(unsigned, WKEventModifiers)
+void EventSenderProxy::mouseDown(unsigned button, WKEventModifiers wkModifiers)
 {
+    m_clickButton = button;
+    m_clickPosition = m_position;
+    m_clickTime = m_time;
+    m_buttonState = ButtonPressed;
+
+    struct wpe_input_pointer_event event { wpe_input_pointer_event_type_button, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), senderButtonToWPEButton(button), m_buttonState};
+    wpe_view_backend_dispatch_pointer_event(m_viewBackend, &event);
 }
 
-void EventSenderProxy::mouseMoveTo(double, double)
+void EventSenderProxy::mouseUp(unsigned button, WKEventModifiers wkModifiers)
 {
+    m_buttonState = ButtonReleased;
+    m_clickButton = kWKEventMouseButtonNoButton;
+
+    struct wpe_input_pointer_event event { wpe_input_pointer_event_type_button, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), senderButtonToWPEButton(button), m_buttonState};
+    wpe_view_backend_dispatch_pointer_event(m_viewBackend, &event);
 }
 
-void EventSenderProxy::mouseScrollBy(int, int)
+void EventSenderProxy::mouseMoveTo(double x, double y)
 {
+    m_position.x = x;
+    m_position.y = y;
+
+    struct wpe_input_pointer_event event { wpe_input_pointer_event_type_motion, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), static_cast<uint32_t>(m_clickButton), m_buttonState};
+    wpe_view_backend_dispatch_pointer_event(m_viewBackend, &event);
 }
 
-void EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases(int, int, int, int)
+void EventSenderProxy::mouseScrollBy(int horizontal, int vertical)
 {
+    // Copy behaviour of GTK+ - just return in case of (0,0) mouse scroll
+    if (!horizontal && !vertical)
+        return;
+
+    if (horizontal) {
+        struct wpe_input_axis_event event = { wpe_input_axis_event_type_motion, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), HorizontalScroll, horizontal};
+        wpe_view_backend_dispatch_axis_event(m_viewBackend, &event);
+    }
+    if (vertical) {
+        struct wpe_input_axis_event event =  { wpe_input_axis_event_type_motion, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), VerticalScroll, vertical};
+        wpe_view_backend_dispatch_axis_event(m_viewBackend, &event);
+    }
 }
 
+void EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases(int horizontal, int vertical, int, int)
+{
+    mouseScrollBy(horizontal, vertical);
+}
+
 void EventSenderProxy::continuousMouseScrollBy(int, int, bool)
 {
 }
 
-void EventSenderProxy::leapForward(int)
+void EventSenderProxy::leapForward(int milliseconds)
 {
+    m_time += milliseconds / 1000.0;
 }
 
-void EventSenderProxy::keyDown(WKStringRef, WKEventModifiers, unsigned)
+static uint8_t wkEventModifiersToWPE(WKEventModifiers wkModifiers)
 {
+    uint8_t modifiers = 0;
+    if (wkModifiers & kWKEventModifiersShiftKey)
+        modifiers |=  wpe_input_keyboard_modifier_shift;
+    if (wkModifiers & kWKEventModifiersControlKey)
+        modifiers |= wpe_input_keyboard_modifier_control;
+    if (wkModifiers & kWKEventModifiersAltKey)
+        modifiers |= wpe_input_keyboard_modifier_alt;
+    if (wkModifiers & kWKEventModifiersMetaKey)
+        modifiers |= wpe_input_keyboard_modifier_meta;
+
+    return modifiers;
 }
 
-void EventSenderProxy::addTouchPoint(int, int)
+int getXKBKeySymForKeyRef(WKStringRef keyRef, unsigned location, uint8_t* modifiers)
 {
+    if (location == DOMKeyLocationNumpad) {
+        if (WKStringIsEqualToUTF8CString(keyRef, "leftArrow"))
+            return XKB_KEY_KP_Left;
+        if (WKStringIsEqualToUTF8CString(keyRef, "rightArror"))
+            return XKB_KEY_KP_Right;
+        if (WKStringIsEqualToUTF8CString(keyRef, "upArrow"))
+            return XKB_KEY_KP_Up;
+        if (WKStringIsEqualToUTF8CString(keyRef, "downArrow"))
+            return XKB_KEY_KP_Down;
+        if (WKStringIsEqualToUTF8CString(keyRef, "pageUp"))
+            return XKB_KEY_KP_Page_Up;
+        if (WKStringIsEqualToUTF8CString(keyRef, "pageDown"))
+            return XKB_KEY_KP_Page_Down;
+        if (WKStringIsEqualToUTF8CString(keyRef, "home"))
+            return XKB_KEY_KP_Home;
+        if (WKStringIsEqualToUTF8CString(keyRef, "end"))
+            return XKB_KEY_KP_End;
+        if (WKStringIsEqualToUTF8CString(keyRef, "insert"))
+            return XKB_KEY_KP_Insert;
+        if (WKStringIsEqualToUTF8CString(keyRef, "delete"))
+            return XKB_KEY_KP_Delete;
+
+        return XKB_KEY_VoidSymbol;
+    }
+
+    if (WKStringIsEqualToUTF8CString(keyRef, "leftControl"))
+        return XKB_KEY_Control_L;
+    if (WKStringIsEqualToUTF8CString(keyRef, "rightControl"))
+        return XKB_KEY_Control_R;
+    if (WKStringIsEqualToUTF8CString(keyRef, "leftShift"))
+        return XKB_KEY_Shift_L;
+    if (WKStringIsEqualToUTF8CString(keyRef, "rightShift"))
+        return XKB_KEY_Shift_R;
+    if (WKStringIsEqualToUTF8CString(keyRef, "leftAlt"))
+        return XKB_KEY_Alt_L;
+    if (WKStringIsEqualToUTF8CString(keyRef, "rightAlt"))
+        return XKB_KEY_Alt_R;
+    if (WKStringIsEqualToUTF8CString(keyRef, "leftArrow"))
+        return XKB_KEY_Left;
+    if (WKStringIsEqualToUTF8CString(keyRef, "rightArrow"))
+        return XKB_KEY_Right;
+    if (WKStringIsEqualToUTF8CString(keyRef, "upArrow"))
+        return XKB_KEY_Up;
+    if (WKStringIsEqualToUTF8CString(keyRef, "downArrow"))
+        return XKB_KEY_Down;
+    if (WKStringIsEqualToUTF8CString(keyRef, "pageUp"))
+        return XKB_KEY_Page_Up;
+    if (WKStringIsEqualToUTF8CString(keyRef, "pageDown"))
+        return XKB_KEY_Page_Down;
+    if (WKStringIsEqualToUTF8CString(keyRef, "home"))
+        return XKB_KEY_Home;
+    if (WKStringIsEqualToUTF8CString(keyRef, "end"))
+        return XKB_KEY_End;
+    if (WKStringIsEqualToUTF8CString(keyRef, "insert"))
+        return XKB_KEY_Insert;
+    if (WKStringIsEqualToUTF8CString(keyRef, "delete"))
+        return XKB_KEY_Delete;
+    if (WKStringIsEqualToUTF8CString(keyRef, "printScreen"))
+        return XKB_KEY_Print;
+    if (WKStringIsEqualToUTF8CString(keyRef, "menu"))
+        return XKB_KEY_Menu;
+    if (WKStringIsEqualToUTF8CString(keyRef, "F1"))
+        return XKB_KEY_F1;
+    if (WKStringIsEqualToUTF8CString(keyRef, "F2"))
+        return XKB_KEY_F2;
+    if (WKStringIsEqualToUTF8CString(keyRef, "F3"))
+        return XKB_KEY_F3;
+    if (WKStringIsEqualToUTF8CString(keyRef, "F4"))
+        return XKB_KEY_F4;
+    if (WKStringIsEqualToUTF8CString(keyRef, "F5"))
+        return XKB_KEY_F5;
+    if (WKStringIsEqualToUTF8CString(keyRef, "F6"))
+        return XKB_KEY_F6;
+    if (WKStringIsEqualToUTF8CString(keyRef, "F7"))
+        return XKB_KEY_F7;
+    if (WKStringIsEqualToUTF8CString(keyRef, "F8"))
+        return XKB_KEY_F8;
+    if (WKStringIsEqualToUTF8CString(keyRef, "F9"))
+        return XKB_KEY_F9;
+    if (WKStringIsEqualToUTF8CString(keyRef, "F10"))
+        return XKB_KEY_F10;
+    if (WKStringIsEqualToUTF8CString(keyRef, "F11"))
+        return XKB_KEY_F11;
+    if (WKStringIsEqualToUTF8CString(keyRef, "F12"))
+        return XKB_KEY_F12;
+
+    size_t bufferSize = WKStringGetMaximumUTF8CStringSize(keyRef);
+    auto buffer = std::make_unique<char[]>(bufferSize);
+    WKStringGetUTF8CString(keyRef, buffer.get(), bufferSize);
+    char charCode = buffer.get()[0];
+
+    if (charCode == '\n' || charCode == '\r')
+        return XKB_KEY_Return;
+    if (charCode == '\t')
+        return XKB_KEY_Tab;
+    if (charCode == '\x8')
+        return XKB_KEY_BackSpace;
+    if (charCode == 0x001B)
+        return XKB_KEY_Escape;
+
+    if (WTF::isASCIIUpper(charCode))
+        *modifiers |= wpe_input_keyboard_modifier_shift;
+
+    // Not sure if this is correct.
+    return charCode;
 }
 
-void EventSenderProxy::updateTouchPoint(int, int, int)
+void EventSenderProxy::keyDown(WKStringRef keyRef, WKEventModifiers wkModifiers, unsigned location)
 {
+    uint8_t modifiers = wkEventModifiersToWPE(wkModifiers);
+    uint32_t keySym = getXKBKeySymForKeyRef(keyRef, location, &modifiers);
+    uint32_t unicode = xkb_keysym_to_utf32(keySym);
+    struct wpe_input_keyboard_event event { static_cast<uint32_t>(m_time), keySym, unicode, true, modifiers};
+    wpe_view_backend_dispatch_keyboard_event(m_viewBackend, &event);
+    event.pressed = false;
+    wpe_view_backend_dispatch_keyboard_event(m_viewBackend, &event);
 }
 
+void EventSenderProxy::addTouchPoint(int x, int y)
+{
+    struct wpe_input_touch_event_raw rawEvent { wpe_input_touch_event_type_down, static_cast<uint32_t>(m_time), static_cast<int>(m_touchEvents.size()), static_cast<int32_t>(x), static_cast<int32_t>(y) };
+    m_touchEvents.append(rawEvent);
+    m_updatedTouchEvents.add(rawEvent.id);
+}
+
+void EventSenderProxy::updateTouchPoint(int index, int x, int y)
+{
+    ASSERT(index >= 0 && index <= m_touchEvents.size());
+
+    auto& rawEvent = m_touchEvents[index];
+    rawEvent.x = x;
+    rawEvent.y = y;
+    rawEvent.time = m_time;
+    rawEvent.type = wpe_input_touch_event_type_motion;
+    m_updatedTouchEvents.add(index);
+}
+
 void EventSenderProxy::setTouchModifier(WKEventModifiers, bool)
 {
+    notImplemented();
 }
 
 void EventSenderProxy::setTouchPointRadius(int, int)
 {
+    notImplemented();
 }
 
+Vector<struct wpe_input_touch_event_raw> EventSenderProxy::getUpdatedTouchEvents()
+{
+    Vector<wpe_input_touch_event_raw> events;
+    for (auto id : m_updatedTouchEvents)
+        events.append(m_touchEvents[id]);
+    return events;
+}
+
+void EventSenderProxy::removeUpdatedTouchEvents()
+{
+    for (auto id : m_updatedTouchEvents)
+        m_touchEvents[id].type = wpe_input_touch_event_type_null;
+    m_touchEvents.removeAllMatching([] (auto current) {
+        return current.type == wpe_input_touch_event_type_null;
+        });
+}
+
+void EventSenderProxy::prepareAndDispatchTouchEvent(enum wpe_input_touch_event_type eventType)
+{
+    auto updatedEvents = getUpdatedTouchEvents();
+    struct wpe_input_touch_event event = { updatedEvents.data(), updatedEvents.size(), eventType, 0, static_cast<uint32_t>(m_time) };
+    wpe_view_backend_dispatch_touch_event(m_viewBackend, &event);
+    if (eventType == wpe_input_touch_event_type_up)
+        removeUpdatedTouchEvents();
+    m_updatedTouchEvents.clear();
+}
+
 void EventSenderProxy::touchStart()
 {
+    prepareAndDispatchTouchEvent(wpe_input_touch_event_type_down);
 }
 
 void EventSenderProxy::touchMove()
 {
+    prepareAndDispatchTouchEvent(wpe_input_touch_event_type_motion);
 }
 
 void EventSenderProxy::touchEnd()
 {
+    prepareAndDispatchTouchEvent(wpe_input_touch_event_type_up);
 }
 
 void EventSenderProxy::touchCancel()
 {
+    notImplemented();
 }
 
 void EventSenderProxy::clearTouchPoints()
 {
+    m_touchEvents.clear();
+    m_updatedTouchEvents.clear();
 }
 
-void EventSenderProxy::releaseTouchPoint(int)
+void EventSenderProxy::releaseTouchPoint(int index)
 {
+    ASSERT(index >= 0 && index <= m_touchEvents.size());
+
+    auto& rawEvent = m_touchEvents[index];
+    rawEvent.time = m_time;
+    rawEvent.type = wpe_input_touch_event_type_up;
+    m_updatedTouchEvents.add(index);
 }
 
 void EventSenderProxy::cancelTouchPoint(int)
 {
+    notImplemented();
 }
 
 } // namespace WTR
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to