Skip to content

Commit

Permalink
Make fact that click/contextmenu are not compat mouse events normative (
Browse files Browse the repository at this point in the history
#418)

* Move the statement that click/contextmenu are NOT compat mouse events out of note and into normative part of the spec

* Make statement about canceling pointerdown to prevent compat mouse events more definitive

not just "certain" compat mouse events. also remove stray spaces.

x-ref #405

* Remove unnecessary mention of PREVENT MOUSE EVENT in default action table

* Tweak the compat mouse events clarification of click/contextmenu
  • Loading branch information
patrickhlauke committed Oct 20, 2021
1 parent 76e270a commit ef3ea93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -434,19 +434,19 @@ <h3>Attributes and default actions</h3>
<td>Yes</td>
<td>Yes</td>
<td>Varies: when the pointer is primary, all default actions of the <code>mousedown</code> event
<br>Canceling this event also sets the <code>PREVENT MOUSE EVENT</code> flag for this <code>pointerType</code>, which prevents subsequent firing of certain <a>compatibility mouse events</a>.</td>
<br>Canceling this event also prevents subsequent firing of <a>compatibility mouse events</a>.</td>
</tr>
<tr>
<td><code>pointermove</code></td>
<td>Yes</td>
<td>Yes</td>
<td>Varies: when the pointer is primary, all default actions of <code>mousemove</code></td>
<td>Varies: when the pointer is primary, all default actions of <code>mousemove</code></td>
</tr>
<tr>
<td><code>pointerup</code></td>
<td>Yes</td>
<td>Yes</td>
<td>Varies: when the pointer is primary, all default actions of <code>mouseup</code></td>
<td>Varies: when the pointer is primary, all default actions of <code>mouseup</code></td>
</tr>
<tr>
<td><code>pointercancel</code></td>
Expand Down Expand Up @@ -1142,8 +1142,8 @@ <h2><dfn>Populating and maintaining the coalesced and predicted events lists</df
<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 are an OPTIONAL feature of this specification. User agents are encouraged to support the feature for best compatibility with existing legacy content. User agents that do not support compatibility mouse events are still encouraged to support the <code>click</code> and <code>contextmenu</code> events (see the note below).</p>
<p>The <code>click</code> and <code>contextmenu</code> events, defined in [[UIEVENTS]], are not considered <a>compatibility mouse events</a> as they are typically tied to user interface activation, and are fired from other (non-pointer) input devices, such as keyboards.</p>
<div class="note">
<p>The <code>click</code> event, defined in [[UIEVENTS]], and the <code>contextmenu</code> event are not considered <a>compatibility mouse events</a> as they are typically tied to user interface activation and are fired from other input devices, like keyboards.</p>
<p>In user agents that support firing <code>click</code> and/or <code>contextmenu</code>, calling <code>preventDefault</code> during a pointer event typically does not have an effect on whether <code>click</code> and/or <code>contextmenu</code> are fired or not. Because they are not compatibility mouse events, user agents typically fire <code>click</code> and <code>contextmenu</code> for all pointing devices, including pointers that are not primary pointers.</p>
<p>The relative ordering of these high-level events (<code>click</code>, <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 <code>pointerup</code>, in others it'll often precede a <code>pointerup</code> or <code>pointercancel</code>, and in some situations it may be fired without any corresponding pointer event (such as a keyboard shortcut).</p>
<p>In addition, user agents may apply their own heuristics to determine whether or not a <code>click</code> or <code>contextmenu</code> event should be fired. Some user agents may only fire these events for a primary pointer, and even then they may choose not to fire these events if there are other (non-primary) pointers of the same type, or other primary pointers of a different type. User agents may determine that a particular action was not a "clean" tap, click or long-press — for instance, if an interaction with a finger on a touch screen includes too much movement while the finger is in contact with the screen — and decide not to fire a <code>click</code> or <code>contextmenu</code> event. These aspects of user agent behavior are not defined in this specification, and they may differ between implementations.</p>
Expand Down

0 comments on commit ef3ea93

Please sign in to comment.