Implement capture for Pointer Events on iOS
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Jan 2019 03:15:02 +0000 (03:15 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Jan 2019 03:15:02 +0000 (03:15 +0000)
commitc1a453124f515235de539f96ae64003ab3ea31f4
tree9ed5901144783f3790a741caa3131ceb1af9d1cf
parent23a7fae13961557f2e209cd28447a7f58ae2f0b8
Implement capture for Pointer Events on iOS
https://bugs.webkit.org/show_bug.cgi?id=193917
<rdar://problem/47605689>

Reviewed by Dean Jackson.

Source/WebCore:

We add a new PointerCaptureController object which gets notified upon dispatch of pointer events
to implement implicit pointer capture, dispatch the gotpointercapture and lostpointercaptiure events,
and implement the Element APIs for pointer capture: hasPointerCapture(), setPointerCapture() and
releasePointerCapture().

Tests: pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html
       pointerevents/ios/pointer-events-implicit-capture-release-exception.html
       pointerevents/ios/pointer-events-implicit-capture-release.html
       pointerevents/ios/pointer-events-implicit-capture.html
       pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.cpp:
(WebCore::Element::setPointerCapture):
(WebCore::Element::releasePointerCapture):
(WebCore::Element::hasPointerCapture):
* dom/Element.h:
* dom/Element.idl:
* dom/EventNames.h:
* dom/PointerEvent.h:
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::pointerCaptureController const):
* page/PointerCaptureController.cpp: Added.
(WebCore::PointerCaptureController::PointerCaptureController):
(WebCore::PointerCaptureController::setPointerCapture):
(WebCore::PointerCaptureController::releasePointerCapture):
(WebCore::PointerCaptureController::hasPointerCapture):
(WebCore::PointerCaptureController::pointerLockWasApplied):
(WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
(WebCore::PointerCaptureController::pointerEventWillBeDispatched):
(WebCore::PointerCaptureController::pointerEventWasDispatched):
(WebCore::PointerCaptureController::processPendingPointerCapture):
* page/PointerCaptureController.h: Added.
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerLock):
* page/PointerLockController.h:

LayoutTests:

New tests for implicit pointer capture and the Element APIs related to pointer capture.

* pointerevents/ios/pointer-events-implicit-capture-expected.txt: Added.
* pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down-expected.txt: Added.
* pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html: Added.
* pointerevents/ios/pointer-events-implicit-capture-release-exception-expected.txt: Added.
* pointerevents/ios/pointer-events-implicit-capture-release-exception.html: Added.
* pointerevents/ios/pointer-events-implicit-capture-release-expected.txt: Added.
* pointerevents/ios/pointer-events-implicit-capture-release.html: Added.
* pointerevents/ios/pointer-events-implicit-capture.html: Added.
* pointerevents/ios/pointer-events-set-pointer-capture-exceptions-expected.txt: Added.
* pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240634 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
LayoutTests/ChangeLog
LayoutTests/pointerevents/ios/pointer-events-implicit-capture-expected.txt [new file with mode: 0644]
LayoutTests/pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down-expected.txt [new file with mode: 0644]
LayoutTests/pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html [new file with mode: 0644]
LayoutTests/pointerevents/ios/pointer-events-implicit-capture-release-exception-expected.txt [new file with mode: 0644]
LayoutTests/pointerevents/ios/pointer-events-implicit-capture-release-exception.html [new file with mode: 0644]
LayoutTests/pointerevents/ios/pointer-events-implicit-capture-release-expected.txt [new file with mode: 0644]
LayoutTests/pointerevents/ios/pointer-events-implicit-capture-release.html [new file with mode: 0644]
LayoutTests/pointerevents/ios/pointer-events-implicit-capture.html [new file with mode: 0644]
LayoutTests/pointerevents/ios/pointer-events-set-pointer-capture-exceptions-expected.txt [new file with mode: 0644]
LayoutTests/pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Element.idl
Source/WebCore/dom/EventNames.h
Source/WebCore/dom/PointerEvent.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/PointerCaptureController.cpp [new file with mode: 0644]
Source/WebCore/page/PointerCaptureController.h [new file with mode: 0644]
Source/WebCore/page/PointerLockController.cpp
Source/WebCore/page/PointerLockController.h