Pointer lock events should be delivered directly to the target element
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2017 23:47:53 +0000 (23:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2017 23:47:53 +0000 (23:47 +0000)
commitbfa8c200ebf2ebc4c6f6efa70093330700f3d08e
treeb209b5f597936483ac3e173711f6f58906fe0555
parent24bd59b495c210d45f34e16e13fdf06f1b47fd3a
Pointer lock events should be delivered directly to the target element
https://bugs.webkit.org/show_bug.cgi?id=167134

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-01-26
Reviewed by Jon Lee.

Source/WebCore:

pointer-lock/mouse-event-delivery.html: Enabled for mac, added wheel event tests.

When pointer is locked on an element, route mouse events directly to the target element, instead of
doing the normal event disptach.

* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDoubleClickEvent):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::handleMouseForceEvent):
(WebCore::EventHandler::handleWheelEvent):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::isLocked): Added.
(WebCore::PointerLockController::dispatchLockedWheelEvent): Added.
* page/PointerLockController.h:

LayoutTests:

The pointer-lock/mouse-event-delivery.html test is modified to explicitly move the mouse pointer to a valid
location before sending mouse actions. Without this, the test infrastructure doesn't know that the pointer
is over the web view and doesn't deliver events.

Added code to test for wheel events.

* platform/mac/TestExpectations: enabled test.
* pointer-lock/mouse-event-delivery.html:
* pointer-lock/mouse-event-delivery-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211235 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac/TestExpectations
LayoutTests/pointer-lock/mouse-event-delivery-expected.txt
LayoutTests/pointer-lock/mouse-event-delivery.html
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/PointerLockController.cpp
Source/WebCore/page/PointerLockController.h