From ca3290ca07a7273d590d08c84e3b7f99b751ecbe Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Mon, 24 Oct 2022 23:14:42 +0100 Subject: [PATCH] Add note about "interleaved" mouse compat events and reality of gesture recognition Related to the discussion started in #454 --- index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.html b/index.html index 62a21af..b5a22ad 100644 --- a/index.html +++ b/index.html @@ -1182,6 +1182,9 @@

Populating and maintaining the coalesced and predicted events lists

Compatibility mapping with mouse events

The vast majority of web content existing today codes only to Mouse Events. The following describes an algorithm for how the user agent MAY map generic pointer input to mouse events for compatibility with this content.

The compatibility mapping with mouse events is an OPTIONAL feature of this specification. User agents are encouraged to support the feature for best compatibility with existing legacy content.

+
+

At a high level, compatibility mouse events are intended to be "interleaved" with their respective pointer events. However, particularly in the case of touchscreen inputs, user agents MAY apply heuristics for gesture recognition (unless explicitly suppressed by authors through touch-action). This may result in compatibility mouse events only being dispatched after {{GlobalEventHandlers/pointerup}}, if the user agent determined that an interaction was not intended as a particular gesture. These specifics of user agent gesture recognition are not defined in this specification, and they may differ between implementations.

+

Regardless of their support for compatibility mouse events, the user agents MUST always support the click, auxclick and contextmenu events because these events are of type PointerEvent and are therefore not compatibility mouse events. Calling preventDefault during a pointer event MUST NOT have an effect on whether click, auxclick, or contextmenu are fired or not.

The relative order of some of these high-level events (contextmenu, focus, blur, etc.) with pointer events is undefined and varies between user agents. For example, in some user agents contextmenu will often follow a {{GlobalEventHandlers/pointerup}}, while in others it'll often precede a {{GlobalEventHandlers/pointerup}} or {{GlobalEventHandlers/pointercancel}}, and in some situations it may be fired without any corresponding pointer event (for instance, as a result of a keyboard interaction).