w3c / touch-events

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

explicitly define what happens with Touch Events during scrolling, pinch-zoom, etc? #60

Open patrickhlauke opened 8 years ago

patrickhlauke commented 8 years ago

Perhaps just as an informative (non-normative) box-out, but: unless I'm missing it, the spec currently does not explicitly say whether or not touchmove is supposed to keep firing during scrolling, and whether or not touchend (and the compatibility mouse events + click) should fire once scrolling finishes.

This has historically been a grey area - for instance, Chrome used to fire touchcancel as soon as a scroll started (https://www.youtube.com/watch?v=h2djIdAFc5U#t=518), and there used to be further inconsistencies across browsers/OSs https://www.youtube.com/playlist?list=PLbPjl9UGMTycW_pCqnxCTHCy2MLl6HwDO

Most (?) browsers now seem to have settled on firing touchmove during scroll, and then touchend (but no mouse / click events) once scrolling finishes. Worth documenting this de-facto behavior? Even if prefaced with some wording that still leaves this up to individual implementations? Softened with a MAY or SHOULD ?

patrickhlauke commented 8 years ago

There is an "in passing" reference under "5.6 Cancelability of touch events"

For maximum scroll performance, a user agent may not wait for each touch event associated with the scroll to be processed to see if it will be canceled

but wondering if it could do with more direct explanation.

patrickhlauke commented 8 years ago

actually, not just scrolling...pinch-to-zoom, any other gestures

patrickhlauke commented 8 years ago

any comments/thoughts on this? @rbyers ? others?

RByers commented 8 years ago

Edge still sends touchcancel on scroll last I checked, but I think they said they planned to change that. @teddink? If Edge is OK with it, I'd be happy to see the spec describe this (though details like throttling likely differ).

Separately I'd be happy to see something describe that compatibility mouse events / click are sent only on a tap gesture. But MS lawyer-cats may have concerns over the wording :-).

patrickhlauke commented 8 years ago

Separately I'd be happy to see something describe that compatibility mouse events / click are sent only on a tap gesture

split this out into #63

patrickhlauke commented 8 years ago

Edge still sends touchcancel on scroll last I checked, but I think they said they planned to change that. @teddink? If Edge is OK with it, I'd be happy to see the spec describe this (though details like throttling likely differ).

haven't got my Lumia with Win 10 Mobile with me, but last time I checked, Edge behaved the same as Chrome etc - see http://patrickhlauke.github.io/getting-touchy-presentation/#365

patrickhlauke commented 8 years ago

haven't got my Lumia with Win 10 Mobile with me

...but testing this on my Surface 3, explicitly enabling Touch Events in about:flags, confirms for me that Edge/Win10 behaves as it should: although on the pointer events side it fires pointercancel as soon as a scroll or zoom starts, it does keep firing touchmove, and touchend once the finger/s is/are lifted (using https://patrickhlauke.github.io/touch/gesture-touch/ to test)

RByers commented 8 years ago

Great! I remember Jacob saying they planned to change this, glad to hear they now match. We just realized our only Windows Phone doesn't support Edge (Win 8.1), so are waiting for a new one to arrive :-)

patrickhlauke commented 7 years ago

Clearly dropped the ball here. Will draft up some wording (general gist of "touch events keep firing even if the browser pans/zooms" or similar) soon