Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling of the text too fast in chrome #2

Closed
fjakobs opened this issue Oct 27, 2010 · 16 comments
Closed

Scrolling of the text too fast in chrome #2

fjakobs opened this issue Oct 27, 2010 · 16 comments
Assignees

Comments

@fjakobs
Copy link
Contributor

fjakobs commented Oct 27, 2010

The scrolling of the text feels way too fast in chrome. The code shows in the mouse wheel handler not browser normalization. Just take a look at the qooxdoo mouse wheel event of qooxdoo to see how we recently changed it:
http://qooxdoo.svn.sourceforge.net/viewvc/qooxdoo/trunk/qooxdoo/framework/source/class/qx/event/type/MouseWheel.js?revision=22904&view=markup

(by wittemann)
@Gissues:{"order":98.13664596273293,"status":"backlog"}

@leftshoe
Copy link

leftshoe commented Dec 2, 2010

I have also found it to be too fast, at least in the webkit based browsers I use.

@defunkt
Copy link
Contributor

defunkt commented Jul 10, 2011

Scrolling in Chrome now feels more normal, but Safari is still very fast. Was something done specifically to fix Chrome, and could that work for Safari as well?

@fjakobs
Copy link
Contributor Author

fjakobs commented Jul 11, 2011

I did not change the code but I guess they change the scroll speed in Chrome. Will see what a good scroll factor is for Safari.

https://github.com/ajaxorg/pilot/blob/master/lib/pilot/event.js#L174
https://github.com/ajaxorg/pilot/blob/master/lib/pilot/event.js#L183

@fjakobs
Copy link
Contributor Author

fjakobs commented Jul 23, 2011

the relevant qooxdoo code as reference

    getWheelDelta : qx.core.Variant.select("qx.client",
    {
      "default" : function() {
        return -(this._native.wheelDelta / 40);
      },

      "gecko" : function() {
        return this._native.detail;
      },

      "webkit" : function()
      {
        if (qx.bom.client.Browser.NAME == "chrome") {
          // mac has a much higher sppedup during scrolling
          if (qx.bom.client.Platform.MAC) {
            return -(this._native.wheelDelta / 1200);
          } else {
            return -(this._native.wheelDelta / 120);
          }


        } else {
          // windows safaris behave different than on OSX
          if (qx.bom.client.Platform.WIN) {
            var factor = 120;
            // safari 5.0 and not 5.0.1
            if (qx.bom.client.Engine.VERSION == 533.16) {
              factor = 1200;
            }
          } else {
            factor = 40;
            // Safari 5.0 or 5.0.1
            if (qx.bom.client.Engine.VERSION == 533.16 || qx.bom.client.Engine.VERSION == 533.17) {
              factor = 1200;
            }
          }
          return -(this._native.wheelDelta / factor);
        }
      }
    })

@ghost ghost assigned fjakobs Jul 23, 2011
@defunkt
Copy link
Contributor

defunkt commented Aug 13, 2011

Had a look at this today. Here's the value of e.wheelDeltaY while scrolling in Safari and Chrome.

Safari 5.0.5 (6533.21.1)

Chrome 13.0.782.112

Pretty big difference. Changing the 8 to 800 at https://github.com/ajaxorg/pilot/blob/master/lib/pilot/event.js#L175 makes Safari's scroll rate slow down to be in the ballpark of Chrome's.

Perhaps some sort of conditional is needed? Or is there a better way to handle things like this.

@fjakobs
Copy link
Contributor Author

fjakobs commented Aug 15, 2011

Interestingly it is fixed in Safari 5.1 (7534.48.3). I think your fix is fine since Safari 5 almost always reports numbers above 800 and no other browser ever reaches 800.

@defunkt
Copy link
Contributor

defunkt commented Aug 15, 2011

I noticed that the initial scroll can still be a bit too fast. I think this is due to e.wheelDeltaY sometimes being negative.

This seems to fix it:

if (Math.abs(e.wheelDeltaY) > max)
    max = Math.abs(e.wheelDeltaY)

@fjakobs
Copy link
Contributor Author

fjakobs commented Aug 17, 2011

I've just made exactly this change. Also I had to increase the threshold since Chrome could exceed the threshold and then scrolling became really slow.

https://github.com/ajaxorg/pilot/commit/b60e9954e67887a01abc12a56db1e11495ef961d

@defunkt
Copy link
Contributor

defunkt commented Aug 17, 2011

Sweet! Thanks.

@Ciantic
Copy link

Ciantic commented Oct 14, 2011

Now it's opposite, too slow.

Running Chrome 15.0.874.92 beta-m the scroll wheel step is now two lines at a time, it takes ages to scroll the document. When my Windows 7 native is around 8 lines, which works just fine elsewhere in Chrome.

Why is OS default scroll stepping even being tampered with?

@fjakobs
Copy link
Contributor Author

fjakobs commented Oct 17, 2011

We have to normalize the scroll speed and direction because some browsers (esp. some versions of Safari) report numbers which are an order of magnitude higher than normal. Take a look at the numbers above. However I think I tried to be too smart. I'll take a look into this again.

@fjakobs fjakobs reopened this Oct 17, 2011
@matthew-dean
Copy link

Scrolling is also epic fast in Titanium Desktop, which uses a webkit engine.

@matthew-dean
Copy link

Is there a temporary workaround to slow down scroll speed? Thanks.

@matthew-dean
Copy link

Also, note that scrolling grinds to a halt after a moment of scrolling in Adobe AIR. Mentioned in Issue #401.

@Ciantic
Copy link

Ciantic commented Jan 25, 2012

Thing I don't get it is why they even tamper the OS Wheel stepping setting? Can't they just leave it alone?

adamjimenez added a commit to adamjimenez/ace that referenced this issue Oct 9, 2012
Fix ajaxorg#654: double clicking php vars selects the $ sign 
nightwing added a commit that referenced this issue Oct 15, 2012
Fix double click php var selects the $ sign #2
@nightwing
Copy link
Member

There are multiple issues reported here without clear steps to reproduce and mostly for very old browsers. I think it's better to close this issue, so that when there are new issues related to scrolling, they can be reported in separate threads where it will be much easier to reproduce and fix.

@Ciantic they need to "tamper the OS Wheel" to make virtual viewport work, without which editor would be very slow.

nightwing pushed a commit that referenced this issue Nov 3, 2019
…g-oom-crash

fix oom crash when cdata tag unclosed
nightwing pushed a commit that referenced this issue Feb 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants