Wheel events

Hi all,

there has been some discussion about how wheel event should work, and
what kind of information it should expose.
The current DOM 3 Events (editor) draft has the legacy mousewheel event
and also the new wheel event which has deltaX/Y/Z. The problem is
that what delta means (especially in the new "wheel" event).
Operating systems create events which may contain several kinds
of information - how many lines to scroll but also how may pixels.
Currently Safari seems to support also pixel scrolling, but doesn't 
dispatch events for events which don't have line scrolling >= 1.
And that causes problems like 

Web applications should be able handle that situation and IMO
should know what kind of wheel event just happened.
So either deltaX/Y/Z (I'm talking about the new event here, not the 
legacy event) should be always in pixel units (or fragment of such)
or the event should somehow have information about the units.
In latter the case there is the problem that same system event may
contain both pixel and line information. So either two DOM events
should be dispatch or one event should be able to carry information
about the different kinds of units.

But if the event contains only pixel information, web app can't know
how many pixels mean a "line-scroll". And that is valuable when trying
to make web app to act like a native application.

So there are (at least) 5 options
1. only pixel delta
   - Web app can't know what delta value means a "line scroll"
2. events with both line and pixel scroll information (maybe also page
    scroll etc?)
   - Web apps would get all the needed information in one event,
     but the event interface would probably look pretty ugly
3. separate events for pixel scrolls and line scrolls
   - Web app can't know whether user did one or two gestures
4. linked events; if the native event contains both line and pixel
    data, dispatch one event for line delta and one for pixel data
    but add some attribute to the event interface which links these
    events together, something like
      readonly attribute WheelEvent relatedEvent;
      readonly attribute WheelEventList relatedEvents;
5. no pixel scrolling at all
   - causes http://mozilla.pettay.fi/moztests/pixelscrolling.mov

I just came up with the idea 4, need to think that a bit more.


Received on Wednesday, 18 June 2008 20:43:37 UTC