[webkit-dev] Mouse wheel event precision
Peter Kasting
pkasting at google.com
Tue Jun 8 22:34:06 PDT 2010
On Tue, Jun 8, 2010 at 8:34 PM, Nathan Vander Wilt <nate-lists at calftrail.com
> wrote:
> What Safari 5's WebKit does is turn one "line" into 4800 (!) units instead
> of 40. For Safari 5 the code above needs to read as follows to work the
> same. You can see it isn't really "more compatible" at all:
>
> var delta; // one scroll wheel "click" (corresponds to zoom
> level zoom level)
> if (isSafari5) {
> delta = e.wheelDelta / 120 / 120;
> } else if (e.wheelDelta) {
> delta = e.wheelDelta/120;
> if (window.opera && window.opera.version() < 9.2) {
> delta = -delta;
> }
> } else if (e.detail) {
> delta = -e.detail / 3;
> }
If you write a simple test page that demonstrates wheel events being handled
very differently by IE vs. Safari, please file a bug at bugs.webkit.org.
The goal of the current behavior is compatibility with IE.
PK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100608/e9b247e5/attachment.html>
More information about the webkit-dev
mailing list