mozilla/pdf.js — pull request #1831 by brendandahl (2012-06-18 17:45:08+00:00)
Title: Change to priority/pausible rendering.

Renders pages based on priority instead of putting them in a queue to be drawn. This also adds support for pausing the rendering when we break during heavy gfx queue execution. The priority is now:

1) visible pages
2) page below if scrolled down(vice versa when scrolled up)
3) thumbnails (same logic as above)

From this it became much more noticeable our visible page logic could get slightly off on long documents, so I refactored it to use the dom sizes instead. This code is now shared between getVisibleThumbns and getVisblePages.

To really see the effects of this take your favorite long pdf(intellisa?) scroll down quickly several pages and compare how long the page takes to render compared to the previous version.