Produce "pen" Pointer Events if using a stylus (e.g. Apple Pencil)
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Jan 2019 02:03:45 +0000 (02:03 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Jan 2019 02:03:45 +0000 (02:03 +0000)
commitdc1c925de9c1735a273bb0859c83aaf7d610ec5e
treee53fd9ed79a4495d7bc6e035809f218eb582d637
parent8141c417da2ed2aa76ba83fa769fcf6f834d2ebc
Produce "pen" Pointer Events if using a stylus (e.g. Apple Pencil)
https://bugs.webkit.org/show_bug.cgi?id=193945
<rdar://problem/47618922>

Reviewed by Antoine Quint.

Source/WebCore:

Calculate the pressure, tiltX and tiltY values for incoming
Pointer Events, which have values when the PlatformTouchEvent
originated from a stylus.

Test: pointerevents/ios/pointer-events-dispatch-on-stylus.html

* dom/PointerEvent.h: Default to "mouse".
* dom/ios/PointerEventIOS.cpp: Calculate the values.

LayoutTests:

Test for stylus -> "pen" Pointer Events.

* pointerevents/ios/pointer-events-dispatch-on-stylus-expected.txt: Added.
* pointerevents/ios/pointer-events-dispatch-on-stylus.html: Added.
* pointerevents/ios/pointer-events-dispatch-on-touch.html: Test for "touch" type.
* pointerevents/utils.js: Add a new helper for stylus event generation.
(prototype.assertMatchesEvents):
(const.ui.new.UIController.prototype.beginStylus):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/pointerevents/ios/pointer-events-dispatch-on-stylus-expected.txt [new file with mode: 0644]
LayoutTests/pointerevents/ios/pointer-events-dispatch-on-stylus.html [new file with mode: 0644]
LayoutTests/pointerevents/ios/pointer-events-dispatch-on-touch.html
LayoutTests/pointerevents/utils.js
Source/WebCore/ChangeLog
Source/WebCore/dom/PointerEvent.h
Source/WebCore/dom/ios/PointerEventIOS.cpp