w3c / touch-events

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

Clarify cancelability during scroll #79

Closed RByers closed 2 years ago

RByers commented 7 years ago

Fixes #76

RByers commented 7 years ago

@patrickhlauke @staktrace @patrickkettner WDYT? As I understand it this is close to what Gecko and Edge do, except that you may not fire the touch events at ALL during the scroll, right? Safari fires uncancelable ones during a scroll, and an uncancelable touchstart on fling but still a cancelable touchmove.

See some more discussion here

staktrace commented 7 years ago

Yeah, in Gecko we don't fire the touch events at all. But putting this in the spec seems like a good clarification.

I think the "may not" wording could be improved though - usually "may not" means that it shouldn't happen (e.g. "you may not go the washroom") but in this case what you're trying to say is that the browser might "not suspend the motion of an element". I suggest rewording to either: ... User Agents may continue the motion ... ... User Agents might not suspend the motion ... (or something else).

patrickhlauke commented 7 years ago

Agree with @staktrace that "may not" has a different connotation to what we're trying to say (even at the start of the sentence, which is not modified by this PR). it's difficult to come up with an unambiguous and short way to say "the UA may choose not to do X", so for clarity I'd suggest turning those statements around into the opposite, to say what the UA may actively do (rather than what the UA may choose not to do), if that makes sense...

patrickhlauke commented 7 years ago

Possibly something like

However, for maximum scroll performance, a user agent may decide to process touch events associated with the scroll, without waiting to see if it will be canceled. In particular, user agents may continue the motion of an element which is currently moving due to a touch scroll, either as a result of an earlier event in the touch sequence, or due to momentum left over from a previous touch sequence, rather than suspending the motion.

patrickhlauke commented 7 years ago

Wondering if the second sentence can be condensed a bit - unless I'm misunderstanding the overall meaning, I'm not quite clear why we're now talking about motion of elements, when (i think) what we want to say in short is:

In particular, regardless of any canceled touch events, a user agents may continue an ongoing scroll motion – caused by an earlier event in the touch sequence, or by momentum left over from a previous touch sequence (e.g. a "fling" gesture) – rather than halting the scrolling.

patrickhlauke commented 6 years ago

@RByers is this still relevant/needed?

patrickhlauke commented 2 years ago

@RByers ping?

RByers commented 2 years ago

Oh, sorry that I apparently just dropped this. It's still relevant in that AFAIK it describes behaviour in multiple browsers. But it's not necessarily "needed", just a small clarification. If you think it ads value to describe this case explicitly then I'm fine landing the text your proposed. Otherwise I'm fine just leaving it all as is.

patrickhlauke commented 2 years ago

@RByers @staktrace coming back very late, but: could you cast your eye one last time over this PR which now uses the rewording I proposed above? If all good, I'll merge.

RByers commented 2 years ago

Thanks @patrickhlauke! LGTM