Skip to content

Unblock the "load" event in inactive windows/tabs (bug 1746213, PR 11646 follow-up) #14388

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 2 commits into from
Dec 21, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

Please refer to the individual commit messages for additional details.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1746213

…646 follow-up)

Given that `requestAnimationFrame` is being used, see the `src/diplay/api.js` file, an inactive window/tab means that rendering will not run and we'll thus not fetch all pages. The latter is a requirement for the "load" event to be unblocked, in the MOZCENTRAL-version of, the default viewer.

This patch is a *partial* solution, since it only addresses the following situations:
 - A *background*  tab (containing the viewer) is reloaded, e.g. via the tab-bar context menu.
 - The viewer is loaded in a active tab, but the user switches away from it (or switches to another program window) *before* rendering has started.
…746213)

*This addresses the following case missing from the previous patch:*
The viewer is loaded in an *active* window/tab, and enough time is allowed to pass in order to allow rendering to start. However, if the user then switches to another tab (or another program) *before* rendering has finished, the "load" event also needs to be unblocked.
@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/b15c3e34c3ab59f/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/b15c3e34c3ab59f/output.txt

Total script time: 4.39 mins

Published

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch looks good and I tested successfully it in Firefox (Windows 10).
Thank you.

@Snuffleupagus Snuffleupagus merged commit 41dab8e into mozilla:master Dec 21, 2021
@Snuffleupagus Snuffleupagus deleted the bug-1746213 branch December 21, 2021 09:36
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