From 46a51daf0e869394c37d2ee6c1ad9e433d96ab74 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Mon, 1 Jul 2024 02:07:33 +0000 Subject: [PATCH] Bug 1904460 [wpt PR 46888] - Swap PointerEvent.deviceProperties with 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: https://github.com/w3c/pointerevents/pull/495 Change-Id: Ia284adc60bc4030b69dbec89d0e37117fecf3f83 Bug: 330760871 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5643255 Commit-Queue: Sahir Vellani Reviewed-by: Olga Gerchikov Reviewed-by: Robert Flack Cr-Commit-Position: refs/heads/main{#1318886} -- wpt-commits: b29c0837b336a17d4aca09b9afbb82ac30748385 wpt-pr: 46888 UltraBlame original commit: 84225becd9d58cb4946fefdbbd42aeda5dc9445c --- ...eviceid-from-pointer-event.tentative.html} | 12 +- ...tdeviceid-is-unique-manual.tentative.html} | 47 ++---- ...id-from-pointer-event-init.tentative.html} | 141 +++--------------- 3 files changed, 42 insertions(+), 158 deletions(-) rename testing/web-platform/tests/pointerevents/{deviceproperties/get-device-properties-uniqueid-from-pointer-event.tentative.html => persistentDeviceId/get-persistendeviceid-from-pointer-event.tentative.html} (94%) rename testing/web-platform/tests/pointerevents/{deviceproperties/unique-id-is-unique-manual.tentative.html => persistentDeviceId/persistentdeviceid-is-unique-manual.tentative.html} (94%) rename testing/web-platform/tests/pointerevents/{deviceproperties/pointer-event-has-device-properties-uniqueid-from-pointer-event-init.tentative.html => persistentDeviceId/pointer-event-has-persistentdeviceid-from-pointer-event-init.tentative.html} (65%) diff --git a/testing/web-platform/tests/pointerevents/deviceproperties/get-device-properties-uniqueid-from-pointer-event.tentative.html b/testing/web-platform/tests/pointerevents/persistentDeviceId/get-persistendeviceid-from-pointer-event.tentative.html similarity index 94% rename from testing/web-platform/tests/pointerevents/deviceproperties/get-device-properties-uniqueid-from-pointer-event.tentative.html rename to testing/web-platform/tests/pointerevents/persistentDeviceId/get-persistendeviceid-from-pointer-event.tentative.html index 7a58edde3e522..515f2018f6ff8 100644 --- a/testing/web-platform/tests/pointerevents/deviceproperties/get-device-properties-uniqueid-from-pointer-event.tentative.html +++ b/testing/web-platform/tests/pointerevents/persistentDeviceId/get-persistendeviceid-from-pointer-event.tentative.html @@ -184,9 +184,7 @@ that pointerEvent . -deviceProperties -. -uniqueId +persistentDeviceId is 0 by @@ -234,9 +232,7 @@ ( event . -deviceProperties -. -uniqueId +persistentDeviceId 0 " deviceId @@ -342,9 +338,7 @@ ' PointerEvent . -deviceProperties -. -uniqueId +persistentDeviceId ' ) ; diff --git a/testing/web-platform/tests/pointerevents/deviceproperties/unique-id-is-unique-manual.tentative.html b/testing/web-platform/tests/pointerevents/persistentDeviceId/persistentdeviceid-is-unique-manual.tentative.html similarity index 94% rename from testing/web-platform/tests/pointerevents/deviceproperties/unique-id-is-unique-manual.tentative.html rename to testing/web-platform/tests/pointerevents/persistentDeviceId/persistentdeviceid-is-unique-manual.tentative.html index 00ae154c1de20..2e3f8b4a22b23 100644 --- a/testing/web-platform/tests/pointerevents/deviceproperties/unique-id-is-unique-manual.tentative.html +++ b/testing/web-platform/tests/pointerevents/persistentDeviceId/persistentdeviceid-is-unique-manual.tentative.html @@ -38,9 +38,7 @@ of PointerEvent . -deviceProperties -. -uniqueId +persistentDeviceId . Specifically this @@ -111,9 +109,7 @@ < title > -DeviceProperties -. -uniqueId +persistentDeviceId is unique for @@ -659,44 +655,33 @@ ( event . -deviceProperties +persistentDeviceId ) { const -uniqueId +persistentDeviceId = event . -deviceProperties -. -uniqueId +persistentDeviceId ; currentuniqueid . innerText = -uniqueId +persistentDeviceId ? -uniqueId +persistentDeviceId : " Unknown " ; -if -( -! -uniqueId -) -{ -return -; -} list . push ( -uniqueId +persistentDeviceId ) ; } @@ -768,7 +753,7 @@ Device 1 have -uniqueIds +deviceIds . " ) @@ -785,14 +770,14 @@ has a consistent -uniqueId +deviceId . " ) ; } " -uniqueId +deviceId is consistent for @@ -819,7 +804,7 @@ Device 2 have -uniqueIds +deviceIds . " ) @@ -836,14 +821,14 @@ has a consistent -uniqueId +deviceId . " ) ; } " -uniqueId +deviceId is consistent for @@ -885,14 +870,14 @@ 2 have different -uniqueIds +deviceIds . " ) ; } " -uniqueId +deviceId is unique to diff --git a/testing/web-platform/tests/pointerevents/deviceproperties/pointer-event-has-device-properties-uniqueid-from-pointer-event-init.tentative.html b/testing/web-platform/tests/pointerevents/persistentDeviceId/pointer-event-has-persistentdeviceid-from-pointer-event-init.tentative.html similarity index 65% rename from testing/web-platform/tests/pointerevents/deviceproperties/pointer-event-has-device-properties-uniqueid-from-pointer-event-init.tentative.html rename to testing/web-platform/tests/pointerevents/persistentDeviceId/pointer-event-has-persistentdeviceid-from-pointer-event-init.tentative.html index b35a67e1850fd..8e022f68d1867 100644 --- a/testing/web-platform/tests/pointerevents/deviceproperties/pointer-event-has-device-properties-uniqueid-from-pointer-event-init.tentative.html +++ b/testing/web-platform/tests/pointerevents/persistentDeviceId/pointer-event-has-persistentdeviceid-from-pointer-event-init.tentative.html @@ -88,9 +88,7 @@ that pointerEvent . -deviceProperties -. -uniqueId +persistentDeviceId can be set @@ -104,12 +102,12 @@ script > const -UNIQUE_ID +PERSISTENT_ID = 1001 ; const -INVALID_UNIQUE_ID +INVALID_PERSISTENT_ID = 0 ; @@ -117,19 +115,17 @@ CheckDeviceId ( event -uniqueId +persistentDeviceId ) { assert_equals ( event . -deviceProperties -. -uniqueId -uniqueId +persistentDeviceId +persistentDeviceId " -uniqueId +persistentDeviceId is populated " @@ -154,17 +150,9 @@ return ; var -deviceProps +deviceId = -new -DeviceProperties -( -{ -uniqueId -: -1001 -} -) +PERSISTENT_ID ; var downEvent @@ -199,16 +187,16 @@ isPrimary : true -deviceProperties +persistentDeviceId : -deviceProps +deviceId } ) ; CheckDeviceId ( downEvent -UNIQUE_ID +PERSISTENT_ID ) ; var @@ -244,16 +232,16 @@ isPrimary : true -deviceProperties +persistentDeviceId : -deviceProps +deviceId } ) ; CheckDeviceId ( moveEvent -UNIQUE_ID +PERSISTENT_ID ) ; var @@ -289,108 +277,25 @@ isPrimary : true -deviceProperties +persistentDeviceId : -deviceProps +deviceId } ) ; CheckDeviceId ( upEvent -UNIQUE_ID +PERSISTENT_ID ) ; } ' PointerEvent . -deviceProperties +persistentDeviceId via -DevicePropertiesInit -' -) -; -promise_test -( -async -( -) -= -> -{ -if -( -! -window -. -internals -) -return -; -var -emptyDeviceProps -= -new -DeviceProperties -( -{ -} -) -; -var -downEventEmptyProps -= -new -PointerEvent -( -" -pointerdown -" -{ -pointerId -: -1 -bubbles -: -true -cancelable -: -true -pointerType -: -" -pen -" -width -: -100 -height -: -100 -isPrimary -: -true -deviceProperties -: -emptyDeviceProps -} -) -; -CheckDeviceId -( -downEventEmptyProps -INVALID_UNIQUE_ID -) -; -} -' -PointerEvent -. -deviceProperties -via -empty -DevicePropertiesInit +PointerEventInit ' ) ; @@ -451,14 +356,14 @@ ( downEventEmptyProps . -deviceProperties -null +persistentDeviceId +INVALID_PERSISTENT_ID ) ; } ' No -deviceProperties +persistentDeviceId in PointerEventInit '