5 ms·
From the spec: "The user agent must dispatch a pointercancel (and subsequently a pointerout event) whenever all of the following are true, in order to end the s
by jaffathecake 13y ago
From the spec: "The user agent must dispatch a pointercancel (and subsequently a pointerout event) whenever all of the following are true, in order to end the stream of events for the pointer:
The user agent has determined (via methods out of scope for this specification) that touch input is to be consumed for a touch behavior,"
Touch behaviours are things like scrolling, double-tap to zoom, pinch zoom.
The browser's double-tap to zoom gesture is at a lower level than the click event in the browser. As in, a double-tab will be consumed by the browser and never hit the page.
- masklinn 13y agoThat precludes removing the delay, since that very delay is necessary to know whether it's a double tap.
- jaffathecake 13y agoDouble-tap precludes the click event. But touch/pointer events can preclude the double-tap.
- masklinn 13y ago> But touch/pointer events can preclude the double-tap. Your previous comment seems to imply otherwise: if the UA must dispatch pointercancel rather than pointerup on a double-tap, it has to wait until it can determine whether a double tap happened.
- jaffathecake 13y agoOmitting mouse & touch events, a tap goes: pointerdown, pointerup, click. A double tap goes: pointerdown, pointercancel. If the pointerdown event does event.preventDefault, it goes pointerdown, pointerdown. The double-tap prevents the click. Preventing default in the pointerdown prevents the double-tap and also the click.
- Anderkent 13y agoBut that still means that the browser has to determine if it's a single tap or double tap before sending the pointerup, so it'll arrive after the 300ms delay.
- jaffathecake 13y agoNo, it doesn't. The double tap gesture comes after pointer events. Pointer events can prevent double tap. Whereas click comes after the opportunity for double-tap, and double-tap will prevent click. Try it in IE, or another browser using touch events.
- masklinn 13y ago> The double tap gesture comes after pointer events. You make no sense, by your own description the double tap gesture changes what pointer events fire, pointerup can not fire until the UA knows for certain it's not going to be a doubletap, same as click.
- jaffathecake 13y agoIf you don't trust me on this, that's fine. Test it for yourself. Double tap does not change pointer events (https://dvcs.w3.org/hg/pointerevents/raw-file/tip/pointerEvents.html https://dvcs.w3.org/hg/pointerevents/raw-file/tip/pointerEve...), they come first. But 'click' is not a pointer event, it's the result of some pointer events, and the lack of the browser doing something else, such as scrolling, double tap etc. But seriously, don't take my word for it. Test it.
- jaffathecake 13y agohttp://jsbin.com/IjerotI/1/quiet http://jsbin.com/IjerotI/1/quiet - here's a test for you. Try tapping, then double tapping on that page. See the difference in events. This is touch events rather than pointer events, but the behaviour is similar. You can modify the test if you don't believe me.
- deleted 13y ago[deleted]