Skip to content

Commit

Permalink
Merge pull request #345 from w3c/patrickhlauke-reserved-pointerId
Browse files Browse the repository at this point in the history
Change reserved pointerId for non-pointer events from 0 to -1
  • Loading branch information
patrickhlauke committed Jan 12, 2021
2 parents 83ca9a9 + aac0a52 commit e6d8a05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.html
Expand Up @@ -315,7 +315,7 @@ <h2><code>PointerEvent</code> Interface</h2>
<dl data-dfn-for="PointerEvent" data-link-for="PointerEvent">
<dt><dfn>pointerId</dfn></dt>
<dd>
<p>A unique identifier for the pointer causing the event. This identifier MUST be unique from all other <a data-lt="active pointer">active pointers</a> in the <a>top-level browsing context</a> (as defined by [[HTML]]) at the time. The <code>pointerId</code> value of zero is reserved to indicate events that were generated by something other than a pointing device. A user agent MAY recycle previously retired values for <code>pointerId</code> from previous active pointers, if necessary.</p>
<p>A unique identifier for the pointer causing the event. This identifier MUST be unique from all other <a data-lt="active pointer">active pointers</a> in the <a>top-level browsing context</a> (as defined by [[HTML]]) at the time. The <code>pointerId</code> value of <code>-1</code> is reserved to indicate events that were generated by something other than a pointing device. A user agent MAY recycle previously retired values for <code>pointerId</code> from previous active pointers, if necessary.</p>

<div class="note">
<p>The <code>pointerId</code> selection algorithm is implementation specific. Therefore authors cannot assume values convey any particular meaning other than an identifier for the pointer that is unique from all other active pointers. As an example, user agents may simply assign a number, starting from <code>1</code>, to any active pointers, in the order that they become active - but these values are not guaranteed to be monotonically increasing. Other user agents may opt to assign a completely randomized and unique number to each active pointer. However, in the latter scenarios user agents MUST ensure that the <code>pointerId</code> that is assigned remains the same only for the lifetime of the current page, and that any new <code>pointerId</code> values are not predictable (e.g. generated randomly with cryptographically strong randomness), to minimize the possibility of users being uniquely fingerprinted and tracked across different pages.</p>
Expand Down Expand Up @@ -823,7 +823,7 @@ <h3>The <dfn><code>click</code>, <code>auxclick</code>, and <code>contextmenu</c
The type of these events MUST be <code>PointerEvent</code> but the dispatch process is going to match that of the original specification.
For these events, all <code>PointerEvent</code> specific attributes (defined in this spec) other than <code>pointerId</code> and <code>pointerType</code> will have their default values.
The <code>pointerId</code> and <code>pointertType</code> of these events MUST be the same as the PointerEvents that caused these events if they are generated by a pointing device.
If the events are generated by a non-pointing device (such as voice recognition software or a keyboard interaction), <code>pointerId</code> MUST be 0 and <code>pointerType</code> MUST be an empty string.</p>
If the events are generated by a non-pointing device (such as voice recognition software or a keyboard interaction), <code>pointerId</code> MUST be <code>-1</code> and <code>pointerType</code> MUST be an empty string.</p>
</section>
</section>
</section>
Expand Down

0 comments on commit e6d8a05

Please sign in to comment.