W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2012

[DOM3 Events] initMouseEvent() and initWheelEvent() don't take same arguments

From: Masayuki Nakano <masayuki@d-toybox.com>
Date: Thu, 01 Mar 2012 18:00:30 +0900
Message-ID: <4F4F3AAE.1050008@d-toybox.com>
To: "www-dom@w3.org" <www-dom@w3.org>
Hello, I realized a in D3E spec.

http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-mouseevents

>   void                              initMouseEvent(DOMString typeArg,
>                                                    boolean canBubbleArg,
>                                                    boolean cancelableArg,
>                                                    AbstractView viewArg,
>                                                    long detailArg,
>                                                    long screenXArg,
>                                                    long screenYArg,
>                                                    long clientXArg,
>                                                    long clientYArg,
>                                                    boolean ctrlKeyArg,
>                                                    boolean altKeyArg,
>                                                    boolean shiftKeyArg,
>                                                    boolean metaKeyArg,
>                                                    unsigned short buttonArg,										
>                                                    EventTarget relatedTargetArg);

http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent

>   void                             initWheelEvent(DOMString typeArg,
>                                                   boolean canBubbleArg,
>                                                   boolean cancelableArg,
>                                                   AbstractView viewArg,
>                                                   long detailArg,
>                                                   long screenXArg,
>                                                   long screenYArg,
>                                                   long clientXArg,
>                                                   long clientYArg,
>                                                   unsigned short buttonArg,
>                                                   EventTarget relatedTargetArg,
>                                                   DOMString modifiersListArg,
>                                                   float deltaXArg,
>                                                   float deltaYArg,
>                                                   float deltaZArg,
>                                                   unsigned long deltaMode);

initMouseEvent() takes bool ctrlKeyArg, altKeyArg, shiftKeyArg and 
metaKeyArg.  However, initWheelEvent() takes DOMString modifiersListArg.

For consistency with KeyboardEvent and compatibility with IE, 
initMouseEvent() should take DOMString modifiersListArg. If not so, Web 
developers cannot initialize the other key states such as CapsLock, 
NumLock or Win key.

Additionally, document for initWheelEvent() refers initMouseEvent()'s 
modifiersListArg document.
http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-event-type-initWheelEvent

I think that initMouseEvent() should be:

>   void                              initMouseEvent(DOMString typeArg,
>                                                    boolean canBubbleArg,
>                                                    boolean cancelableArg,
>                                                    AbstractView viewArg,
>                                                    long detailArg,
>                                                    long screenXArg,
>                                                    long screenYArg,
>                                                    long clientXArg,
>                                                    long clientYArg,
>                                                    unsigned short buttonArg,
>                                                    EventTarget relatedTargetArg,
>                                                    DOMString modifiersListArg); ;

-- 
Masayuki Nakano <masayuki@d-toybox.com>
Manager, Internationalization, Mozilla Japan.
Received on Thursday, 1 March 2012 09:01:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:09 GMT