The specification of `relatedTarget` property of `mouseover` reads "indicates the event target a pointing device is entering, if any." but should read "exiting" #307
I believe that I have found a bug in the specification of the relatedTarget property of the mouseover event. The specification differs from what I am seeing in Firefox, Chrome, and Edge. And differs from the Mozilla documentation and the specification of the related mouseenter event.
I believe that I have found a bug in the specification of the
relatedTarget
property of themouseover
event. The specification differs from what I am seeing in Firefox, Chrome, and Edge. And differs from the Mozilla documentation and the specification of the relatedmouseenter
event.The specification of the
relatedTarget
property of themouseover
event (https://w3c.github.io/uievents/#event-type-mouseover) reads:"indicates the event target a pointing device is entering, if any."
But I think that it should read:
"indicates the event target a pointing device is exiting, if any."
When testing
mouseover
events in Firefox, Chrome, and Edge I see that therelatedTarget
property is set to the element that the pointer exited. I have created a test file here: https://gist.github.com/sbates-idrc/b47ebb07ab95a4e50dd64b7933351de1Moving the pointer from
div
A todiv
B results in the following being logged:target: div B
relatedTarget: div A
This behaviour is consistent with the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/relatedTarget
The specifiicaion of the
relatedTarget
property of themouseenter
event reads: "indicates the event target a pointing device is exiting, if any." (https://w3c.github.io/uievents/#event-type-mouseenter)