w3c / touch-events

https://w3c.github.io/touch-events/
26 stars 24 forks source link

Should spec mention “touch adjustment" behavior? #93

Closed EiraGe closed 6 years ago

EiraGe commented 6 years ago

Currently Edge, Chrome and Safari have "touch adjustment" feature to select hit targets for touch.

Edge's implementation seems adjusting the touchstart coordinates and target to a nearby target. If the touch events is interpreted as a tap gesture, the mouse events will be implicit capture to the same target. Chrome (and Safari) only do adjustment when interprets a sequence of touch events as a tap gesture. And only coordinates and targets of mouse events will be changed. Which causing developer feel confuse that the target are different. (such as crbug.com/399761). We are planning to change that. However, modified coordinates for touch might not be a good idea since the original touch point will be totally concealed from developers. So our plan is adjusting the touch target only and keep original coordinates.

Should the touch event spec mention that UA might adjusting the touch targets. Maybe adding a note to let developer know? (And there is a similar issue to pointer event spec )

EiraGe commented 6 years ago

I propose adding a note to here:

"Some user agents may choose a target within the touching area instead of the element at touch point."

patrickhlauke commented 6 years ago

I'm wondering if this sort of feature isn't edging dangerously close to various IPR-related minefields (but IANAL)

jacobrossi commented 6 years ago

Yeah, touch targeting stuff was one of the things that was intentionally called out of scope in the Pointer Events WG charter for that reason.

It seems helpful to let devs be aware that browsers do this. So a non-normative note to this effect seems reasonable (note that you want to avoid normative terms like "MAY" to be safe here). There are other places in Pointer Events where we did such things.

How about this text:

Some implementations alter the target element to correct for the imprecision of coarse input. Therefore, the target element may not necessarily be the element directly at the coordinates of the event. The methods used to target/disambiguate coarse input are out of scope for this specification.

EiraGe commented 6 years ago

Thanks Jacob! I updated the text as your suggestion.