Bug 201770 - PointerEvent.buttons incorrect on touch move
Summary: PointerEvent.buttons incorrect on touch move
Status: RESOLVED DUPLICATE of bug 199910
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: Safari Technology Preview
Hardware: iPhone / iPad Other
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-09-13 13:49 PDT by ian
Modified: 2019-09-17 07:01 PDT (History)
3 users (show)

See Also:


Attachments
Small example reproducing the issue (498 bytes, text/html)
2019-09-13 13:49 PDT, ian
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description ian 2019-09-13 13:49:34 PDT
Created attachment 378752 [details]
Small example reproducing the issue

In the iOS13 iPhone simulator at least, the value of the 'buttons' property of a pointermove event generated by a moving touch is 0, but according to the W3C spec it should be 1. It appears to be 1 in Chrome (android simulator and on desktop in touch simulation mode). 

Example attached. 

This discrepancy leads to a project bug in the simulator that matches a bug on an iPad running 13.1. (I'll confirm its the same issue once I get a chance to plug the device in.)
Comment 1 ian 2019-09-13 14:37:17 PDT
In iPad OS 13.1 on a 2018 iPad pointermove.buttons also reads as 0 when caused by a touch. 

Also in the iOS13 iPhone simulator, pointermove events are dispatched continuously even if the mouse isn't moving. This is not the case in 13.1 on the iPad.
Comment 2 Radar WebKit Bug Importer 2019-09-16 03:49:59 PDT
<rdar://problem/55394548>
Comment 3 Antoine Quint 2019-09-16 06:40:55 PDT
This *should* work but clearly doesn't.

static unsigned short buttonsForType(const AtomString& type)
{
    // We have contact with the touch surface for most events except when we've released the touch or canceled it.
    return (type == eventNames().pointerupEvent || type == eventNames().pointeroutEvent || type == eventNames().pointerleaveEvent || type == eventNames().pointercancelEvent) ? 0 : 1;
}

This should return 1 for pointermove.
Comment 4 Antoine Quint 2019-09-17 07:01:37 PDT
This actually works on ToT, this is a dupe of https://bugs.webkit.org/show_bug.cgi?id=199910. However, this landed too late to make it into iOS 13. It will be picked up for an upcoming software update, but I can't comment as to when.

*** This bug has been marked as a duplicate of bug 199910 ***