Whoops, I meant to send this to the public list, but accidentally sent to member:
For mouse wheel events, we have two important use cases we want to cover:
1) Content using the existing nonstandard "mousewheel" event. In this case, it is assumed that the event is for a vertical scroll only, and apparently content depends on the delta not being 0.
2) Content that wants to handle both vertical and horizontal scroll at once, to avoid "stairstepping". This requires a single event that has access to both scroll deltas and fires when either one is non-zero.
Here is a use case that seems sort of useful but was not seen by the WG as compelling enough to introduce extra design complexity:
3) Cancel the horizontal scroll only, but not the vertical scroll.
Here is a proposed design to handle this.
When mouse wheeling occurs, the implementation dispatches a "mousemultiwheel" event. This event includes both scroll deltas. See stawman proposal for IDL interface below. The default action of the "mousemultiwheel" event is to dispatch a "mousewheel" event if the y delta is non-zero, and then scroll. However, if the "mousewheel" event is cancelled, only the horizontal part of the scrolling is done. This can reasonably address both use cases. Here's an ASCII art diagram of the flow:
[ "mousemultiwheel" ] --------------> [ "mousewheel" ] =====> default scroll
default action
This addresses use cases 1 and 2. It does not address use case 3. Use case 3 could be addressed in one of two ways, either add a "mousewheelx" event which is dispatched for non-zero x delta only, or to make wheelDeltaX and wheelDeltaY read-write instead of read-only, with the actual scroll that occurs using the modified value. The WG members present decided not to add either of these complexities.
Proposed IDL interface for WheelEvent:
interface WheelEvent : UIEvent {
readonly attribute long screenX;
readonly attribute long screenY;
readonly attribute long clientX;
readonly attribute long clientY;
readonly attribute boolean ctrlKey;
readonly attribute boolean shiftKey;
readonly attribute boolean altKey;
readonly attribute boolean metaKey;
readonly attribute long wheelDelta;
void initWheelEvent(in DOMString typeArg,
in boolean canBubbleArg,
in boolean cancelableArg,
in views::AbstractView viewArg,
in long detailArg,
in long screenXArg,
in long screenYArg,
in long clientXArg,
in long clientYArg,
in boolean ctrlKeyArg,
in boolean altKeyArg,
in boolean shiftKeyArg,
in boolean metaKeyArg,
in long wheelDelta
);
// Introduced in DOM Level 3:
boolean getModifierState(in DOMString keyIdentifierArg);
// Introduced in DOM Level 3:
void initMouseEventNS(in DOMString namespaceURI,
in DOMString typeArg,
in boolean canBubbleArg,
in boolean cancelableArg,
in views::AbstractView viewArg,
in long detailArg,
in long screenXArg,
in long screenYArg,
in long clientXArg,
in long clientYArg,
in DOMString modifiersList,
in long wheelDelta);
};
Proposed IDL interface for MultiWheelEvent (or should it have an array or something to support a general number of wheels?):
interface MultiWheelEvent : UIEvent {
readonly attribute long screenX;
readonly attribute long screenY;
readonly attribute long clientX;
readonly attribute long clientY;
readonly attribute boolean ctrlKey;
readonly attribute boolean shiftKey;
readonly attribute boolean altKey;
readonly attribute boolean metaKey;
readonly attribute long wheelDeltaX;
readonly attribute long wheelDeltaY;
readonly attribute long wheelDeltaZ;
void initWheelEvent(in DOMString typeArg,
in boolean canBubbleArg,
in boolean cancelableArg,
in views::AbstractView viewArg,
in long detailArg,
in long screenXArg,
in long screenYArg,
in long clientXArg,
in long clientYArg,
in boolean ctrlKeyArg,
in boolean altKeyArg,
in boolean shiftKeyArg,
in boolean metaKeyArg,
in long wheelDeltaX,
in long wheelDeltaY,
in long wheelDeltaZ
);
// Introduced in DOM Level 3:
boolean getModifierState(in DOMString keyIdentifierArg);
// Introduced in DOM Level 3:
void initMouseEventNS(in DOMString namespaceURI,
in DOMString typeArg,
in boolean canBubbleArg,
in boolean cancelableArg,
in views::AbstractView viewArg,
in long detailArg,
in long screenXArg,
in long screenYArg,
in long clientXArg,
in long clientYArg,
in DOMString modifiersList,
in long wheelDeltaX,
in long wheelDeltaY,
in long wheelDeltaZ);
};