Skip to content

Commit 8bd3141

Browse files
committed
FF141 PointerEvent.persistentDeviceId - Relnote/layout
1 parent 6a8eddd commit 8bd3141

File tree

2 files changed

+13
-7
lines changed
  • files/en-us
    • mozilla/firefox/releases/141
    • web/api/pointerevent/persistentdeviceid

2 files changed

+13
-7
lines changed

files/en-us/mozilla/firefox/releases/141/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ Firefox 141 is the current [Beta version of Firefox](https://www.mozilla.org/en-
5252

5353
<!-- #### Removals -->
5454

55-
<!-- ### APIs -->
55+
### APIs
56+
57+
- The {{domxref("PointerEvent/persistentDeviceId","persistentDeviceId")}} property of the {{domxref("PointerEvent")}} interface is now supported. This gives each pointing device that interacts with the screen a unique ID that persists for the session. It provides a reliable way to identify multiple pointing devices (such as pens) interacting with the screen simultaneously. ([Firefox bug 1968400](https://bugzil.la/1968400)).
5658

5759
<!-- #### DOM -->
5860

files/en-us/web/api/pointerevent/persistentdeviceid/index.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ browser-compat: api.PointerEvent.persistentDeviceId
88

99
{{ APIRef("Pointer Events") }}
1010

11-
The **`persistentDeviceId`** read-only property of the
12-
{{domxref("PointerEvent")}} interface is a unique identifier for the pointing device generating the `PointerEvent`. This provides a secure, reliable way to identify multiple pointing devices (such as pens) interacting with the screen simultaneously.
11+
The **`persistentDeviceId`** read-only property of the {{domxref("PointerEvent")}} interface is a unique identifier for the pointing device generating the `PointerEvent`.
12+
This provides a secure, reliable way to identify multiple pointing devices (such as pens) interacting with the screen simultaneously.
1313

14-
A `persistentDeviceId` persists for the lifetime of a browsing session. To avoid the risk of fingerprinting/tracking, pointing devices are assigned a new `persistentDeviceId` at the start of each session.
14+
A `persistentDeviceId` persists for the lifetime of a browsing session.
15+
To avoid the risk of fingerprinting/tracking, pointing devices are assigned a new `persistentDeviceId` at the start of each session.
1516

1617
Pointer events whose generating device could not be identified are assigned a `persistentDeviceId` value of `0`.
1718

@@ -20,17 +21,20 @@ Pointer events whose generating device could not be identified are assigned a `p
2021
An integer, or `0` if the device generating the `PointerEvent` could not be identified.
2122

2223
> [!NOTE]
23-
> Due to digitizer and pointing device hardware constraints, a `persistentDeviceId` may not be available for all pointer events, particularly with older hardware. For example, the pointing device might not report its hardware ID to the digitizer in time for `pointerdown` to receive a `persistentDeviceId`: it may initially be `0` and change to a valid value for later events in the stroke.
24+
> Due to digitizer and pointing device hardware constraints, a `persistentDeviceId` may not be available for all pointer events, particularly with older hardware.
25+
> For example, the pointing device might not report its hardware ID to the digitizer in time for `pointerdown` to receive a `persistentDeviceId`: it may initially be `0` and change to a valid value for later events in the stroke.
2426
2527
## Examples
2628

29+
### Assign color for each persistentDeviceId
30+
2731
Assuming the following HTML:
2832

2933
```html
30-
<canvas id="inking-surface" width="1280" height="720"></canvas>
34+
<canvas id="inking-surface" width="300" height="200"></canvas>
3135
```
3236

33-
The following JavaScript assigns a different inking color to unique pointers interacting with a canvas:
37+
The following JavaScript assigns a different inking color to up to three unique pointers interacting with a canvas:
3438

3539
```js
3640
const colorBlue = 0;

0 commit comments

Comments
 (0)