Perhaps my Google-fu is really poor today, but I've been unable to find any explanation for this strange behavior I'm noticing.
I've got a mousemove listener event on a parent node, but sometimes the event.target is a child node. On Chrome (v79 and also surprisingly Safari), the event.offsetX/Y value is consistent, regardless if the target is the root node or a child node. In Firefox (v72.0.1) and non-Chromium Edge, the event.offsetX/Y is suddenly relative to the child node, if the child node is the target. This is throwing off my event handling function, as it needs the mouse position relative to the root listener node.
I've looked at using event.layerX/Y, which is consistently similar to offsetX/Y on the parent node, but not always equal when it is the child node.
I cannot cheat and use CSS's pointer-events:none, because I still have click handlers on these child nodes.
Is there an easy way to guarantee the event.target is the node I set the event listener on, or to always get the mouse position relative to the parent/listener node?