Re: [pointerevents] Changing the DOM hierarchy while handling a "pointerenter" event produces significantly different results across browsers (#285)

> In the child removal scenario example I suppose that the browser doesn't send the event to the child because it's been detached, but I don't get why the parent is not notified.

The new spec spec text should specify this as the previous target will track the still attached parent of the removed node

From [pointer-events 4.1.3 Firing events using the PointerEvent interface](https://w3c.github.io/pointerevents/#:~:text=If%20the%20previous%20target%20at%20any%20point%20will%20no%20longer%20be%20connected%20%5BDOM%5D%2C%20update%20the%20previous%20target%20to%20the%20nearest%20still%20connected%20%5BDOM%5D%20parent%20following%20the%20event%20path%20corresponding%20to%20dispatching%20events%20to%20the%20previous%20target%2C%20and%20set%20the%20needs%20over%20event%20flag%20to%20true.)
> If the previous target at any point will no longer be [connected](https://dom.spec.whatwg.org/#connected) [[DOM](https://w3c.github.io/pointerevents/#bib-dom)], update the previous target to the nearest still [connected](https://dom.spec.whatwg.org/#connected) [[DOM](https://w3c.github.io/pointerevents/#bib-dom)] parent following the event path corresponding to dispatching events to the previous target, and set the needs over event flag to true.

Then on the next move, we specify that we treat the pointer as moving from this node per [this text](https://w3c.github.io/pointerevents/#:~:text=The%20user%20agent%20SHOULD%20treat%20the%20target%20as%20if%20the%20pointing%20device%20has%20moved%20over%20it%20from%20the%20previous%20target):
> 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](https://www.w3.org/TR/uievents/#events-mouseevent-event-order) [[UIEVENTS](https://w3c.github.io/pointerevents/#bib-uievents)].

This should be implemented by the BoundaryEventDispatchTracksNodeRemoval feature in chromium.

-- 
GitHub Notification of comment by flackr
Please view or discuss this issue at https://github.com/w3c/pointerevents/issues/285#issuecomment-2015740423 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 22 March 2024 19:06:42 UTC