w3c / uievents

UI Events
https://w3c.github.io/uievents/
Other
148 stars 51 forks source link

[MouseEvent algorithms] Boundary event dispatch needs to be tied to native down and up events #383

Open mustaqahmed opened 1 month ago

mustaqahmed commented 1 month ago

Mouse boundary event (mouseenter/leave/over/out) dispatch is currently tracked using the state variable last_mouse_element. The variable is checked and updated only in Section 3.4.3.15. handle native mouse move.

Native mousedown and mouseup events should check and update the variable too: a mousedown always follows a mouseenter and mouseover to the same target in all major browsers.

Possible solution

Rewrite Section 3.4.4. Mouse Event Order into a method named updateElementUnderMouse which will check and update the variable and fire all required boundary events. Call this from native mouse event handlers.

mustaqahmed commented 1 month ago

FYI: @garykac @flackr @smaug----