-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Only display the loadingIcons when rendering is currently running #15867
Only display the loadingIcons when rendering is currently running #15867
Conversation
/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/3957e1ae9ca5a38/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/3957e1ae9ca5a38/output.txt Total script time: 1.25 mins Published |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
The code in pdf_page_view is a way more simple like this.
Given that we only render one page at a time, this will lead to only *one* page-loadingIcon being displayed at a time even if multiple pages are visible in the viewer. However, this will make it clearer which page is the currently parsing/rendering one. To simplify toggling of the page-loadingIcon visibility, the existing `PDFPageView.renderingState` is changed into a getter/setter-pair with the latter also handling the page-loadingIcon state. An additional benefit of these changes is that the `PDFViewer` no longer needs to handling toggling of page-loadingIcon visibility during rendering, since there can only ever be *one* page rendering. Finally, this may also simplify future changes w.r.t. page-loadingIcon visibility toggling (using e.g. a show-timeout).
…unning *This makes the same kind of changes as in the previous patch, but for the pageNumber-loadingIcon in the main toolbar.* To display the pageNumber-loadingIcon when rendering starts, if the page is the most visible one, we'll utilize the existing "pagerender" event. To toggle the pageNumber-loadingIcon as the user moves through the document we'll now instead utilize the "pagechanging" event, which should actually be slightly more efficient overall[1]. Note how we'd, in the old code, only consider the most visible page anyway when toggling the pageNumber-loadingIcon. --- [1] Even in a PDF document as relatively short/simple as `tracemonkey.pdf`, scrolling through the entire document can easily trigger the "updateviewarea" event more than a thousand times.
bca550e
to
4224984
Compare
/botio integrationtest |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 1 Live output at: http://54.193.163.58:8877/538fc1fb03eca90/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/86928786123bf89/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/86928786123bf89/output.txt Total script time: 4.21 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/538fc1fb03eca90/output.txt Total script time: 11.07 mins
|
Only display the page-loadingIcon when rendering is currently running
Given that we only render one page at a time, this will lead to only one page-loadingIcon being displayed at a time even if multiple pages are visible in the viewer. However, this will make it clearer which page is the currently parsing/rendering one.
To simplify toggling of the page-loadingIcon visibility, the existing
PDFPageView.renderingState
is changed into a getter/setter-pair with the latter also handling the page-loadingIcon state.An additional benefit of these changes is that the
PDFViewer
no longer needs to handling toggling of page-loadingIcon visibility during rendering, since there can only ever be one page rendering.Finally, this may also simplify future changes w.r.t. page-loadingIcon visibility toggling (using e.g. a show-timeout).
Only display the pageNumber-loadingIcon when rendering is currently running
This makes the same kind of changes as in the previous patch, but for the pageNumber-loadingIcon in the main toolbar.
To display the pageNumber-loadingIcon when rendering starts, if the page is the most visible one, we'll utilize the existing "pagerender" event.
To toggle the pageNumber-loadingIcon as the user moves through the document we'll now instead utilize the "pagechanging" event, which should actually be slightly more efficient overall[1]. Note how we'd, in the old code, only consider the most visible page anyway when toggling the pageNumber-loadingIcon.
[1] Even in a PDF document as relatively short/simple as
tracemonkey.pdf
, scrolling through the entire document can easily trigger the "updateviewarea" event more than a thousand times.