philc/vimium — pull request #1229 by smblott-github (2014-11-07 11:38:18+00:00)
Title: Smooth scrolling

I love smooth scrolling.

Comments:

- Inserts a smooth-scrolling shim between the two main scroll functions (`scrollTo` and `scrollBy`) and the existing low-level scroller (`ensureScrollChange`).

- Maintains the existing scrolling behaviour when the scroll reaches the end of the activated element, and on subsequent scrolls.

- Smooth scrolling is only used for scroll commands (so, *not* for mark and find).

- Scrolling is a new option. Currently, it defaults to *disabled*. Personally, I think there's a pretty good case for it defaulting to *enabled*. It would make the change more visible. There may even be a case for smooth scrolling being the *only* way in which vimium scrolls.

- There's a small glitch if you scroll before the page has fully loaded. This glitch has been there for some time, it's just more apparent with smooth scrolling. Go to some web page that takes some time to load (I was using [this page](http://www.bbc.com/news/uk/) for testing). Go right to the top of the page with `gg`. Reload the page and - as early as you can - scroll down (`j`). The page does a bit of a shimy. What's happening is that either chrome or vimium (`setScrollPosition`) is deciding what *it* wants the scroll position to be *after* we've started scrolling. This can be fixed, but could require a disproportionate amount of extra logic in `ensureScrollChange`, so I've left it as is for the moment.

Fixes #506.
Fixes #1155.