Skip to content

Commit

Permalink
Clarify boundary event dispatch paragraphs in 4.1.3 (#502)
Browse files Browse the repository at this point in the history
This PR clarifies boundary event dispatch paragraph in 4.1.3 to avoid the confusion we encountered in web-platform-tests/interop#380.

(Also makes variables more readable using camelCase.)
  • Loading branch information
mustaqahmed authored Mar 26, 2024
1 parent 77680fb commit 93938ae
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,18 +423,16 @@ <h3>Firing events using the <code>PointerEvent</code> interface</h3>
<p>If the event is {{GlobalEventHandlers/pointerdown}}, the associated device is a direct manipulation device, and the target is an {{Element}},
then <a>set pointer capture</a> for this <code>pointerId</code> to the target element as described in <a>implicit pointer capture</a>.</p>

<p>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 <a data-cite="uievents/#events-mouseevent-event-order">ensuring event ordering</a> [[UIEVENTS]].
If the |needs over event| flag is set, an over event is needed even if the target element is the same.
</p>
<p>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 <a data-cite="uievents/#events-mouseevent-event-order">ensuring event ordering</a> [[UIEVENTS]]. If the |needsOverEvent| flag is set, a {{GlobalEventHandlers/pointerover}} event is needed even if the target element is the same.</p>

<p>Fire the event to the determined target.</p>

<p>Save the determined target as the |previous target| for the given pointer,
and reset the |needs over event| flag to <code>false</code>.
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 <code>true</code>.
<p>Save the determined target as the |previousTarget| for the given pointer,
and reset the |needsOverEvent| flag to <code>false</code>.
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 <code>true</code>.
</p>

<div class="note">Using the <a>pointer capture target override</a> 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.</div>
Expand Down

0 comments on commit 93938ae

Please sign in to comment.