Skip to content

Ensure that pre-rendering works correctly with spreadModes at higher zoom levels #14131

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

Merged
merged 1 commit into from
Oct 15, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

Having recently worked with this code, in PR #14096 (and indirectly in PR #14112), I happened to notice a pre-existing issue with spreadModes at higher zoom levels.
The PDFRenderingQueue code was written back when the viewer only supported "normal" vertical scrolling, and some edge-cases related to spreadModes are thus not perfectly supported. Depending on the zoom level, it's possible that there are "holes" in the currently visible page layout, and those pages will not be pre-rendered as you'd expect.

Steps to reproduce:

  1. Open the viewer, e.g. https://mozilla.github.io/pdf.js/web/viewer.html
  2. Enable vertical scrolling.
  3. Enable the ODD spreadMode.
  4. Scroll down, such that both pages 1 and 3 are visible.
  5. Zoom-in until only page 1 and 3 are visible.
  6. Open the devtools and, using the DOM Inspector, notice how page 2 is not being pre-rendered despite all surrounding pages being rendered.

data-loaded

…zoom levels

Having recently worked with this code, in PR 14096 (and indirectly in PR 14112), I happened to notice a pre-existing issue with spreadModes at higher zoom levels.
The `PDFRenderingQueue` code was written back when the viewer only supported "normal" vertical scrolling, and some edge-cases related to spreadModes are thus not perfectly supported. Depending on the zoom level, it's possible that there are "holes" in the currently visible page layout, and those pages will not be pre-rendered as you'd expect.

*Steps to reproduce:*

 0. Open the viewer, e.g. https://mozilla.github.io/pdf.js/web/viewer.html
 1. Enable vertical scrolling.
 2. Enable the ODD spreadMode.
 3. Scroll down, such that both pages 1 and 3 are visible.
 4. Zoom-in until *only* page 1 and 3 are visible.
 5. Open the devtools and, using the DOM Inspector, notice how page 2 is *not* being pre-rendered despite all surrounding pages being rendered.
@Snuffleupagus Snuffleupagus force-pushed the spreadMode-render-holes branch from 79b6892 to 08e2427 Compare October 14, 2021 09:21
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/55529726ce13584/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/55529726ce13584/output.txt

Total script time: 4.32 mins

Published

@timvandermeij timvandermeij merged commit ed3da19 into mozilla:master Oct 15, 2021
@timvandermeij
Copy link
Contributor

Seems to work just fine; thanks!

@Snuffleupagus Snuffleupagus deleted the spreadMode-render-holes branch October 15, 2021 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants