Changeset 220000 in webkit


Ignore:
Timestamp:
Jul 28, 2017 3:27:03 AM (7 years ago)
Author:
Claudio Saavedra
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.
Location:
trunk
Files:
3 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r219999 r220000  
     12017-07-28  Claudio Saavedra  <csaavedra@igalia.com>
     2
     3        [WPE] Implement EventSenderProxy in WTR
     4        https://bugs.webkit.org/show_bug.cgi?id=173419
     5
     6        Reviewed by Žan Doberšek.
     7
     8        Add the implementation of EventSenderProxy to the WTR. This
     9        allows us to extend the coverage of the test suite in WKWPE.
     10
     11        * Source/cmake/FindLibxkbcommon.cmake: Added.
     12
    1132017-07-28  Zan Dobersek  <zdobersek@igalia.com>
    214
  • trunk/LayoutTests/ChangeLog

    r219989 r220000  
     12017-07-28  Claudio Saavedra  <csaavedra@igalia.com>
     2
     3        [WPE] Implement EventSenderProxy in WTR
     4        https://bugs.webkit.org/show_bug.cgi?id=173419
     5
     6        Reviewed by Žan Doberšek.
     7
     8        Add the implementation of EventSenderProxy to the WTR. This
     9        allows us to extend the coverage of the test suite in WKWPE.
     10
     11        * platform/wpe/TestExpectations: Unskip fast/events tests, marking failures
     12        that are related to features not yet implemented in WPE. Also remove other
     13        tests that are now passing thanks to having event injection.
     14        * platform/wpe/fast/dom/HTMLTableColElement/resize-table-using-col-width-expected.txt: Update.
     15        * platform/wpe/fast/dynamic/layer-hit-test-crash-expected.txt: Update.
     16        * platform/wpe/fast/events/clientXY-in-zoom-and-scroll-expected.txt: Added.
     17        * platform/wpe/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.txt: Update.
     18
    1192017-07-27  Oleksandr Skachkov  <gskachkov@gmail.com>
    220
  • trunk/LayoutTests/platform/wpe/TestExpectations

    r219976 r220000  
    103103Bug(WPE) ietestcenter/css3/multicolumn/column-width-applies-to-015.htm [ ImageOnlyFailure ]
    104104Bug(WPE) ietestcenter/css3/valuesandunits/units-000.htm [ ImageOnlyFailure ]
    105 
    106 Bug(WPE) scrollbars/scroll-rtl-or-bt-layer.html [ Timeout ]
    107 Bug(WPE) scrollbars/scrollbar-drag-thumb-with-large-content.html [ Failure ]
    108 Bug(WPE) scrollbars/scrollbar-miss-mousemove-disabled.html [ Failure ]
    109 Bug(WPE) scrollbars/scrolling-backward-by-page-accounting-bottom-fixed-elements-on-keyboard-spacebar.html [ Failure ]
    110 Bug(WPE) scrollbars/scrolling-backward-by-page-on-keyboard-spacebar.html [ Failure ]
    111 Bug(WPE) scrollbars/scrolling-by-page-accounting-oversized-fixed-elements-on-keyboard-spacebar.html [ Failure ]
    112 Bug(WPE) scrollbars/scrolling-by-page-accounting-top-fixed-elements-on-keyboard-spacebar.html [ Failure ]
    113 Bug(WPE) scrollbars/scrolling-by-page-accounting-top-fixed-elements-with-negative-top-on-keyboard-spacebar.html [ Failure ]
    114 Bug(WPE) scrollbars/scrolling-by-page-ignoring-hidden-fixed-elements-on-keyboard-spacebar.html [ Failure ]
    115 Bug(WPE) scrollbars/scrolling-by-page-ignoring-transparent-fixed-elements-on-keyboard-spacebar.html [ Failure ]
    116 Bug(WPE) scrollbars/scrolling-by-page-on-keyboard-spacebar.html [ Failure ]
    117105
    118106# These are prone to run in parallel, consuming all the memory on the system.
     
    219207
    220208Bug(WPE) fast/encoding [ Pass ]
    221 Bug(WPE) fast/encoding/mailto-always-utf-8.html [ Timeout ]
    222209
    223210fast/events/constructors/keyboard-event-constructor.html [ Pass ]
     
    231218Bug(WPE) fast/parser/external-entities-in-xslt.xml [ Failure ]
    232219Bug(WPE) fast/parser/nested-fragment-parser-crash.html [ Failure ]
    233 Bug(WPE) fast/parser/tabindex-parsing.html [ Failure ]
    234220Bug(WPE) fast/parser/xml-colon-entity.html [ Failure ]
    235221Bug(WPE) fast/parser/xml-declaration-missing-ending-mark.html [ Failure ]
     
    261247Bug(WPE) fast/cookies [ Pass ]
    262248Bug(WPE) fast/custom-elements [ Pass ]
     249
     250Bug(WPE) fast/events [ Pass ]
     251# These tests were moved on r187990 from platform/ios-simulator/ios/fast/events/touch
     252webkit.org/b/148940 fast/events/touch/document-create-touch-list-ios.html [ Skip ]
     253webkit.org/b/148940 fast/events/touch/gesture-event-basic.html [ Skip ]
     254webkit.org/b/148940 fast/events/touch/input-touch-target.html [ Skip ]
     255webkit.org/b/148940 fast/events/touch/inserted-fragment-touch-target.html [ Skip ]
     256webkit.org/b/148940 fast/events/touch/moved-touch-target.html [ Skip ]
     257webkit.org/b/148940 fast/events/touch/multi-touch-some-without-handlers.html [ Skip ]
     258webkit.org/b/148940 fast/events/touch/ontouchstart-active-selector.html [ Skip ]
     259webkit.org/b/148940 fast/events/touch/removed-fragment-touch-target.html [ Skip ]
     260webkit.org/b/148940 fast/events/touch/removed-touch-target.html [ Skip ]
     261webkit.org/b/148940 fast/events/touch/text-node-touch-target.html [ Skip ]
     262webkit.org/b/148940 fast/events/touch/textarea-touch-target.html [ Skip ]
     263webkit.org/b/148940 fast/events/touch/touch-event-frames.html [ Skip ]
     264webkit.org/b/148940 fast/events/touch/touch-event-pageXY.html [ Skip ]
     265webkit.org/b/148940 fast/events/touch/zoomed-touch-event-pageXY.html [ Skip ]
     266
     267# Need support for internals.settings.setDeviceSupportsMouse
     268fast/events/touch/scroll-without-mouse-lacks-mousemove-events.html [ Skip ]
     269# ENABLE_TOUCH_SLIDER is disabled in WPE.
     270fast/events/touch/touch-slider.html [ Skip ]
     271# WPE does not support touch event canceling
     272webkit.org/b/128172 fast/events/touch/send-oncancel-event.html [ Skip ]
     273fast/events/touch/touch-input-element-change-documents.html
     274
     275webkit.org/b/174673 fast/events/arrow-keys-on-body.html [ Failure ]
     276webkit.org/b/174673 fast/events/keyboardevent-code.html [ Failure ]
     277webkit.org/b/174673 fast/events/keyboardevent-key.html [ Failure ]
     278webkit.org/b/174673 fast/events/key-events-in-input-button.html [ Failure ]
     279webkit.org/b/174673 fast/events/key-events-in-input-text.html [ Failure ]
     280
     281# clickCount related failures
     282webkit.org/b/174674 fast/events/click-count.html [ Failure ]
     283webkit.org/b/174674 fast/events/dblclick-addEventListener.html [ Failure ]
     284webkit.org/b/174674 fast/events/mouse-click-events.html [ Failure ]
     285webkit.org/b/174674 fast/events/selectstart-by-double-triple-clicks.html [ Failure ]
     286webkit.org/b/174674 fast/events/zoom-dblclick.html [ Failure ]
     287
     288webkit.org/b/84692 fast/events/attempt-scroll-with-no-scrollbars.html [ Failure ]
     289
     290# ENABLE_PROXIMITY_EVENTS is OFF in WPE.
     291fast/events/constructors/device-proximity-event-constructor.html [ Skip ]
     292
     293# ENABLE_DRAG_SUPPORT is OFF in WPE.
     294fast/events/5056619.html [ Skip ]
     295fast/events/before-input-events-prevent-drag-and-drop.html [ Skip ]
     296fast/events/bogus-dropEffect-effectAllowed.html [ Skip ]
     297fast/events/clear-drag-state.html [ Skip ]
     298fast/events/do-not-drag-and-drop-data-detectors-link.html [ Skip ]
     299fast/events/drag-and-drop-autoscroll-inner-frame.html [ Skip ]
     300fast/events/drag-and-drop-autoscroll.html [ Skip ]
     301fast/events/drag-and-drop-dataTransfer-types-nocrash.html [ Skip ]
     302fast/events/drag-and-drop-fire-drag-dragover.html [ Skip ]
     303fast/events/drag-and-drop-link-containing-block.html [ Skip ]
     304fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html [ Skip ]
     305fast/events/drag-and-drop-link-into-focused-contenteditable.html [ Skip ]
     306fast/events/drag-and-drop-link.html [ Skip ]
     307fast/events/drag-and-drop-set-drag-data-arguments.html [ Skip ]
     308fast/events/drag-and-drop-subframe-dataTransfer.html [ Skip ]
     309fast/events/drag-and-drop.html [ Skip ]
     310fast/events/drag-customData.html [ Skip ]
     311fast/events/drag-dataTransferItemList-file-handling.html [ Skip ]
     312fast/events/drag-display-none-element.html [ Skip ]
     313fast/events/drag-image-filename.html [ Skip ]
     314fast/events/drag-in-frames.html [ Skip ]
     315fast/events/drag-outside-window.html [ Skip ]
     316fast/events/drag-parent-node.html [ Skip ]
     317fast/events/drag-select-when-zoomed-with-header.html [ Skip ]
     318fast/events/drag-select-when-zoomed.html [ Skip ]
     319fast/events/drag-selects-image.html [ Skip ]
     320fast/events/drag-text-with-clear.html [ Skip ]
     321fast/events/draggable-div-customdata.html [ Skip ]
     322fast/events/draggable-div-nodata.html [ Skip ]
     323fast/events/dropzone-001.html [ Skip ]
     324fast/events/dropzone-002.html [ Skip ]
     325fast/events/dropzone-003.html [ Skip ]
     326fast/events/dropzone-005.html [ Skip ]
     327fast/events/event-attribute.html [ Skip ]
     328fast/events/mousedown-inside-dragstart-should-not-cause-crash.html [ Skip ]
     329fast/events/ondragenter.html [ Skip ]
     330fast/events/remove-target-with-shadow-in-drag.html [ Skip ]
     331fast/events/resources/drag-in-frames-left.html [ Skip ]
     332fast/events/resources/drag-in-frames-right.html [ Skip ]
     333fast/events/shift-drag-selection-on-image-triggers-drag-n-drop.html [ Skip ]
     334fast/events/shift-drag-selection-on-link-triggers-drag-n-drop.html [ Skip ]
     335fast/events/touch/gesture/long-press-on-draggable-element-triggers-drag.html [ Skip ]
     336fast/events/touch/gesture/resources/drag-inside-iframe2.html [ Skip ]
     337fast/events/touch/gesture/resources/drag-inside-nested-iframes3.html [ Skip ]
     338
     339# Tests below are copied from wk2 expectations, because we've marked
     340#  as passing the whole fast/events directory.
     341
     342# WebKitTestRunner needs testRunner.abortModal
     343# <https://bugs.webkit.org/show_bug.cgi?id=69548>
     344fast/events/beforeunload-showModalDialog.html
     345fast/events/pagehide-showModalDialog.html
     346fast/events/scroll-event-during-modal-dialog.html
     347fast/events/show-modal-dialog-onblur-onfocus.html
     348fast/events/unload-showModalDialog.html
     349
     350# WebKitTestRunner needs an implementation of eventSender.beginDragWithFiles
     351# https://bugs.webkit.org/show_bug.cgi?id=64285
     352fast/events/data-transfer-files-attribute-identity.html
     353fast/events/drag-file-crash.html
     354fast/events/drag-to-navigate.html
     355fast/events/drop-handler-should-not-stop-navigate.html
     356fast/events/drop-with-file-paths.html
     357fast/events/dropzone-004.html
     358fast/events/file-input-hidden-in-ondrop.html
     359fast/events/input-element-display-none-in-dragleave-crash.html
     360fast/events/only-valid-drop-targets-receive-file-drop.html
     361fast/events/prevent-drag-to-navigate.html
     362
     363# WebKitTestRunner needs textInputController
     364# <https://bugs.webkit.org/show_bug.cgi?id=42337>
     365fast/events/ime-composition-events-001.html
     366
     367# testRunner.setWindowIsKey() has no effect on the web process side in WebKit2
     368# https://bugs.webkit.org/show_bug.cgi?id=81736 rdar://problem/11088268
     369fast/events/blur-focus-window-should-blur-focus-element.html
     370
     371# eventSender.dragMode is unimplemented in WKTR
     372# Mac: https://bugs.webkit.org/show_bug.cgi?id=68552
     373fast/events/controlclick-no-onclick.html
     374fast/events/moving-text-should-fire-drop-and-dragend-events.html
     375fast/events/moving-text-should-fire-drop-and-dragend-events-2.html
     376fast/events/ondrop-text-html.html
     377
     378# WTR needs an implementation for eventSender.continuousMouseScrollBy
     379# https://bugs.webkit.org/show_bug.cgi?id=69417
     380fast/events/wheelevent-direction-inverted-from-device.html
     381
     382# The tests below need gardening after the EventSenderWPE has been added.
     383# Most of them are probably failing because of missing support of event related
     384# features in WPE.
     385webkit.org/b/173419 fast/events/autoscroll-in-overflow-hidden-html.html [ Failure ]
     386webkit.org/b/173419 fast/events/autoscroll-in-textarea.html [ Failure ]
     387webkit.org/b/173419 fast/events/autoscroll-in-textfield.html [ Failure ]
     388webkit.org/b/173419 fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div.html [ Failure ]
     389webkit.org/b/173419 fast/events/before-input-prevent-paste.html [ Failure ]
     390webkit.org/b/173419 fast/events/click-focus-control.html [ Failure ]
     391webkit.org/b/173419 fast/events/click-range-slider.html [ Failure ]
     392webkit.org/b/173419 fast/events/constructors/media-stream-event-constructor.html [ Failure ]
     393webkit.org/b/173419 fast/events/constructors/mouse-event-constructor.html [ Failure ]
     394webkit.org/b/173419 fast/events/constructors/overconstrained-error-event-constructor.html [ Failure ]
     395webkit.org/b/173419 fast/events/constructors/wheel-event-constructor.html [ Failure ]
     396webkit.org/b/173419 fast/events/content-changed-during-drop.html [ Failure ]
     397webkit.org/b/173419 fast/events/context-activated-by-key-event.html [ Failure ]
     398webkit.org/b/173419 fast/events/continuous-platform-wheelevent-in-scrolling-div.html [ Failure ]
     399webkit.org/b/173419 fast/events/crash-on-mutate-during-drop.html [ Failure ]
     400webkit.org/b/173419 fast/events/frame-tab-focus.html [ Failure ]
     401webkit.org/b/173419 fast/events/ime-compositionend-on-selection-change.html [ Failure ]
     402webkit.org/b/173419 fast/events/input-events-drag-and-drop.html [ Failure ]
     403webkit.org/b/173419 fast/events/input-events-insert-by-drop.html [ Failure ]
     404webkit.org/b/173419 fast/events/input-events-paste-data.html [ Failure ]
     405webkit.org/b/173419 fast/events/input-events-paste-rich-datatransfer.html [ Failure ]
     406webkit.org/b/173419 fast/events/js-keyboard-event-creation.html [ Failure ]
     407webkit.org/b/173419 fast/events/keydown-1.html [ Failure ]
     408webkit.org/b/173419 fast/events/keydown-numpad-keys.html [ Failure ]
     409webkit.org/b/173419 fast/events/mouse-cursor-image-set.html [ Failure ]
     410webkit.org/b/173419 fast/events/mouse-drag-from-frame-to-other-frame.html [ Failure ]
     411webkit.org/b/173419 fast/events/mouse-drag-from-frame.html [ Failure ]
     412webkit.org/b/173419 fast/events/mouseenterleave-on-subframe.html [ Failure ]
     413webkit.org/b/173419 fast/events/mouseover-button.html [ Failure ]
     414webkit.org/b/173419 fast/events/mouseover-mouseout.html [ Failure ]
     415webkit.org/b/173419 fast/events/mouseover-mouseout2.html [ Failure ]
     416webkit.org/b/173419 fast/events/mouseup-from-button2.html [ Failure ]
     417webkit.org/b/173419 fast/events/no-scroll-on-input-text-selection.html [ Failure ]
     418webkit.org/b/173419 fast/events/node-event-anchor-lock.html [ Failure ]
     419webkit.org/b/173419 fast/events/offsetX-offsetY.html [ Failure ]
     420webkit.org/b/173419 fast/events/onchange-range-slider.html [ Failure ]
     421webkit.org/b/173419 fast/events/option-tab.html [ Failure ]
     422webkit.org/b/173419 fast/events/page-scaled-mouse-click-iframe.html [ Failure ]
     423webkit.org/b/173419 fast/events/platform-wheelevent-in-scrolling-div.html [ Failure ]
     424webkit.org/b/173419 fast/events/platform-wheelevent-paging-x-in-non-scrolling-div.html [ Failure ]
     425webkit.org/b/173419 fast/events/platform-wheelevent-paging-x-in-non-scrolling-page.html [ Failure ]
     426webkit.org/b/173419 fast/events/platform-wheelevent-paging-x-in-scrolling-div.html [ Failure ]
     427webkit.org/b/173419 fast/events/platform-wheelevent-paging-x-in-scrolling-page.html [ Failure ]
     428webkit.org/b/173419 fast/events/platform-wheelevent-paging-xy-in-scrolling-div.html [ Failure ]
     429webkit.org/b/173419 fast/events/platform-wheelevent-paging-xy-in-scrolling-page.html [ Failure ]
     430webkit.org/b/173419 fast/events/platform-wheelevent-paging-y-in-non-scrolling-div.html [ Failure ]
     431webkit.org/b/173419 fast/events/platform-wheelevent-paging-y-in-non-scrolling-page.html [ Failure ]
     432webkit.org/b/173419 fast/events/platform-wheelevent-paging-y-in-scrolling-div.html [ Failure ]
     433webkit.org/b/173419 fast/events/platform-wheelevent-paging-y-in-scrolling-page.html [ Failure ]
     434webkit.org/b/173419 fast/events/scroll-in-scaled-page-with-overflow-hidden.html [ Failure ]
     435webkit.org/b/173419 fast/events/selectstart-by-drag.html [ Failure ]
     436webkit.org/b/173419 fast/events/selectstart-by-single-click-with-shift.html [ Failure ]
     437webkit.org/b/173419 fast/events/sequential-focus-navigation-starting-point.html [ Failure ]
     438webkit.org/b/173419 fast/events/shadow-event-path-2.html [ Failure ]
     439webkit.org/b/173419 fast/events/shadow-event-path.html [ Failure ]
     440webkit.org/b/173419 fast/events/special-key-events-in-input-text.html [ Failure ]
     441webkit.org/b/173419 fast/events/tabindex-focus-blur-all.html [ Failure ]
     442webkit.org/b/173419 fast/events/touch/basic-multi-touch-events-limited.html [ Failure ]
     443webkit.org/b/173419 fast/events/touch/basic-multi-touch-events.html [ Failure ]
     444webkit.org/b/173419 fast/events/touch/document-create-touch-list.html [ Failure ]
     445webkit.org/b/173419 fast/events/touch/document-create-touch.html [ Failure ]
     446webkit.org/b/173419 fast/events/touch/emulate-touch-events.html [ Failure ]
     447webkit.org/b/173419 fast/events/touch/touch-before-pressing-spin-button.html [ Failure ]
     448webkit.org/b/173419 fast/events/webkit-media-key-events-constructor.html [ Failure ]
     449webkit.org/b/173419 fast/events/wheelevent-basic.html [ Failure ]
     450webkit.org/b/173419 fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html [ Failure ]
     451webkit.org/b/173419 fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html [ Failure ]
     452webkit.org/b/173419 fast/events/autoscroll-main-document.html [ Timeout ]
     453webkit.org/b/173419 fast/events/autoscroll-should-not-stop-on-keypress.html [ Timeout ]
     454webkit.org/b/173419 fast/events/autoscroll-when-zoomed.html [ Timeout ]
     455webkit.org/b/173419 fast/events/before-input-prevent-insert-replacement.html [ Timeout ]
     456webkit.org/b/173419 fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html [ Timeout ]
     457webkit.org/b/173419 fast/events/clipboard-dataTransferItemList.html [ Timeout ]
     458webkit.org/b/173419 fast/events/drag-dataTransferItemList.html [ Timeout ]
     459webkit.org/b/173419 fast/events/event-view-toString.html [ Timeout ]
     460webkit.org/b/173419 fast/events/frame-detached-in-mousedown.html [ Timeout ]
     461webkit.org/b/173419 fast/events/iframe-onmousemove.html [ Timeout ]
     462webkit.org/b/173419 fast/events/input-event-insert-replacement.html [ Timeout ]
     463webkit.org/b/173419 fast/events/mouse-force-changed.html [ Timeout ]
     464webkit.org/b/173419 fast/events/mouse-force-down.html [ Timeout ]
     465webkit.org/b/173419 fast/events/mouse-force-up.html [ Timeout ]
     466webkit.org/b/173419 fast/events/mouse-moved-remove-frame-crash.html [ Timeout ]
     467webkit.org/b/173419 fast/events/page-visibility-iframe-delete-test.html [ Timeout ]
     468webkit.org/b/173419 fast/events/page-visibility-iframe-move-test.html [ Timeout ]
     469webkit.org/b/173419 fast/events/page-visibility-iframe-propagation-test.html [ Timeout ]
     470webkit.org/b/173419 fast/events/page-visibility-onvisibilitychange.html [ Timeout ]
     471webkit.org/b/173419 fast/events/page-visibility-transition-test.html [ Timeout ]
     472webkit.org/b/173419 fast/events/popup-blocking-click-in-iframe.html [ Timeout ]
     473webkit.org/b/173419 fast/events/scroll-after-click-on-tab-index.html [ Timeout ]
     474webkit.org/b/173419 fast/events/standalone-image-drag-to-editable.html [ Timeout ]
     475webkit.org/b/173419 fast/events/touch/emulated-touch-iframe.html [ Timeout ]
     476webkit.org/b/173419 fast/events/touch/multi-touch-grouped-targets.html [ Timeout ]
     477webkit.org/b/173419 fast/events/touch/multi-touch-inside-nested-iframes.html [ Timeout ]
     478webkit.org/b/173419 fast/events/touch/page-scaled-touch-gesture-click.html [ Timeout ]
     479webkit.org/b/173419 fast/events/touch/touch-target-limited.html [ Timeout ]
     480webkit.org/b/173419 fast/events/touch/touch-target.html [ Timeout ]
     481webkit.org/b/173419 fast/events/wheel-event-destroys-frame.html [ Timeout ]
     482
     483fast/events/ios [ Skip ]
     484fast/events/touch/ios [ Skip ]
     485fast/events/touch/gesture [ Skip ]
     486
    263487Bug(WPE) fast/eventsource [ Pass ]
    264488Bug(WPE) fast/gradients [ Pass ]
     
    313537Bug(WPE) fast/dom/HTMLTextAreaElement [ Pass ]
    314538Bug(WPE) fast/dom/MutationObserver [ Pass ]
    315 Bug(WPE) fast/dom/MutationObserver/end-of-task-delivery.html [ Timeout ]
    316 Bug(WPE) fast/dom/MutationObserver/inline-event-listener.html [ Timeout ]
     539webkit.org/b/78290 fast/dom/MutationObserver/end-of-task-delivery.html [ Failure ]
    317540Bug(WPE) fast/dom/NavigatorContentUtils [ Pass ]
    318541Bug(WPE) fast/dom/NavigatorContentUtils/is-protocol-handler-registered.html [ Failure ]
    319542Bug(WPE) fast/dom/Node [ Pass ]
    320 Bug(WPE) fast/dom/Node/mutation-blur.html [ Timeout ]
    321543Bug(WPE) fast/dom/NodeList [ Pass ]
    322544Bug(WPE) fast/dom/Orientation [ Pass ]
     
    335557Bug(WPE) storage/indexeddb/modern/worker-getall.html [ Timeout ]
    336558Bug(WPE) storage/domstorage/events/basic-body-attribute.html [ Failure ]
    337 webkit.org/b/173419 storage/domstorage/sessionstorage/set-item-synchronous-keydown.html [ Failure ]
    338559Bug(WPE) storage/indexeddb/basics-workers.html [ Failure ]
    339560Bug(WPE) storage/indexeddb/cursor-advance-workers.html [ Failure ]
  • trunk/LayoutTests/platform/wpe/fast/dom/HTMLTableColElement/resize-table-using-col-width-expected.txt

    r216500 r220000  
    44  RenderBlock {HTML} at (0,0) size 800x600
    55    RenderBody {BODY} at (8,8) size 784x584
    6       RenderTable {TABLE} at (0,0) size 238x50 [border: (1px outset #808080)]
     6      RenderTable {TABLE} at (0,0) size 662x50 [border: (1px outset #808080)]
    77        RenderTableCol {COLGROUP} at (0,0) size 0x0
    88          RenderTableCol {COL} at (0,0) size 0x0
    99          RenderTableCol {COL} at (0,0) size 0x0
    1010          RenderTableCol {COL} at (0,0) size 0x0
    11         RenderTableSection {TBODY} at (1,1) size 236x48
    12           RenderTableRow {TR} at (0,2) size 236x21
    13             RenderTableCell {TD} at (2,2) size 76x21 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
     11        RenderTableSection {TBODY} at (1,1) size 660x48
     12          RenderTableRow {TR} at (0,2) size 660x21
     13            RenderTableCell {TD} at (2,2) size 500x21 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
    1414              RenderText {#text} at (2,2) size 72x17
    1515                text run at (2,2) width 72: "col 1 row 1"
    16             RenderTableCell {TD} at (80,2) size 76x21 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
     16            RenderTableCell {TD} at (504,2) size 76x21 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
    1717              RenderText {#text} at (2,2) size 72x17
    1818                text run at (2,2) width 72: "col 2 row 1"
    19             RenderTableCell {TD} at (158,2) size 76x21 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]
     19            RenderTableCell {TD} at (582,2) size 76x21 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]
    2020              RenderText {#text} at (2,2) size 72x17
    2121                text run at (2,2) width 72: "col 3 row 1"
    22           RenderTableRow {TR} at (0,25) size 236x21
    23             RenderTableCell {TD} at (2,25) size 76x21 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
     22          RenderTableRow {TR} at (0,25) size 660x21
     23            RenderTableCell {TD} at (2,25) size 500x21 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
    2424              RenderText {#text} at (2,2) size 72x17
    2525                text run at (2,2) width 72: "col 1 row 2"
    26             RenderTableCell {TD} at (80,25) size 76x21 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]
     26            RenderTableCell {TD} at (504,25) size 76x21 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]
    2727              RenderText {#text} at (2,2) size 72x17
    2828                text run at (2,2) width 72: "col 2 row 2"
    29             RenderTableCell {TD} at (158,25) size 76x21 [border: (1px inset #808080)] [r=1 c=2 rs=1 cs=1]
     29            RenderTableCell {TD} at (582,25) size 76x21 [border: (1px inset #808080)] [r=1 c=2 rs=1 cs=1]
    3030              RenderText {#text} at (2,2) size 72x17
    3131                text run at (2,2) width 72: "col 3 row 3"
  • trunk/LayoutTests/platform/wpe/fast/dynamic/layer-hit-test-crash-expected.txt

    r216500 r220000  
    1616layer at (70,50) size 100x100
    1717  RenderBlock (positioned) zI: 5 {DIV} at (20,0) size 100x100 [bgcolor=#FF0000]
     18caret: position 0 of child 1 {DIV} of child 3 {DIV} of body
  • trunk/LayoutTests/platform/wpe/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.txt

    r216500 r220000  
    99          text run at (0,17) width 74: "dependent)."
    1010      RenderBlock {DIV} at (0,342) size 784x0
    11 layer at (8,66) size 292x292 clip at (58,116) size 177x177 scrollHeight 272
     11layer at (8,66) size 292x292 clip at (58,116) size 177x177 scrollY 95 scrollHeight 272
    1212  RenderBlock {DIV} at (0,50) size 292x292 [border: (50px double #000000)]
    1313    RenderText {#text} at (50,50) size 173x272
  • trunk/Tools/ChangeLog

    r219990 r220000  
     12017-07-28  Claudio Saavedra  <csaavedra@igalia.com>
     2
     3        [WPE] Implement EventSenderProxy in WTR
     4        https://bugs.webkit.org/show_bug.cgi?id=173419
     5
     6        Reviewed by Žan Doberšek.
     7
     8        Add the implementation of EventSenderProxy to the WTR. This
     9        allows us to extend the coverage of the test suite in WKWPE.
     10
     11        * WebKitTestRunner/EventSenderProxy.h:
     12        * WebKitTestRunner/PlatformWPE.cmake: Add dependency on
     13        libxkbcommon needed to deal with key events.
     14        * WebKitTestRunner/wpe/EventSenderProxyWPE.cpp:
     15        (WTR::EventSenderProxy::EventSenderProxy):
     16        (WTR::senderButtonToWPEButton):
     17        (WTR::EventSenderProxy::mouseDown):
     18        (WTR::EventSenderProxy::mouseUp):
     19        (WTR::EventSenderProxy::mouseMoveTo):
     20        (WTR::EventSenderProxy::mouseScrollBy):
     21        (WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases):
     22        (WTR::EventSenderProxy::leapForward):
     23        (WTR::wkEventModifiersToWPE):
     24        (WTR::getXKBKeySymForKeyRef):
     25        (WTR::EventSenderProxy::keyDown):
     26        (WTR::EventSenderProxy::addTouchPoint):
     27        (WTR::EventSenderProxy::updateTouchPoint):
     28        (WTR::EventSenderProxy::setTouchModifier):
     29        (WTR::EventSenderProxy::setTouchPointRadius):
     30        (WTR::EventSenderProxy::getUpdatedTouchEvents):
     31        (WTR::EventSenderProxy::removeUpdatedTouchEvents):
     32        (WTR::EventSenderProxy::prepareAndDispatchTouchEvent):
     33        (WTR::EventSenderProxy::touchStart):
     34        (WTR::EventSenderProxy::touchMove):
     35        (WTR::EventSenderProxy::touchEnd):
     36        (WTR::EventSenderProxy::touchCancel):
     37        (WTR::EventSenderProxy::clearTouchPoints):
     38        (WTR::EventSenderProxy::releaseTouchPoint):
     39        (WTR::EventSenderProxy::cancelTouchPoint):
     40
    1412017-07-27  Brady Eidson  <beidson@apple.com>
    242
  • trunk/Tools/WebKitTestRunner/EventSenderProxy.h

    r215758 r220000  
    3636#include <WebCore/GUniquePtrGtk.h>
    3737#include <gdk/gdk.h>
     38#include <wtf/HashSet.h>
     39#endif
     40
     41#if PLATFORM(WPE)
     42#include <wpe/input.h>
    3843#include <wtf/HashSet.h>
    3944#endif
     
    115120#endif
    116121
     122#if PLATFORM(WPE)
     123    Vector<struct wpe_input_touch_event_raw> getUpdatedTouchEvents();
     124    void removeUpdatedTouchEvents();
     125    void prepareAndDispatchTouchEvent(enum wpe_input_touch_event_type);
     126#endif
     127
    117128    double m_time;
    118129    WKPoint m_position;
     
    129140    Vector<GUniquePtr<GdkEvent>> m_touchEvents;
    130141    HashSet<int> m_updatedTouchEvents;
     142#elif PLATFORM(WPE)
     143    struct wpe_view_backend* m_viewBackend;
     144    uint32_t m_buttonState;
     145    Vector<struct wpe_input_touch_event_raw> m_touchEvents;
     146    HashSet<unsigned, DefaultHash<unsigned>::Hash, WTF::UnsignedWithZeroKeyHashTraits<unsigned>> m_updatedTouchEvents;
    131147#endif
    132148};
  • trunk/Tools/WebKitTestRunner/PlatformWPE.cmake

    r216497 r220000  
    11find_package(LibGBM REQUIRED)
    22find_package(WPEBackend-mesa REQUIRED)
     3find_package(Libxkbcommon 0.4.0 REQUIRED)
    34
    45add_custom_target(WebKitTestRunner-forwarding-headers
     
    2425    ${GLIB_INCLUDE_DIRS}
    2526    ${LIBGBM_INCLUDE_DIRS}
     27    ${LIBXKBCOMMON_INCLUDE_DIRS}
    2628    ${WPE_MESA_INCLUDE_DIRS}
    2729)
     
    3133    ${GLIB_LIBRARIES}
    3234    ${LIBGBM_LIBRARIES}
     35    ${LIBXKBCOMMON_LIBRARIES}
    3336    ${WPE_MESA_LIBRARIES}
    3437)
  • trunk/Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp

    r216497 r220000  
    2727#include "EventSenderProxy.h"
    2828
     29#include "HeadlessViewBackend.h"
     30#include "NotImplemented.h"
     31#include "PlatformWebView.h"
     32#include "TestController.h"
     33#include <wpe/view-backend.h>
     34#include <xkbcommon/xkbcommon-keysyms.h>
     35#include <xkbcommon/xkbcommon.h>
     36
    2937namespace WTR {
     38
     39// Key event location code defined in DOM Level 3.
     40enum KeyLocationCode {
     41    DOMKeyLocationStandard      = 0x00,
     42    DOMKeyLocationLeft          = 0x01,
     43    DOMKeyLocationRight         = 0x02,
     44    DOMKeyLocationNumpad        = 0x03
     45};
     46
     47enum ButtonState {
     48    ButtonReleased = 0,
     49    ButtonPressed = 1
     50};
     51
     52enum PointerAxis {
     53    VerticalScroll = 0,
     54    HorizontalScroll = 1
     55};
    3056
    3157EventSenderProxy::EventSenderProxy(TestController* testController)
     
    3662    , m_clickTime(0)
    3763    , m_clickButton(kWKEventMouseButtonNoButton)
    38 {
     64    , m_buttonState(ButtonReleased)
     65{
     66    m_viewBackend = m_testController->mainWebView()->platformWindow()->backend();
    3967}
    4068
     
    4371}
    4472
    45 void EventSenderProxy::mouseDown(unsigned, WKEventModifiers)
    46 {
    47 }
    48 
    49 void EventSenderProxy::mouseUp(unsigned, WKEventModifiers)
    50 {
    51 }
    52 
    53 void EventSenderProxy::mouseMoveTo(double, double)
    54 {
    55 }
    56 
    57 void EventSenderProxy::mouseScrollBy(int, int)
    58 {
    59 }
    60 
    61 void EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases(int, int, int, int)
    62 {
     73unsigned senderButtonToWPEButton(unsigned senderButton)
     74{
     75    // Tests using the EventSender have a different numbering ordering than the one
     76    // that the WPE port expects. Shuffle these here.
     77    switch (senderButton) {
     78    case 0:
     79        return 1;
     80    case 1:
     81        return 3;
     82    case 2:
     83        return 2;
     84    default:
     85        return senderButton;
     86    }
     87}
     88
     89void EventSenderProxy::mouseDown(unsigned button, WKEventModifiers wkModifiers)
     90{
     91    m_clickButton = button;
     92    m_clickPosition = m_position;
     93    m_clickTime = m_time;
     94    m_buttonState = ButtonPressed;
     95
     96    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};
     97    wpe_view_backend_dispatch_pointer_event(m_viewBackend, &event);
     98}
     99
     100void EventSenderProxy::mouseUp(unsigned button, WKEventModifiers wkModifiers)
     101{
     102    m_buttonState = ButtonReleased;
     103    m_clickButton = kWKEventMouseButtonNoButton;
     104
     105    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};
     106    wpe_view_backend_dispatch_pointer_event(m_viewBackend, &event);
     107}
     108
     109void EventSenderProxy::mouseMoveTo(double x, double y)
     110{
     111    m_position.x = x;
     112    m_position.y = y;
     113
     114    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};
     115    wpe_view_backend_dispatch_pointer_event(m_viewBackend, &event);
     116}
     117
     118void EventSenderProxy::mouseScrollBy(int horizontal, int vertical)
     119{
     120    // Copy behaviour of GTK+ - just return in case of (0,0) mouse scroll
     121    if (!horizontal && !vertical)
     122        return;
     123
     124    if (horizontal) {
     125        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};
     126        wpe_view_backend_dispatch_axis_event(m_viewBackend, &event);
     127    }
     128    if (vertical) {
     129        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};
     130        wpe_view_backend_dispatch_axis_event(m_viewBackend, &event);
     131    }
     132}
     133
     134void EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases(int horizontal, int vertical, int, int)
     135{
     136    mouseScrollBy(horizontal, vertical);
    63137}
    64138
     
    67141}
    68142
    69 void EventSenderProxy::leapForward(int)
    70 {
    71 }
    72 
    73 void EventSenderProxy::keyDown(WKStringRef, WKEventModifiers, unsigned)
    74 {
    75 }
    76 
    77 void EventSenderProxy::addTouchPoint(int, int)
    78 {
    79 }
    80 
    81 void EventSenderProxy::updateTouchPoint(int, int, int)
    82 {
     143void EventSenderProxy::leapForward(int milliseconds)
     144{
     145    m_time += milliseconds / 1000.0;
     146}
     147
     148static uint8_t wkEventModifiersToWPE(WKEventModifiers wkModifiers)
     149{
     150    uint8_t modifiers = 0;
     151    if (wkModifiers & kWKEventModifiersShiftKey)
     152        modifiers |=  wpe_input_keyboard_modifier_shift;
     153    if (wkModifiers & kWKEventModifiersControlKey)
     154        modifiers |= wpe_input_keyboard_modifier_control;
     155    if (wkModifiers & kWKEventModifiersAltKey)
     156        modifiers |= wpe_input_keyboard_modifier_alt;
     157    if (wkModifiers & kWKEventModifiersMetaKey)
     158        modifiers |= wpe_input_keyboard_modifier_meta;
     159
     160    return modifiers;
     161}
     162
     163int getXKBKeySymForKeyRef(WKStringRef keyRef, unsigned location, uint8_t* modifiers)
     164{
     165    if (location == DOMKeyLocationNumpad) {
     166        if (WKStringIsEqualToUTF8CString(keyRef, "leftArrow"))
     167            return XKB_KEY_KP_Left;
     168        if (WKStringIsEqualToUTF8CString(keyRef, "rightArror"))
     169            return XKB_KEY_KP_Right;
     170        if (WKStringIsEqualToUTF8CString(keyRef, "upArrow"))
     171            return XKB_KEY_KP_Up;
     172        if (WKStringIsEqualToUTF8CString(keyRef, "downArrow"))
     173            return XKB_KEY_KP_Down;
     174        if (WKStringIsEqualToUTF8CString(keyRef, "pageUp"))
     175            return XKB_KEY_KP_Page_Up;
     176        if (WKStringIsEqualToUTF8CString(keyRef, "pageDown"))
     177            return XKB_KEY_KP_Page_Down;
     178        if (WKStringIsEqualToUTF8CString(keyRef, "home"))
     179            return XKB_KEY_KP_Home;
     180        if (WKStringIsEqualToUTF8CString(keyRef, "end"))
     181            return XKB_KEY_KP_End;
     182        if (WKStringIsEqualToUTF8CString(keyRef, "insert"))
     183            return XKB_KEY_KP_Insert;
     184        if (WKStringIsEqualToUTF8CString(keyRef, "delete"))
     185            return XKB_KEY_KP_Delete;
     186
     187        return XKB_KEY_VoidSymbol;
     188    }
     189
     190    if (WKStringIsEqualToUTF8CString(keyRef, "leftControl"))
     191        return XKB_KEY_Control_L;
     192    if (WKStringIsEqualToUTF8CString(keyRef, "rightControl"))
     193        return XKB_KEY_Control_R;
     194    if (WKStringIsEqualToUTF8CString(keyRef, "leftShift"))
     195        return XKB_KEY_Shift_L;
     196    if (WKStringIsEqualToUTF8CString(keyRef, "rightShift"))
     197        return XKB_KEY_Shift_R;
     198    if (WKStringIsEqualToUTF8CString(keyRef, "leftAlt"))
     199        return XKB_KEY_Alt_L;
     200    if (WKStringIsEqualToUTF8CString(keyRef, "rightAlt"))
     201        return XKB_KEY_Alt_R;
     202    if (WKStringIsEqualToUTF8CString(keyRef, "leftArrow"))
     203        return XKB_KEY_Left;
     204    if (WKStringIsEqualToUTF8CString(keyRef, "rightArrow"))
     205        return XKB_KEY_Right;
     206    if (WKStringIsEqualToUTF8CString(keyRef, "upArrow"))
     207        return XKB_KEY_Up;
     208    if (WKStringIsEqualToUTF8CString(keyRef, "downArrow"))
     209        return XKB_KEY_Down;
     210    if (WKStringIsEqualToUTF8CString(keyRef, "pageUp"))
     211        return XKB_KEY_Page_Up;
     212    if (WKStringIsEqualToUTF8CString(keyRef, "pageDown"))
     213        return XKB_KEY_Page_Down;
     214    if (WKStringIsEqualToUTF8CString(keyRef, "home"))
     215        return XKB_KEY_Home;
     216    if (WKStringIsEqualToUTF8CString(keyRef, "end"))
     217        return XKB_KEY_End;
     218    if (WKStringIsEqualToUTF8CString(keyRef, "insert"))
     219        return XKB_KEY_Insert;
     220    if (WKStringIsEqualToUTF8CString(keyRef, "delete"))
     221        return XKB_KEY_Delete;
     222    if (WKStringIsEqualToUTF8CString(keyRef, "printScreen"))
     223        return XKB_KEY_Print;
     224    if (WKStringIsEqualToUTF8CString(keyRef, "menu"))
     225        return XKB_KEY_Menu;
     226    if (WKStringIsEqualToUTF8CString(keyRef, "F1"))
     227        return XKB_KEY_F1;
     228    if (WKStringIsEqualToUTF8CString(keyRef, "F2"))
     229        return XKB_KEY_F2;
     230    if (WKStringIsEqualToUTF8CString(keyRef, "F3"))
     231        return XKB_KEY_F3;
     232    if (WKStringIsEqualToUTF8CString(keyRef, "F4"))
     233        return XKB_KEY_F4;
     234    if (WKStringIsEqualToUTF8CString(keyRef, "F5"))
     235        return XKB_KEY_F5;
     236    if (WKStringIsEqualToUTF8CString(keyRef, "F6"))
     237        return XKB_KEY_F6;
     238    if (WKStringIsEqualToUTF8CString(keyRef, "F7"))
     239        return XKB_KEY_F7;
     240    if (WKStringIsEqualToUTF8CString(keyRef, "F8"))
     241        return XKB_KEY_F8;
     242    if (WKStringIsEqualToUTF8CString(keyRef, "F9"))
     243        return XKB_KEY_F9;
     244    if (WKStringIsEqualToUTF8CString(keyRef, "F10"))
     245        return XKB_KEY_F10;
     246    if (WKStringIsEqualToUTF8CString(keyRef, "F11"))
     247        return XKB_KEY_F11;
     248    if (WKStringIsEqualToUTF8CString(keyRef, "F12"))
     249        return XKB_KEY_F12;
     250
     251    size_t bufferSize = WKStringGetMaximumUTF8CStringSize(keyRef);
     252    auto buffer = std::make_unique<char[]>(bufferSize);
     253    WKStringGetUTF8CString(keyRef, buffer.get(), bufferSize);
     254    char charCode = buffer.get()[0];
     255
     256    if (charCode == '\n' || charCode == '\r')
     257        return XKB_KEY_Return;
     258    if (charCode == '\t')
     259        return XKB_KEY_Tab;
     260    if (charCode == '\x8')
     261        return XKB_KEY_BackSpace;
     262    if (charCode == 0x001B)
     263        return XKB_KEY_Escape;
     264
     265    if (WTF::isASCIIUpper(charCode))
     266        *modifiers |= wpe_input_keyboard_modifier_shift;
     267
     268    // Not sure if this is correct.
     269    return charCode;
     270}
     271
     272void EventSenderProxy::keyDown(WKStringRef keyRef, WKEventModifiers wkModifiers, unsigned location)
     273{
     274    uint8_t modifiers = wkEventModifiersToWPE(wkModifiers);
     275    uint32_t keySym = getXKBKeySymForKeyRef(keyRef, location, &modifiers);
     276    uint32_t unicode = xkb_keysym_to_utf32(keySym);
     277    struct wpe_input_keyboard_event event { static_cast<uint32_t>(m_time), keySym, unicode, true, modifiers};
     278    wpe_view_backend_dispatch_keyboard_event(m_viewBackend, &event);
     279    event.pressed = false;
     280    wpe_view_backend_dispatch_keyboard_event(m_viewBackend, &event);
     281}
     282
     283void EventSenderProxy::addTouchPoint(int x, int y)
     284{
     285    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) };
     286    m_touchEvents.append(rawEvent);
     287    m_updatedTouchEvents.add(rawEvent.id);
     288}
     289
     290void EventSenderProxy::updateTouchPoint(int index, int x, int y)
     291{
     292    ASSERT(index >= 0 && index <= m_touchEvents.size());
     293
     294    auto& rawEvent = m_touchEvents[index];
     295    rawEvent.x = x;
     296    rawEvent.y = y;
     297    rawEvent.time = m_time;
     298    rawEvent.type = wpe_input_touch_event_type_motion;
     299    m_updatedTouchEvents.add(index);
    83300}
    84301
    85302void EventSenderProxy::setTouchModifier(WKEventModifiers, bool)
    86303{
     304    notImplemented();
    87305}
    88306
    89307void EventSenderProxy::setTouchPointRadius(int, int)
    90308{
     309    notImplemented();
     310}
     311
     312Vector<struct wpe_input_touch_event_raw> EventSenderProxy::getUpdatedTouchEvents()
     313{
     314    Vector<wpe_input_touch_event_raw> events;
     315    for (auto id : m_updatedTouchEvents)
     316        events.append(m_touchEvents[id]);
     317    return events;
     318}
     319
     320void EventSenderProxy::removeUpdatedTouchEvents()
     321{
     322    for (auto id : m_updatedTouchEvents)
     323        m_touchEvents[id].type = wpe_input_touch_event_type_null;
     324    m_touchEvents.removeAllMatching([] (auto current) {
     325        return current.type == wpe_input_touch_event_type_null;
     326        });
     327}
     328
     329void EventSenderProxy::prepareAndDispatchTouchEvent(enum wpe_input_touch_event_type eventType)
     330{
     331    auto updatedEvents = getUpdatedTouchEvents();
     332    struct wpe_input_touch_event event = { updatedEvents.data(), updatedEvents.size(), eventType, 0, static_cast<uint32_t>(m_time) };
     333    wpe_view_backend_dispatch_touch_event(m_viewBackend, &event);
     334    if (eventType == wpe_input_touch_event_type_up)
     335        removeUpdatedTouchEvents();
     336    m_updatedTouchEvents.clear();
    91337}
    92338
    93339void EventSenderProxy::touchStart()
    94340{
     341    prepareAndDispatchTouchEvent(wpe_input_touch_event_type_down);
    95342}
    96343
    97344void EventSenderProxy::touchMove()
    98345{
     346    prepareAndDispatchTouchEvent(wpe_input_touch_event_type_motion);
    99347}
    100348
    101349void EventSenderProxy::touchEnd()
    102350{
     351    prepareAndDispatchTouchEvent(wpe_input_touch_event_type_up);
    103352}
    104353
    105354void EventSenderProxy::touchCancel()
    106355{
     356    notImplemented();
    107357}
    108358
    109359void EventSenderProxy::clearTouchPoints()
    110360{
    111 }
    112 
    113 void EventSenderProxy::releaseTouchPoint(int)
    114 {
     361    m_touchEvents.clear();
     362    m_updatedTouchEvents.clear();
     363}
     364
     365void EventSenderProxy::releaseTouchPoint(int index)
     366{
     367    ASSERT(index >= 0 && index <= m_touchEvents.size());
     368
     369    auto& rawEvent = m_touchEvents[index];
     370    rawEvent.time = m_time;
     371    rawEvent.type = wpe_input_touch_event_type_up;
     372    m_updatedTouchEvents.add(index);
    115373}
    116374
    117375void EventSenderProxy::cancelTouchPoint(int)
    118376{
     377    notImplemented();
    119378}
    120379
Note: See TracChangeset for help on using the changeset viewer.