PointerEvents should not require touch event listeners to be registered
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2018 09:09:34 +0000 (09:09 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2018 09:09:34 +0000 (09:09 +0000)
commit8f17ae974705f976caf81466738fb44473087854
treef285797ec0bb01f64b354e44f74c67dd9c29336e
parentef417caa02d1f3991a70e5e3bbb4844dab6ce8b6
PointerEvents should not require touch event listeners to be registered
https://bugs.webkit.org/show_bug.cgi?id=191333
<rdar://problem/45857523>

Reviewed by Dean Jackson.

Source/WebCore:

Tests: pointerevents/ios/pointer-events-dispatch-on-touch.html
       pointerevents/ios/pointer-events-prevent-default.html

* dom/EventNames.h:
(WebCore::EventNames::isTouchEventType const):
(WebCore::EventNames::touchAndPointerEventNames const):
(WebCore::EventNames::touchEventNames const): Deleted.
* dom/Node.cpp:
(WebCore::Node::moveNodeToNewDocument):

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateTouchEventTracking):
(WebKit::WebPageProxy::touchEventTrackingType const):
(WebKit::WebPageProxy::handleTouchEventSynchronously):
(WebKit::WebPageProxy::handleTouchEventAsynchronously):
(WebKit::WebPageProxy::handleTouchEvent):
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:

LayoutTests:

Add two iOS tests that check that we dispatch pointer events when only those events are registered
and that we correctly account for calls to preventDefault(). To support pointer events test, we add
a new utility where we will be adding user interaction functions that should allow these tests to be
submitted to the WPT repository provided browsers implement their own versions of the UIController.

* TestExpectations:
* pointerevents/ios/pointer-events-dispatch-on-touch-expected.txt: Added.
* pointerevents/ios/pointer-events-dispatch-on-touch.html: Added.
* pointerevents/ios/pointer-events-prevent-default-expected.txt: Added.
* pointerevents/ios/pointer-events-prevent-default.html: Added.
* pointerevents/utils.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/pointerevents/ios/pointer-events-dispatch-on-touch-expected.txt [new file with mode: 0644]
LayoutTests/pointerevents/ios/pointer-events-dispatch-on-touch.html [new file with mode: 0644]
LayoutTests/pointerevents/ios/pointer-events-prevent-default-expected.txt [new file with mode: 0644]
LayoutTests/pointerevents/ios/pointer-events-prevent-default.html [new file with mode: 0644]
LayoutTests/pointerevents/utils.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/EventNames.h
Source/WebCore/dom/Node.cpp
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h