[webkit-dev] Mouse wheel event precision
Andy Estes
aestes at apple.com
Tue Jun 8 19:50:39 PDT 2010
Hi Nathan,
It is true that Safari now emits mousewheel events in increments of 120 for compatibility reasons. However, there is no loss of granularity in the sense that events are generated on fractional wheel ticks and are accelerated on platforms that support it. The only difference is that you will see increments of 120 rather than increments of 1. It's been a few months since I've checked (and I can't look at the URL you attached on my phone), but I believe you'll see the same behavior in Chrome and IE.
I would also point out that in DOM Level 3 Events, mousewheel events are considered deprecated and the unit of wheelDelta is left up to the implementor. IE set this increment to 120 some time ago, and we chose to match this behavior to be compatible with sites that expect it. As you can imagine, the opposite problem occurs on those sites (extremely slow scrolling). Unfortunately any decision we made here was bound to break some sites.
-Andy
Sent from my iPhone
On Jun 8, 2010, at 19:09, Nathan Vander Wilt <nate-lists at calftrail.com> wrote:
> In Safari 4, the following event handler would log nice smooth values when scrolling:
> // logs: -3, -9, -6, -48, ...
> document.addEventListener("mousewheel", function(e) { console.log(e.wheelDeltaY); });
>
> In Safari 5, the mousewheel events have lost all precision, and are now big ugly integral multiples of 120:
> // logs: -120, -240, -120, -480, ... (no correspondence with above values, of course)
> document.addEventListener("mousewheel", function(e) { console.log(e.wheelDeltaY); });
>
> This is a serious loss of precision, and brings us back to the primitive days when a mouse a had 1-axis clicky scroll wheel if it had one at all, and Firefox was the top browser. Compare the smooth, precise scroll zooming of http://calftrail.com/Share/multitouch/ in Safari 4 to the jerky, way-too-fast zooming in Safari 5.
>
> Is this a regression introduced directly in recent WebKit builds, or is it Safari-specific? If the former, was it really necessary and can it please be rolled back?
>
> thanks,
> -natevw
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
More information about the webkit-dev
mailing list