Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add persistentDeviceId to PointerEvent #495

Merged
merged 17 commits into from
Aug 14, 2024
Merged

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.

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
@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

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
@sahirv sahirv requested a review from flackr March 11, 2024 18:00
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
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
@flackr
Copy link
Contributor

flackr commented May 29, 2024

I'm okay with having a property directly on the PointerEvent, but would suggest some better differentiation from pointerId. E.g. maybe if we call it persistentId it will be obvious how/why it is different from the pointerId.

@sahirv
Copy link
Contributor Author

sahirv commented May 30, 2024

maybe if we call it persistentId it will be obvious how/why it is different from the pointerId.

How does persistentDeviceId sound? By naming it this way we make it clear that:

  1. This id will persist (for the session) differentiating it from pointerId.
  2. This id is tied to the pointing device; not the event or sequence.

@smaug----
Copy link
Contributor

That is quite reasonable. It is long and perhaps weird enough that one wouldn't likely mix that with pointerId.

@sahirv
Copy link
Contributor Author

sahirv commented May 30, 2024

@annevk @flackr @mustaqahmed Are you all good with this suggestion and the overall direction we're taking here?

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 <[email protected]>
Reviewed-by: Mustaq Ahmed <[email protected]>
Commit-Queue: Sahir Vellani <[email protected]>
Reviewed-by: Olga Gerchikov <[email protected]>
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 <[email protected]>
Reviewed-by: Olga Gerchikov <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
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 <[email protected]>
Reviewed-by: Olga Gerchikov <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
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 <[email protected]>
Reviewed-by: Olga Gerchikov <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
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 <[email protected]>
Reviewed-by: Olga Gerchikov <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
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 <[email protected]>
Reviewed-by: Olga Gerchikov <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
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 <[email protected]>
Reviewed-by: Olga Gerchikov <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
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
2 checks passed
@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

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