From 53aa55eecaf1863d3d155beeaaac8e06e894b740 Mon Sep 17 00:00:00 2001
From: Sahir Vellani Indicates if the pointer represents the primary pointer of this pointer type. A unique identifier for the device that generates the pointer event. Pointer events generated from the same physical device will have the same A method that returns the list of coalesced events. A unique identifier for the device that generates the pointer event. Pointer events generated from the same physical device will have the same A unique identifier for the device that generates the pointer event. Pointer events generated from the same physical device will have the same Indicates if the pointer represents the primary pointer of this pointer type. A unique identifier for the device that generates the pointer event. Pointer events generated from the same physical device will have the same A set of properties that represent event generating device-specific information such as unique id. A unique identifier for the device that generates the pointer event. Pointer events generated from the same physical device will have the same Pointer Events include two complementary sets of attributes to express the orientation of a transducer relative to the X-Y plane: Depending on the specific hardware and platform, user agents will likely only receive one set of values for the transducer orientation relative to the screen plane — either When the user agent calculates
double azimuthAngle;
DOMString pointerType = "";
boolean isPrimary = false;
+ long deviceId = -1;
sequence<PointerEvent> coalescedEvents = [];
sequence<PointerEvent> predictedEvents = [];
};
@@ -233,6 +234,7 @@ PointerEvent
interface
readonly attribute double azimuthAngle;
readonly attribute DOMString pointerType;
readonly attribute boolean isPrimary;
+ readonly attribute long deviceId;
[SecureContext] sequence<PointerEvent> getCoalescedEvents();
sequence<PointerEvent> getPredictedEvents();
};
@@ -325,6 +327,10 @@ PointerEvent
interfacePointerEvent
interfacedeviceId
for the browsing session. User agents MAY reserve a generic deviceId
value of 0
or 1
for events generated by the primary mouse device. The deviceId
value of -1
MUST be reserved and used to indicate events whose generating device could not be identified.PointerEvent
interfacedeviceId
for the browsing session. User agents MAY reserve a generic deviceId
value of 0
or 1
for events generated by the primary mouse device. The deviceId
value of -1
MUST be reserved and used to indicate events whose generating device could not be identified.deviceId
for the browsing session. A generic deviceId
value of 1
MUST be reserved for events generated by the primary mouse device. The deviceId
value of -1
MUST be reserved and used to indicate events whose generating device could not be identified.Examples
pointerEventInitDict.coalescedEvents = [p1, p2];
const event2 = new PointerEvent("pointermove", pointerEventInitDict);
eventTarget.dispatchEvent(event2);
+
+
+
@@ -214,9 +237,9 @@ <div style="position:absolute; top:0px; left:0px; width:100px;height:100px;"></div>
+ <script>
+ window.addEventListener("pointerdown", assignPenColor);
+ const colorMap = new Map();
+
+ function assignPenColor(event) {
+ const uniqueId = event.deviceProperties.uniqueId;
+ // Check if a color has been assigned to the device.
+ if (map.has(uniqueId)) {
+ return;
+ }
+ // Assign a color to the device.
+ let newColor = getNewColor();
+ map.set(uniqueId, newColor);
+ return newColor;
+ }
+
+ function getNewColor() {
+ /* return some color value */
+ }
+ </script>
double azimuthAngle;
DOMString pointerType = "";
boolean isPrimary = false;
- long deviceId = -1;
sequence<PointerEvent> coalescedEvents = [];
sequence<PointerEvent> predictedEvents = [];
+ DeviceProperties deviceProperties;
};
[Exposed=Window]
@@ -234,7 +257,7 @@ PointerEvent
interface
readonly attribute double azimuthAngle;
readonly attribute DOMString pointerType;
readonly attribute boolean isPrimary;
- readonly attribute long deviceId;
+ readonly attribute DeviceProperties deviceProperties;
[SecureContext] sequence<PointerEvent> getCoalescedEvents();
sequence<PointerEvent> getPredictedEvents();
};
@@ -327,9 +350,9 @@ PointerEvent
interfacePointerEvent
interfacedeviceId
for the browsing session. A generic deviceId
value of 1
MUST be reserved for events generated by the primary mouse device. The deviceId
value of -1
MUST be reserved and used to indicate events whose generating device could not be identified.Event dispatch
+
+ DeviceProperties
interface
+ [Exposed=PointerEvent]
+ interface DeviceProperties {
+ readonly attribute long uniqueId;
+ };
+
+
+
+ uniqueId
for the browsing session. A generic uniqueId
value of 1
MUST be reserved for events generated by the primary mouse device. The uniqueId
value of -1
MUST be reserved and used to indicate events whose generating device could not be identified.Converting between
tiltX
/ tiltY
and altitud
tiltX
/ tiltY
(introduced in the original Pointer Events specification), and azimuthAngle
/ altitudeAngle
(adopted from the Touch Events - Level 2 specification).tiltX
/ tiltY
or altitudeAngle
/ azimuthAngle
. User agents MUST use the following algorithm for converting these values.tiltX
/ tiltY
from azimuthAngle
/ altitudeAngle
it SHOULD round the final integer values using Math.round [[ECMASCRIPT]] rules./* Converting between tiltX/tiltY and altitudeAngle/azimuthAngle */
+
/* Converting between tiltX/tiltY and altitudeAngle/azimuthAngle */
function spherical2tilt(altitudeAngle, azimuthAngle) {
const radToDeg = 180/Math.PI;
@@ -1058,17 +1058,17 @@
Details of
touch-action
valu
auto
user agents typically add 300ms of delay before click
to allow for double-tap gestures to be handled. In these cases, explicitly setting touch-action: none
or touch-action: manipulation
will remove this delay. Note that the methods for determining a tap or double-tap gesture are out of scope for this specification.
+
-<div style="touch-action: none;">
This element receives pointer events for all direct manipulation interactions that otherwise lead to panning or zooming.
</div>
+
-<div style="touch-action: pan-x;">
This element receives pointer events when not panning in the horizontal direction.
</div>
+
-<div style="overflow: auto;">
<div style="touch-action: none;">
This element receives pointer events for all direct manipulation interactions that otherwise lead to panning or zooming.
@@ -1078,7 +1078,7 @@
Details of
touch-action
valu
</div>
</div>
+
-<div style="overflow: auto;">
<div style="touch-action: pan-y;">
<div style="touch-action: pan-x;">
@@ -1091,7 +1091,7 @@
Details of
touch-action
valu
</div>
</div>
+
<div style="overflow: auto;">
<div style="touch-action: pan-y pan-left;">
<div style="touch-action: pan-x;">
@@ -1222,7 +1222,7 @@
Coalesced events
+
<style>
/* Disable intrinsic user agent direct manipulation behaviors (such as panning or zooming)
so that all events on the canvas element are given to the application instead. */
@@ -1338,7 +1338,7 @@
Predicted events
pointer events are dispatched earlier than the timestamp of one or more of the predicted events.
+-+let predicted_points = []; window.addEventListener("pointermove", function(event) { From 06be8e07142d92e280bb64af42320ddffbd3bdd7 Mon Sep 17 00:00:00 2001 From: Sahir Vellani
Date: Tue, 5 Mar 2024 14:48:35 -0800 Subject: [PATCH 05/15] Add some more details to uniqueId decription --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index bf8dd68..c37ad25 100644 --- a/index.html +++ b/index.html @@ -863,7 +863,7 @@
DeviceProperties
interfaceFrom fe6a97d4752d592e14e84c5a77b02a4a60e1c0b3 Mon Sep 17 00:00:00 2001 From: Sahir Vellani
- uniqueId
- -
A unique identifier for the device that generates the pointer event. Pointer events generated from the same physical device will have the same
+uniqueId
for the browsing session. A genericuniqueId
value of1
MUST be reserved for events generated by the primary mouse device. TheuniqueId
value of-1
MUST be reserved and used to indicate events whose generating device could not be identified.A unique identifier for the pointing device. Pointer events generated from the same physical device will have the same
uniqueId
for the browsing session. A genericuniqueId
value of1
MUST be reserved for events generated by the primary mouse device. TheuniqueId
value of-1
MUST be reserved and used to indicate events whose generating device could not be identified.uniqueId
may be omitted/unset if hardware constraints prevent the UA from obtaining the device identifier. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, theuniqueId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomizeduniqueId
MUST be chosen the next time that particular pointing device is used again in a new session.Date: Wed, 6 Mar 2024 12:26:10 -0800 Subject: [PATCH 06/15] Add constructor --- index.html | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index c37ad25..304b7a1 100644 --- a/index.html +++ b/index.html @@ -714,6 +714,22 @@ Converting between
tiltX
/tiltY
andaltitud
+ +
DeviceProperties
interface+ [Exposed=PointerEvent] + interface DeviceProperties { + constructor(long uniqueId); + readonly attribute long uniqueId; + }; +++
+- uniqueId
+- +
+A unique identifier for the pointing device. Pointer events generated from the same physical device will have the same
+uniqueId
for the browsing session. A genericuniqueId
value of1
MUST be reserved for events generated by the primary mouse device. TheuniqueId
value of-1
MUST be reserved and used to indicate events whose generating device could not be identified.uniqueId
may be omitted/unset if hardware constraints prevent the UA from obtaining the device identifier. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, theuniqueId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomizeduniqueId
MUST be chosen the next time that particular pointing device is used again in a new session.- Pointer Event types
@@ -852,21 +868,6 @@Event dispatch
- -
DeviceProperties
interface- [Exposed=PointerEvent] - interface DeviceProperties { - readonly attribute long uniqueId; - }; ---
-- uniqueId
-- -
-A unique identifier for the pointing device. Pointer events generated from the same physical device will have the same
-uniqueId
for the browsing session. A genericuniqueId
value of1
MUST be reserved for events generated by the primary mouse device. TheuniqueId
value of-1
MUST be reserved and used to indicate events whose generating device could not be identified.uniqueId
may be omitted/unset if hardware constraints prevent the UA from obtaining the device identifier. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, theuniqueId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomizeduniqueId
MUST be chosen the next time that particular pointing device is used again in a new session.From dd4ea5ae379eea2f54a98828ce384a77cd7833f5 Mon Sep 17 00:00:00 2001 From: Sahir Vellani From 60bf3dc1e5f249437a7427b55f1af1a07248fb90 Mon Sep 17 00:00:00 2001 From: Sahir VellaniDate: Mon, 11 Mar 2024 10:26:24 -0700 Subject: [PATCH 07/15] Address feedback --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 304b7a1..d2440f3 100644 --- a/index.html +++ b/index.html @@ -717,7 +717,7 @@ Converting between
tiltX
/tiltY
andaltitud
From 453da9f62033fd030e6c2515b8544d157ef7f219 Mon Sep 17 00:00:00 2001 From: Sahir Vellani
DeviceProperties
interface- [Exposed=PointerEvent] + [Exposed=Window] interface DeviceProperties { constructor(long uniqueId); readonly attribute long uniqueId; @@ -726,7 +726,7 @@
DeviceProperties
interface
- uniqueId
- -
A unique identifier for the pointing device. Pointer events generated from the same physical device will have the same
+uniqueId
for the browsing session. A genericuniqueId
value of1
MUST be reserved for events generated by the primary mouse device. TheuniqueId
value of-1
MUST be reserved and used to indicate events whose generating device could not be identified.uniqueId
may be omitted/unset if hardware constraints prevent the UA from obtaining the device identifier. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, theuniqueId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomizeduniqueId
MUST be chosen the next time that particular pointing device is used again in a new session.A unique identifier for the pointing device. Pointer events generated from the same physical device will have the same
uniqueId
for the browsing session. A genericuniqueId
value of1
MUST be reserved for events generated by the primary mouse device. TheuniqueId
value of-1
MUST be reserved and used to indicate events whose generating device could not be identified. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, theuniqueId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomizeduniqueId
MUST be chosen the next time that particular pointing device is used again in a new session.Date: Thu, 21 Mar 2024 14:41:35 -0700 Subject: [PATCH 08/15] Address feedback, add init dict --- index.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index d2440f3..f4894e2 100644 --- a/index.html +++ b/index.html @@ -197,10 +197,15 @@ Examples
<div style="position:absolute; top:0px; left:0px; width:100px;height:100px;"></div> <script> window.addEventListener("pointerdown", assignPenColor); + window.addEventListener("pointerMove", assignPenColor); const colorMap = new Map(); function assignPenColor(event) { const uniqueId = event.deviceProperties.uniqueId; + // Check if a unique Id exists. + if (!uniqueId) { + return; + } // Check if a color has been assigned to the device. if (map.has(uniqueId)) { return; @@ -717,16 +722,20 @@
Converting between
tiltX
/tiltY
andaltitud
From b2d7e8371f15d55aab0dbe6f5d47616df15d9d19 Mon Sep 17 00:00:00 2001 From: Sahir Vellani
DeviceProperties
interface+ dictionary DevicePropertiesInit { + long uniqueId = 0; + }; + [Exposed=Window] interface DeviceProperties { - constructor(long uniqueId); + constructor(optional DevicePropertiesInit devicePropertiesInitDict = {}); readonly attribute long uniqueId; };
- uniqueId
- -
A unique identifier for the pointing device. Pointer events generated from the same physical device will have the same
+uniqueId
for the browsing session. A genericuniqueId
value of1
MUST be reserved for events generated by the primary mouse device. TheuniqueId
value of-1
MUST be reserved and used to indicate events whose generating device could not be identified. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, theuniqueId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomizeduniqueId
MUST be chosen the next time that particular pointing device is used again in a new session.A unique identifier for the pointing device. If the hardware supports multiple pointers, pointer events generated from pointing devices must only get a
uniqueId
if those pointers are uniquely identifiable over the session. If the pointer is uniquely identifiable, the assigneduniqueId
to that pointing device will remain constant for the remainder of the session.uniqueId
value of1
MUST be reserved for events generated by the primary mouse device. TheuniqueId
value of-1
MUST be reserved and used to indicate events whose generating device could not be identified. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, theuniqueId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomizeduniqueId
MUST be chosen the next time that particular pointing device is used again in a new session.Date: Tue, 26 Mar 2024 13:44:25 -0700 Subject: [PATCH 09/15] Fix example --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index f4894e2..422bb1d 100644 --- a/index.html +++ b/index.html @@ -197,13 +197,13 @@ Examples
<div style="position:absolute; top:0px; left:0px; width:100px;height:100px;"></div> <script> window.addEventListener("pointerdown", assignPenColor); - window.addEventListener("pointerMove", assignPenColor); + window.addEventListener("pointermove", assignPenColor); const colorMap = new Map(); function assignPenColor(event) { const uniqueId = event.deviceProperties.uniqueId; // Check if a unique Id exists. - if (!uniqueId) { + if (uniqueId == -1) { return; } // Check if a color has been assigned to the device. From eefea6e485c00317de130992cceb67f0e6814092 Mon Sep 17 00:00:00 2001 From: Sahir Vellani
Date: Tue, 26 Mar 2024 13:46:56 -0700 Subject: [PATCH 10/15] Fix default value in dict --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 422bb1d..17a39dc 100644 --- a/index.html +++ b/index.html @@ -723,7 +723,7 @@ Converting between
tiltX
/tiltY
andaltitud
DeviceProperties
interfacedictionary DevicePropertiesInit { - long uniqueId = 0; + long uniqueId = -1; }; [Exposed=Window] From 4d14be1096c92eab41a7d323906e11928d00c867 Mon Sep 17 00:00:00 2001 From: Sahir VellaniDate: Tue, 16 Apr 2024 15:57:37 -0700 Subject: [PATCH 11/15] Remove mouse clause, add missing uniqueId note --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index f4894e2..c791284 100644 --- a/index.html +++ b/index.html @@ -735,7 +735,8 @@
DeviceProperties
interface
- uniqueId
- -
A unique identifier for the pointing device. If the hardware supports multiple pointers, pointer events generated from pointing devices must only get a
+uniqueId
if those pointers are uniquely identifiable over the session. If the pointer is uniquely identifiable, the assigneduniqueId
to that pointing device will remain constant for the remainder of the session.uniqueId
value of1
MUST be reserved for events generated by the primary mouse device. TheuniqueId
value of-1
MUST be reserved and used to indicate events whose generating device could not be identified. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, theuniqueId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomizeduniqueId
MUST be chosen the next time that particular pointing device is used again in a new session.A unique identifier for the pointing device. If the hardware supports multiple pointers, pointer events generated from pointing devices must only get a
+uniqueId
if those pointers are uniquely identifiable over the session. If the pointer is uniquely identifiable, the assigneduniqueId
to that pointing device will remain constant for the remainder of the session. TheuniqueId
value of-1
MUST be reserved and used to indicate events whose generating device could not be identified. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, theuniqueId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomizeduniqueId
MUST be chosen the next time that particular pointing device is used again in a new session.Due to digitizer and pointing device hardware constraints, auniqueId
is not guaranteed to be available for all pointer events from a pointing device. For example, the device may not report its hardware id to the digitizer in time forpointerdown
to have auniqueId
. In such a case, theuniqueId
may initially be-1
and change to a valid value.Date: Thu, 18 Apr 2024 10:24:27 -0700 Subject: [PATCH 12/15] Change caps on must --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index fdf1ab0..fdaa88c 100644 --- a/index.html +++ b/index.html @@ -735,7 +735,7 @@
DeviceProperties
interfaceFrom 0282bae257357e6e9a003c8ebc27029a536f51ec Mon Sep 17 00:00:00 2001 From: Sahir Vellani
- uniqueId
- -
A unique identifier for the pointing device. If the hardware supports multiple pointers, pointer events generated from pointing devices must only get a
+uniqueId
if those pointers are uniquely identifiable over the session. If the pointer is uniquely identifiable, the assigneduniqueId
to that pointing device will remain constant for the remainder of the session. TheuniqueId
value of-1
MUST be reserved and used to indicate events whose generating device could not be identified. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, theuniqueId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomizeduniqueId
MUST be chosen the next time that particular pointing device is used again in a new session.A unique identifier for the pointing device. If the hardware supports multiple pointers, pointer events generated from pointing devices MUST only get a
uniqueId
if those pointers are uniquely identifiable over the session. If the pointer is uniquely identifiable, the assigneduniqueId
to that pointing device will remain constant for the remainder of the session. TheuniqueId
value of-1
MUST be reserved and used to indicate events whose generating device could not be identified. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, theuniqueId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomizeduniqueId
MUST be chosen the next time that particular pointing device is used again in a new session.Due to digitizer and pointing device hardware constraints, auniqueId
is not guaranteed to be available for all pointer events from a pointing device. For example, the device may not report its hardware id to the digitizer in time forpointerdown
to have auniqueId
. In such a case, theuniqueId
may initially be-1
and change to a valid value.Date: Thu, 18 Apr 2024 10:27:20 -0700 Subject: [PATCH 13/15] Change invalid id from -1 to 0 --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index fdaa88c..1db9bf0 100644 --- a/index.html +++ b/index.html @@ -203,7 +203,7 @@ Examples
function assignPenColor(event) { const uniqueId = event.deviceProperties.uniqueId; // Check if a unique Id exists. - if (uniqueId == -1) { + if (uniqueId == 0) { return; } // Check if a color has been assigned to the device. @@ -723,7 +723,7 @@Converting between
tiltX
/tiltY
andaltitud
DeviceProperties
interfacedictionary DevicePropertiesInit { - long uniqueId = -1; + long uniqueId = 0; }; [Exposed=Window] @@ -735,8 +735,8 @@
DeviceProperties
interfaceFrom b485c11c433600c73a20c57cc2080d1059c1dcce Mon Sep 17 00:00:00 2001 From: Sahir Vellani
- uniqueId
- -
A unique identifier for the pointing device. If the hardware supports multiple pointers, pointer events generated from pointing devices MUST only get a
-uniqueId
if those pointers are uniquely identifiable over the session. If the pointer is uniquely identifiable, the assigneduniqueId
to that pointing device will remain constant for the remainder of the session. TheuniqueId
value of-1
MUST be reserved and used to indicate events whose generating device could not be identified. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, theuniqueId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomizeduniqueId
MUST be chosen the next time that particular pointing device is used again in a new session.Due to digitizer and pointing device hardware constraints, a+uniqueId
is not guaranteed to be available for all pointer events from a pointing device. For example, the device may not report its hardware id to the digitizer in time forpointerdown
to have auniqueId
. In such a case, theuniqueId
may initially be-1
and change to a valid value.A unique identifier for the pointing device. If the hardware supports multiple pointers, pointer events generated from pointing devices MUST only get a
+uniqueId
if those pointers are uniquely identifiable over the session. If the pointer is uniquely identifiable, the assigneduniqueId
to that pointing device will remain constant for the remainder of the session. TheuniqueId
value of0
MUST be reserved and used to indicate events whose generating device could not be identified. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, theuniqueId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomizeduniqueId
MUST be chosen the next time that particular pointing device is used again in a new session.Due to digitizer and pointing device hardware constraints, auniqueId
is not guaranteed to be available for all pointer events from a pointing device. For example, the device may not report its hardware id to the digitizer in time forpointerdown
to have auniqueId
. In such a case, theuniqueId
may initially be0
and change to a valid value.Date: Wed, 8 May 2024 11:44:52 -0700 Subject: [PATCH 14/15] deviceProperties null in init --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 1db9bf0..9195e98 100644 --- a/index.html +++ b/index.html @@ -244,7 +244,7 @@ boolean isPrimary = false; sequence<PointerEvent> coalescedEvents = []; sequence<PointerEvent> predictedEvents = []; - DeviceProperties deviceProperties; + DeviceProperties? deviceProperties = null; }; [Exposed=Window] @@ -262,7 +262,7 @@
PointerEvent
interfacereadonly attribute double azimuthAngle; readonly attribute DOMString pointerType; readonly attribute boolean isPrimary; - readonly attribute DeviceProperties deviceProperties; + readonly attribute DeviceProperties? deviceProperties; [SecureContext] sequence<PointerEvent> getCoalescedEvents(); sequence<PointerEvent> getPredictedEvents(); }; From 8853ccfcb0ffa10120f2e66a6d0c05873285a841 Mon Sep 17 00:00:00 2001 From: Sahir Vellani
PointerEvent
interfaceDate: Mon, 10 Jun 2024 09:58:15 -0700 Subject: [PATCH 15/15] Switch to persistentDeviceId --- index.html | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/index.html b/index.html index 491dce7..4b084a2 100644 --- a/index.html +++ b/index.html @@ -201,7 +201,7 @@ Examples
const colorMap = new Map(); function assignPenColor(event) { - const uniqueId = event.deviceProperties.uniqueId; + const uniqueId = event.persistentDeviceId; // Check if a unique Id exists. if (uniqueId == 0) { return; @@ -242,7 +242,7 @@double azimuthAngle; DOMString pointerType = ""; boolean isPrimary = false; - DeviceProperties? deviceProperties = null; + long persistentDeviceId = 0; sequence<PointerEvent> coalescedEvents = []; sequence<PointerEvent> predictedEvents = []; }; @@ -262,7 +262,7 @@
PointerEvent
interfacereadonly attribute double azimuthAngle; readonly attribute DOMString pointerType; readonly attribute boolean isPrimary; - readonly attribute DeviceProperties? deviceProperties; + readonly attribute long persistentDeviceId; [SecureContext] sequence<PointerEvent> getCoalescedEvents(); sequence<PointerEvent> getPredictedEvents(); }; @@ -355,9 +355,10 @@
PointerEvent
interface
PointerEvent
interface- Indicates if the pointer represents the primary pointer of this pointer type.
deviceProperties +persistentDeviceId - A set of properties that represent event generating device-specific information such as unique id.
+A unique identifier for the pointing device. If the hardware supports multiple pointers, pointer events generated from pointing devices MUST only get a
+persistentDeviceId
if those pointers are uniquely identifiable over the session. If the pointer is uniquely identifiable, the assignedpersistentDeviceId
to that pointing device will remain constant for the remainder of the session. ThepersistentDeviceId
value of0
MUST be reserved and used to indicate events whose generating device could not be identified. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, thepersistentDeviceId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomizedpersistentDeviceId
MUST be chosen the next time that particular pointing device is used again in a new session.Due to digitizer and pointing device hardware constraints, apersistentDeviceId
is not guaranteed to be available for all pointer events from a pointing device. For example, the device may not report its hardware id to the digitizer in time forpointerdown
to have apersistentDeviceId
. In such a case, thepersistentDeviceId
may initially be0
and change to a valid value.getCoalescedEvents() @@ -717,28 +718,6 @@ Converting between
tiltX
/tiltY
andaltitud
DeviceProperties
interface- dictionary DevicePropertiesInit { - long uniqueId = 0; - }; - - [Exposed=Window] - interface DeviceProperties { - constructor(optional DevicePropertiesInit devicePropertiesInitDict = {}); - readonly attribute long uniqueId; - }; --
A unique identifier for the pointing device. If the hardware supports multiple pointers, pointer events generated from pointing devices MUST only get a uniqueId
if those pointers are uniquely identifiable over the session. If the pointer is uniquely identifiable, the assigned uniqueId
to that pointing device will remain constant for the remainder of the session. The uniqueId
value of 0
MUST be reserved and used to indicate events whose generating device could not be identified. Like pointerId, to minimize the chance of fingerprinting and tracking across different pages or domains, the uniqueId
MUST only be associated explicitly with that particular pointing device for the lifetime of the page / session, and a new randomized uniqueId
MUST be chosen the next time that particular pointing device is used again in a new session.
uniqueId
is not guaranteed to be available for all pointer events from a pointing device. For example, the device may not report its hardware id to the digitizer in time for pointerdown
to have a uniqueId
. In such a case, the uniqueId
may initially be 0
and change to a valid value.Below are the event types defined in this specification.