From 93938ae7fe0172e2ae7587ad7d7c4fc8562d7153 Mon Sep 17 00:00:00 2001 From: Mustaq Ahmed Date: Tue, 26 Mar 2024 09:31:01 -0400 Subject: [PATCH] Clarify boundary event dispatch paragraphs in 4.1.3 (#502) This PR clarifies boundary event dispatch paragraph in 4.1.3 to avoid the confusion we encountered in https://github.com/web-platform-tests/interop/issues/380. (Also makes variables more readable using camelCase.) --- index.html | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 1d74ba8..e82ef61 100644 --- a/index.html +++ b/index.html @@ -423,18 +423,16 @@

Firing events using the PointerEvent interface

If the event is {{GlobalEventHandlers/pointerdown}}, the associated device is a direct manipulation device, and the target is an {{Element}}, then set pointer capture for this pointerId to the target element as described in implicit pointer capture.

-

Fire the event to the determined target. - The user agent SHOULD treat the target as if the pointing device has moved over it from the |previous target| - for the purpose of ensuring event ordering [[UIEVENTS]]. - If the |needs over event| flag is set, an over event is needed even if the target element is the same. -

+

Before firing this event, the user agent SHOULD treat the target as if the pointing device has moved over it from the |previousTarget| for the purpose of ensuring event ordering [[UIEVENTS]]. If the |needsOverEvent| flag is set, a {{GlobalEventHandlers/pointerover}} event is needed even if the target element is the same.

+ +

Fire the event to the determined target.

-

Save the determined target as the |previous target| for the given pointer, - and reset the |needs over event| flag to false. - If the |previous target| at any point will no longer be [=connected=] [[DOM]], - update the |previous target| to the nearest still [=connected=] [[DOM]] parent - following the event path corresponding to dispatching events to the previous target, - and set the |needs over event| flag to true. +

Save the determined target as the |previousTarget| for the given pointer, + and reset the |needsOverEvent| flag to false. + If the |previousTarget| at any point will no longer be [=connected=] [[DOM]], + update the |previousTarget| to the nearest still [=connected=] [[DOM]] parent + following the event path corresponding to dispatching events to the |previousTarget|, + and set the |needsOverEvent| flag to true.

Using the pointer capture target override as the target instead of the normal hit-test result may fire some boundary events, as defined by [[UIEVENTS]]. This is the same as the pointer leaving its previous target and entering this new capturing target. When the capture is released, the same scenario may happen, as the pointer is leaving the capturing target and entering the hit-test target.