Skip to content

Commit

Permalink
Explain how a removed DOM node should be handled for boundary events.
Browse files Browse the repository at this point in the history
This explains how the previous target is tracked when the previous
target is removed from the DOM for w3c#477.
  • Loading branch information
flackr committed Oct 31, 2023
1 parent 24de93c commit fd853ba
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,17 @@ <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>Fire the event to the determined target. The user agent SHOULD treat the target as if the pointing device has moved over it for the purpose of <a data-cite="uievents/#events-mouseevent-event-order">ensuring event ordering</a> [[UIEVENTS]].</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| (or if the |over child| flag is set, over an anonymous child of |previous target|)
for the purpose of <a data-cite="uievents/#events-mouseevent-event-order">ensuring event ordering</a> [[UIEVENTS]].</p>

<p>Save the determined target as the |previous target| for the given pointer,
and reset the |over child| 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 |over child| 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 fd853ba

Please sign in to comment.