KEMBAR78
Add persistentDeviceId to PointerEvent by sahirv · Pull Request #495 · w3c/pointerevents · GitHub
Skip to content

Conversation

sahirv
Copy link
Contributor

@sahirv sahirv commented Jan 11, 2024

This change proposes the introduction of a new attribute to the PointerEvent interface - persistentDeviceId. See: https://github.com/WICG/pointer-event-extensions/blob/main/pointer-event-device-id-explainer.md

This pull request is expected to make the 4th iteration of the PointerEvent specification.


Preview | Diff

This change proposes the introduction of a new attribute to the PointerEvent interface - deviceId. See: https://github.com/WICG/pointer-event-extensions/blob/main/pointer-event-device-id-explainer.md
@patrickhlauke
Copy link
Member

Worth adding, for context, #353

@sahirv
Copy link
Contributor Author

sahirv commented Jan 17, 2024

Happy to take any comments on the changes. The idea is based on that of pointer id; -1 is reserved for invalid ids. In Chromium, 1 is reserved for the mouse pointer (0 is unused); but I left the wording to be similar to the pointerId definition. As long as the deviceId is unique for each device, web devs should not have a problem.

@sahirv sahirv changed the title Add deviceId to PointerEvent spec Add deviceProperties.uniqueId to PointerEvent spec Mar 5, 2024
@sahirv
Copy link
Contributor Author

sahirv commented Mar 5, 2024

Made changes to introduce deviceProperties rather than having deviceId on PointerEvent. Rough draft- feedback appreciated

@sahirv sahirv requested a review from flackr March 11, 2024 18:00
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 28, 2024
This change replaces deviceId on the PointerEvent interface with a new interface, deviceProperties. DeviceProperties contains one member, uniqueId, which functionally behaves the same as the outgoing deviceId.

Spec: w3c/pointerevents#495

This change also removes the setting of deviceId when creating a PointerCancel event, as there is no current application for device/unique id for a PointerCancel.

Bug: 330760871
Change-Id: I0f1a9f7d5589f790d94f498a38bfdf55b6f51073
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 29, 2024
This change replaces deviceId on the PointerEvent interface with a new interface, deviceProperties. DeviceProperties contains one member, uniqueId, which functionally behaves the same as the outgoing deviceId.

Spec: w3c/pointerevents#495

This change also removes the setting of deviceId when creating a PointerCancel event, as there is no current application for device/unique id for a PointerCancel.

Bug: 330760871
Change-Id: I0f1a9f7d5589f790d94f498a38bfdf55b6f51073
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Apr 8, 2024
This change replaces deviceId on the PointerEvent interface with a new interface, deviceProperties. DeviceProperties contains one member, uniqueId, which functionally behaves the same as the outgoing deviceId.

Spec: w3c/pointerevents#495

This change also removes the setting of deviceId when creating a PointerCancel event, as there is no current application for device/unique id for a PointerCancel.

Bug: 330760871
Change-Id: I0f1a9f7d5589f790d94f498a38bfdf55b6f51073
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Jun 1, 2024
… 0, a=testonly

Automatic update from web-platform-tests
Set Invalid DeviceProperties.uniqueId to 0

Replace -1 with 0 for the invalid uniqueId as per recent spec consensus.
Spec: w3c/pointerevents#495

Bug: 330760871
Change-Id: I063515535ee0510c89942f16098c6211bafb480c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5463741
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Sahir Vellani <sahir.vellani@microsoft.com>
Reviewed-by: Olga Gerchikov <gerchiko@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1290720}

--

wpt-commits: a2bf027ec76e7f183c4f7e3fdcd62d5a0e818598
wpt-pr: 45765
@sahirv
Copy link
Contributor Author

sahirv commented Jun 10, 2024

@smaug---- @flackr @mustaqahmed I have updated this PR to introduce persistentDeviceId. Please take a look and leave your feedback. Thank you :)

@sahirv sahirv changed the title Add deviceProperties.uniqueId to PointerEvent spec Add persistentDeviceId to PointerEvent Jun 10, 2024
@sahirv
Copy link
Contributor Author

sahirv commented Jun 17, 2024

Gentle ping :)

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 24, 2024
Bring back a unique id on the base pointer event and remove
deviceProperties. Rather than deviceId, this will be called
persistentDeviceId.
Spec: w3c/pointerevents#495

Change-Id: Ia284adc60bc4030b69dbec89d0e37117fecf3f83
Bug: 330760871
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 24, 2024
Bring back a unique id on the base pointer event and remove
deviceProperties. Rather than deviceId, this will be called
persistentDeviceId.
Spec: w3c/pointerevents#495

Change-Id: Ia284adc60bc4030b69dbec89d0e37117fecf3f83
Bug: 330760871
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 25, 2024
Bring back a unique id on the base pointer event and remove
deviceProperties. Rather than deviceId, this will be called
persistentDeviceId.
Spec: w3c/pointerevents#495

Change-Id: Ia284adc60bc4030b69dbec89d0e37117fecf3f83
Bug: 330760871
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5643255
Commit-Queue: Sahir Vellani <sahir.vellani@microsoft.com>
Reviewed-by: Olga Gerchikov <gerchiko@microsoft.com>
Reviewed-by: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1318886}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 25, 2024
Bring back a unique id on the base pointer event and remove
deviceProperties. Rather than deviceId, this will be called
persistentDeviceId.
Spec: w3c/pointerevents#495

Change-Id: Ia284adc60bc4030b69dbec89d0e37117fecf3f83
Bug: 330760871
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5643255
Commit-Queue: Sahir Vellani <sahir.vellani@microsoft.com>
Reviewed-by: Olga Gerchikov <gerchiko@microsoft.com>
Reviewed-by: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1318886}
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Jun 29, 2024
…PointerEvent.persistentDeviceId, a=testonly

Automatic update from web-platform-tests
Swap PointerEvent.deviceProperties with PointerEvent.persistentDeviceId

Bring back a unique id on the base pointer event and remove
deviceProperties. Rather than deviceId, this will be called
persistentDeviceId.
Spec: w3c/pointerevents#495

Change-Id: Ia284adc60bc4030b69dbec89d0e37117fecf3f83
Bug: 330760871
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5643255
Commit-Queue: Sahir Vellani <sahir.vellani@microsoft.com>
Reviewed-by: Olga Gerchikov <gerchiko@microsoft.com>
Reviewed-by: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1318886}

--

wpt-commits: b29c0837b336a17d4aca09b9afbb82ac30748385
wpt-pr: 46888
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jun 29, 2024
…PointerEvent.persistentDeviceId, a=testonly

Automatic update from web-platform-tests
Swap PointerEvent.deviceProperties with PointerEvent.persistentDeviceId

Bring back a unique id on the base pointer event and remove
deviceProperties. Rather than deviceId, this will be called
persistentDeviceId.
Spec: w3c/pointerevents#495

Change-Id: Ia284adc60bc4030b69dbec89d0e37117fecf3f83
Bug: 330760871
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5643255
Commit-Queue: Sahir Vellani <sahir.vellani@microsoft.com>
Reviewed-by: Olga Gerchikov <gerchiko@microsoft.com>
Reviewed-by: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1318886}

--

wpt-commits: b29c0837b336a17d4aca09b9afbb82ac30748385
wpt-pr: 46888
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jul 1, 2024
…PointerEvent.persistentDeviceId, a=testonly

Automatic update from web-platform-tests
Swap PointerEvent.deviceProperties with PointerEvent.persistentDeviceId

Bring back a unique id on the base pointer event and remove
deviceProperties. Rather than deviceId, this will be called
persistentDeviceId.
Spec: w3c/pointerevents#495

Change-Id: Ia284adc60bc4030b69dbec89d0e37117fecf3f83
Bug: 330760871
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5643255
Commit-Queue: Sahir Vellani <sahir.vellanimicrosoft.com>
Reviewed-by: Olga Gerchikov <gerchikomicrosoft.com>
Reviewed-by: Robert Flack <flackrchromium.org>
Cr-Commit-Position: refs/heads/main{#1318886}

--

wpt-commits: b29c0837b336a17d4aca09b9afbb82ac30748385
wpt-pr: 46888

UltraBlame original commit: 84225becd9d58cb4946fefdbbd42aeda5dc9445c
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jul 1, 2024
…PointerEvent.persistentDeviceId, a=testonly

Automatic update from web-platform-tests
Swap PointerEvent.deviceProperties with PointerEvent.persistentDeviceId

Bring back a unique id on the base pointer event and remove
deviceProperties. Rather than deviceId, this will be called
persistentDeviceId.
Spec: w3c/pointerevents#495

Change-Id: Ia284adc60bc4030b69dbec89d0e37117fecf3f83
Bug: 330760871
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5643255
Commit-Queue: Sahir Vellani <sahir.vellanimicrosoft.com>
Reviewed-by: Olga Gerchikov <gerchikomicrosoft.com>
Reviewed-by: Robert Flack <flackrchromium.org>
Cr-Commit-Position: refs/heads/main{#1318886}

--

wpt-commits: b29c0837b336a17d4aca09b9afbb82ac30748385
wpt-pr: 46888

UltraBlame original commit: 84225becd9d58cb4946fefdbbd42aeda5dc9445c
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Jul 2, 2024
…PointerEvent.persistentDeviceId, a=testonly

Automatic update from web-platform-tests
Swap PointerEvent.deviceProperties with PointerEvent.persistentDeviceId

Bring back a unique id on the base pointer event and remove
deviceProperties. Rather than deviceId, this will be called
persistentDeviceId.
Spec: w3c/pointerevents#495

Change-Id: Ia284adc60bc4030b69dbec89d0e37117fecf3f83
Bug: 330760871
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5643255
Commit-Queue: Sahir Vellani <sahir.vellani@microsoft.com>
Reviewed-by: Olga Gerchikov <gerchiko@microsoft.com>
Reviewed-by: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1318886}

--

wpt-commits: b29c0837b336a17d4aca09b9afbb82ac30748385
wpt-pr: 46888
@patrickhlauke patrickhlauke changed the base branch from gh-pages to next July 4, 2024 13:47
@patrickhlauke
Copy link
Member

repointed this PR to the new next branch

@smaug----
Copy link
Contributor

smaug---- commented Jul 17, 2024

Looks like the tests rely on window.internals. What is that? And why are the non-manual tests passing in all the browsers even if the API isn't implemented. Could the tests be fixed?

sadym-chromium pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 18, 2024
Bring back a unique id on the base pointer event and remove
deviceProperties. Rather than deviceId, this will be called
persistentDeviceId.
Spec: w3c/pointerevents#495

Change-Id: Ia284adc60bc4030b69dbec89d0e37117fecf3f83
Bug: 330760871
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5643255
Commit-Queue: Sahir Vellani <sahir.vellani@microsoft.com>
Reviewed-by: Olga Gerchikov <gerchiko@microsoft.com>
Reviewed-by: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1318886}
@sahirv
Copy link
Contributor Author

sahirv commented Jul 18, 2024

Thanks for bringing the tests up! I'll look into it and report back here.

@sahirv
Copy link
Contributor Author

sahirv commented Jul 29, 2024

The tests have been fixed.

@patrickhlauke patrickhlauke changed the base branch from next to gh-pages August 14, 2024 12:55
@patrickhlauke patrickhlauke merged commit 3ec245e into w3c:gh-pages Aug 14, 2024
@patrickhlauke
Copy link
Member

Merged into the next version of the spec, as discussed here https://www.w3.org/2024/07/31-pointerevents-minutes.html#t03

jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
… a=testonly

Automatic update from web-platform-tests
Introduce PointerEvent.deviceProperties

This change replaces deviceId on the PointerEvent interface with a new interface, deviceProperties. DeviceProperties contains one member, uniqueId, which functionally behaves the same as the outgoing deviceId.

Spec: w3c/pointerevents#495

Bug: 330760871
Change-Id: I0f1a9f7d5589f790d94f498a38bfdf55b6f51073
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5388651
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Sahir Vellani <sahir.vellani@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1286827}

--

wpt-commits: 4013b5285c0977d16542695ae2ed47184730f331
wpt-pr: 45420
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
… 0, a=testonly

Automatic update from web-platform-tests
Set Invalid DeviceProperties.uniqueId to 0

Replace -1 with 0 for the invalid uniqueId as per recent spec consensus.
Spec: w3c/pointerevents#495

Bug: 330760871
Change-Id: I063515535ee0510c89942f16098c6211bafb480c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5463741
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Sahir Vellani <sahir.vellani@microsoft.com>
Reviewed-by: Olga Gerchikov <gerchiko@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1290720}

--

wpt-commits: a2bf027ec76e7f183c4f7e3fdcd62d5a0e818598
wpt-pr: 45765
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
…roperties in PointerEventInit, a=testonly

Automatic update from web-platform-tests
Set null as the default value of deviceProperties in PointerEventInit

Previously, the default for deviceProperties in PointerEventInit was
undefined; although in chromium a value was set using the default
constructor. This CL changes this behaviour such that the default value
for deviceProperties is null. The corresponding WPT is updated as well.

For further context, please see the discussion here:
w3c/pointerevents#495 (comment)

Bug: 330760871
Change-Id: I5becf25f76e8b8c4572a783bfba8c1c4f36f8a74
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526091
Commit-Queue: Sahir Vellani <sahir.vellani@microsoft.com>
Reviewed-by: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1298623}

--

wpt-commits: aec353e3b1cae190e1c0485b1406ea522f38e661
wpt-pr: 46174
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
…PointerEvent.persistentDeviceId, a=testonly

Automatic update from web-platform-tests
Swap PointerEvent.deviceProperties with PointerEvent.persistentDeviceId

Bring back a unique id on the base pointer event and remove
deviceProperties. Rather than deviceId, this will be called
persistentDeviceId.
Spec: w3c/pointerevents#495

Change-Id: Ia284adc60bc4030b69dbec89d0e37117fecf3f83
Bug: 330760871
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5643255
Commit-Queue: Sahir Vellani <sahir.vellani@microsoft.com>
Reviewed-by: Olga Gerchikov <gerchiko@microsoft.com>
Reviewed-by: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1318886}

--

wpt-commits: b29c0837b336a17d4aca09b9afbb82ac30748385
wpt-pr: 46888
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants