Closed Bug 6213 Opened 26 years ago Closed 26 years ago

Need to get the offset in the node under the mouse cursor

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: akkzilla, Assigned: joki)

References

Details

Events currently allow for getting the node under the event's (x,y) position, but not the offset into that node. We need a method in the event API to get the offset into the node (e.g. if it's a text node). This is needed for middle-mouse paste and for some context menu issues.
Blocks: 5380
Adding dependency info.
Target Milestone: M7
Can we get this for M7, since the bug that depends on it is marked M7? Tom, I can do this if you're overloaded. The implementation shouldn't be hard, I just need your OK to add the new API.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Okay, you got it. We now also reflect the event info as range endpoints. Vidur and I will look at standardizing this but until then if you were using nsDOMUIEvent to get the info you'll need to get nsDOMNSUIEvent to get these. Or if you're in JS, it just works. Anyway, new props are called event.rangeParent event.rangeOffset Names may change at some point.
Status: RESOLVED → VERIFIED
I'll verify this since it's code-level -- works great, thanks, Tom!
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.