Re: [w3c/uievents] Need clarification how mouseenter/leave should behave while modifying DOM tree during event dispatch (#244)

I wrote up a proposed [algorithm for handling mouse events](https://docs.google.com/document/d/1AoNnGTGabWOQoAH-M34Jdw2rbbwb_pSZz2-69mysx_U/edit#heading=h.dk5myg1rxh22), but I haven't yet thought deeply about the best way to handle DOM mutations.

The proposed algorithm ensures that every element that receives a `mouseenter` will receive a `mouseleave` even if the element is moved, but there may be other concerns that should be taken into account.

WRT the `pointerevent` example in the other bug, I would have expected the pointer enter/leave events to match the mouse enter/leave events.

Naively, I would have guessed either:
* mouse/pointer enter top
* mouse/pointer enter middle
* mouse/pointer enter bottom
* mouse/pointer leave bottom
* mouse/pointer leave middle

Or possibly simply (if the elements are removed before any events are sent):
* mouse/pointer enter top

The first example most closely matches Safari except the the extra mouse/pointerenter at the end. It's odd that all browsers generate the unnecessary "pointerenter top" at the end.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/issues/244#issuecomment-663908681

Received on Saturday, 25 July 2020 21:37:01 UTC