Skip to content

Commit

Permalink
Add note about "interleaved" mouse compat events and reality of gestu…
Browse files Browse the repository at this point in the history
…re recognition

Related to the discussion started in #454
  • Loading branch information
patrickhlauke committed Oct 24, 2022
1 parent 1074161 commit 4be0fa5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,11 @@ <h2>Populating and maintaining the coalesced and predicted events lists</h2>
<h1><dfn data-lt="compatibility mouse events">Compatibility mapping with mouse events</dfn></h1>
<p>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.</p>
<p>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.</p>
<p>The sequence of compatibility mouse events aims to consistently represent the movement of a single legacy mouse pointer, even when multiple pointers and pointer types are active at the same time</p>
<div class="note">
<p>At a high level, compatibility mouse events are intended to be "interleaved" with their respective pointer events. However, this specific order is not mandatory, and user agents that implement compatibility mouse events MAY decide to delay or group the dispatch of mouse events, as long as their relative order is consistent.</p>
<p>Particularly in the case of touchscreen inputs, user agents MAY apply additional heuristics for gesture recognition (unless explicitly suppressed by authors through <a><code>touch-action</code></a>). 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.</p>
</div>
<p>Regardless of their support for compatibility mouse events, the user agents MUST always support the <code>click</code>, <code>auxclick</code> and <code>contextmenu</code> events because these events are of type <code>PointerEvent</code> and are therefore not <a>compatibility mouse events</a>. Calling <code>preventDefault</code> during a pointer event MUST NOT have an effect on whether <code>click</code>, <code>auxclick</code>, or <code>contextmenu</code> are fired or not.</p>
<div class="note">
<p>The relative order of some of these high-level events (<code>contextmenu</code>, <code>focus</code>, <code>blur</code>, etc.) with pointer events is undefined and varies between user agents. For example, in some user agents <code>contextmenu</code> 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).</p>
Expand Down

0 comments on commit 4be0fa5

Please sign in to comment.