This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Background: We are planning to make all Events constructible. For example, CustomEvent already has the spec for its constructor (http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-customevent). We propose a spec for WheelEvent constructor as follows: [Constructor(DOMString type, optional WheelEventInit eventInitDict)] dictionary WheelEventInit : MouseEventInit { float deltaX; float deltaY; float deltaZ; unsigned long deltaMode; }
Correction: [Constructor(DOMString type, optional WheelEventInit eventInitDict)] interface WheelEvent : MouseEvent { ... } dictionary WheelEventInit : MouseEventInit { float deltaX; float deltaY; float deltaZ; unsigned long deltaMode; }
Assigning to myself to take action on these open bugs.
Assigned to me; pri 3 (excluding the tracking bug), and sev: enhancement
(Resolving dependent bugs based on 14051.)
Now WheelEvent constructor is on the editor's draft (Thanks for the specing!): https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm#constructor-wheelevent I have a question about a 'deltaMode' attribute. The spec says: > Initializes the deltaMode attribute on the WheelEvent object to the enumerated values 0, 1, or 2, which represent the amount of pixels scrolled (DOM_DELTA_PIXEL), lines scrolled (DOM_DELTA_LINE), or pages scrolled (DOM_DELTA_PAGE) if the rotation of the wheel would have resulted in scrolling. What should happen when 123 is passed to deltaMode in a constructor, like this? new WheelEvent("type", {deltaMode: 123}); Should we set 123 to deltaMode, or should we just ignore such an invalid value? The type of 'deltaMode' is speced as 'unsigned long'. As far as I read the WebIDL spec for 'unsigned long' attributes getters/setters, it seems reasonable to set 123 to deltaMode. Is my understanding correct?
It should just set to the given value within the constraints of IDL. We don't want to specialcase specific events.
(In reply to comment #6) > It should just set to the given value within the constraints of IDL. We > don't want to specialcase specific events. Agreed. If the web developer want to do this for some reason (say they are extending the semantic meaning of the property for their own purposes), we should not artificially limit it. Additionally, if we add future constant values (unlikely), then we don't want older user agents to fail on the new constant values (forward-compatibility principle).
Anne, Travis: Thanks for the clarification! That makes sense to me.