-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Improve pre-rendering at the start/end of the document #14158
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
Improve pre-rendering at the start/end of the document #14158
Conversation
6f90564
to
fab7bc5
Compare
This is a very old "issue", which has existed since essentially forever, and it affects all of the available scrollModes. However, in the recently added Page-mode it's particularily noticeable since we use a *simulated* scroll direction there. When deciding what page(s) to pre-render, we only consider the current scroll direction. This works well in most cases, but can break down at the start/end of the document by trying to pre-render a page *outside* of the existing ones. To improve this, we'll thus *force* the scroll direction at the start/end of the document. *Steps to reproduce:* 0. Open the viewer, e.g. https://mozilla.github.io/pdf.js/web/viewer.html 1. Enable vertical scrolling. 2. Press the <kbd>End</kbd> key. 3. Open the devtools and, using the DOM Inspector, notice how page 13 is *not* being pre-rendered.
…les" (PR 14131 follow-up) This was a stupid oversight on my part, since the first/last visible pages have obviously already been rendered at the point when we're checking for any potential "holes" in the page layout. While this will obviously not have any measurable effect on performance, we should nonetheless avoid doing completely unnecessary checks here.
fab7bc5
to
91692a2
Compare
…Queue.renderHighestPriority`
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/f0f99c93287349b/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/30aeb28440053bb/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/f0f99c93287349b/output.txt Total script time: 3.83 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/30aeb28440053bb/output.txt Total script time: 6.60 mins
|
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/44b984850ecde12/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/44b984850ecde12/output.txt Total script time: 4.65 mins Published |
Thanks! |
This is a very old "issue", which has existed since essentially forever, and it affects all of the available scrollModes. However, in the recently added Page-mode it's particularily noticeable since we use a simulated scroll direction there.
When deciding what page(s) to pre-render, we only consider the current scroll direction. This works well in most cases, but can break down at the start/end of the document by trying to pre-render a page outside of the existing ones. To improve this, we'll thus force the scroll direction at the start/end of the document.
Steps to reproduce: