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

[DOM3 Events] Type of deltaX, deltaY and deltaZ of WheelEvent should be float

From: Masayuki Nakano <masayuki@d-toybox.com>
Date: Wed, 02 Feb 2011 14:06:19 +0900
Message-ID: <4D48E64B.7010908@d-toybox.com>
To: "www-dom@w3.org" <www-dom@w3.org>
CC: Olli Pettay <opettay@mozilla.com>
Hello.

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

Current WheelEvent spec defines the type of deltaX, deltaY and detaZ as 
long. But I think they should be float.

On Windows, native mouse wheel event comes with delta value which means 
120 is one unit. The system settings of Windows specify how many lines 
or one page should be scrolled by 120. On Vista and later, the delta 
value of each native event may be less than 120. Therefore, it may mean 
non-integer lines or pages. E.g., 60 with one page scroll means half of 
a page. 30 with 1 line scroll means 0.333333... line scroll.

If we round up the delta value to integer, the scroll will be faster 
than other applications. On the other hand, if we round down the delta 
value, the scroll will be slower or stop (if delta < 1px).

-- 
Masayuki Nakano <masayuki@d-toybox.com>
Manager, Internationalization, Mozilla Japan.
Received on Wednesday, 2 February 2011 06:42:51 GMT

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