[whatwg] Suggested enhancement for initialization of mouse events
matthew at matthew.at
Tue Sep 14 05:16:52 PDT 2010
On 9/14/2010 5:00 AM, Ashley Sheridan wrote:
> I'm not entirely sure that this is possible. As far as I know (and I
> could be very wrong) the events start with the OS and work their way
> agent, so if the mouse has moved off of the user agent (browser) then
> it may not be possible to access the current coordinates. The browser
> would only be aware of the coordinates that it was last passed by the
> OS, i.e. only those in it's own window space. A browser could offer up
> the last known coordinates, but if the cursor is beyond the region of
> a browser window for example, then the browser would be passing across
> the wrong values. This might not matter for most cases, but then
> again, I can't foresee much use for having the coordinates of a cursor
> that triggered no event. The only time a user agent might be aware of
> the correct coordinates and no event would be triggered would be where
> the cursor was over part of the user agent that wasn't the web page,
> like the menubar, etc.
Even if the browser could tell you the mouse coordinates of a cursor
that wasn't over the content/frame in question, doing so would be a
serious security problem.
The only way this would make sense is for the omitted arguments to
reflect the last mouse event you received... but that's more ugly than
simply remembering them from that last event yourself.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the whatwg