Skip to content
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

Remove the BaseViewer._getCurrentVisiblePage helper method #14750

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

  • Remove the BaseViewer._getCurrentVisiblePage helper method

    This method was originally added specifically to work-around bugs/issues related to PresentationMode in Google Chrome. Note that prior to PR Add a new Page scrolling mode (issue 2638, 8952, 10907) #14112 we were using some CSS hacks to only show the current page in PresentationMode, and that could lead to the getVisibleElements function not always finding the correct elements.
    However, after the changes in PR Add a new Page scrolling mode (issue 2638, 8952, 10907) #14112 we're now using the Page-scrolling mode in PresentationMode and consequently there'll only be a single page visible at a time. Hence then BaseViewer._getCurrentVisiblePage helper method should no longer be needed, and when testing (locally) in Google Chrome everything seems to work correctly now.

  • Tweak the pdfOpenParams parameter, in the "updateviewarea" event, in PresentationMode

    The pdfOpenParams parameter has never really made sense in PresentationMode, since e.g. the zoom-value doesn't (generally) agree with the value chosen by the user prior to entering PresentationMode.
    This has never mattered all that much, since the viewBookmark-button isn't visible in PresentationMode (nor is any other toolbar button for that matter). However, in the PDFHistory-implementation we're currently forced to handle this case specifically since we don't want to populate the browser history with nonsensical state.
    Hence it makes overall sense, as far as I'm concerned, to tweak the "updateviewarea" event to include a simplified pdfOpenParams parameter when PresentationMode is active. Given that the viewer components don't include PresentationMode functionality, this change thus shouldn't matter for third-party users.

This method was originally added specifically to work-around bugs/issues related to PresentationMode in Google Chrome. Note that prior to PR 14112 we were using some CSS hacks to only show the current page in PresentationMode, and that could lead to the `getVisibleElements` function not always finding the correct elements.
However, after the changes in PR 14112 we're now using the Page-scrolling mode in PresentationMode and consequently there'll only be *a single* page visible at a time. Hence then `BaseViewer._getCurrentVisiblePage` helper method should no longer be needed, and when testing (locally) in Google Chrome everything seems to work correctly now.
…n PresentationMode

The `pdfOpenParams` parameter has never really made sense in PresentationMode, since e.g. the zoom-value doesn't (generally) agree with the value chosen by the user prior to entering PresentationMode.
This has never mattered all that much, since the `viewBookmark`-button isn't visible in PresentationMode (nor is any other toolbar button for that matter). However, in the `PDFHistory`-implementation we're currently forced to handle this case specifically since we don't want to populate the browser history with nonsensical state.
Hence it makes overall sense, as far as I'm concerned, to tweak the "updateviewarea" event to include a *simplified* `pdfOpenParams` parameter when PresentationMode is active. Given that the `viewer components` don't include PresentationMode functionality, this change thus shouldn't matter for third-party users.
@Snuffleupagus
Copy link
Collaborator Author

/botio integrationtest

@pdfjsbot
Copy link

pdfjsbot commented Apr 5, 2022

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/4422c2a1ab9e1bc/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 5, 2022

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/ff83522938d5c48/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 5, 2022

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/4422c2a1ab9e1bc/output.txt

Total script time: 4.01 mins

  • Integration Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Apr 5, 2022

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/ff83522938d5c48/output.txt

Total script time: 6.96 mins

  • Integration Tests: FAILED

@timvandermeij timvandermeij merged commit 2b673a6 into mozilla:master Apr 8, 2022
@timvandermeij
Copy link
Contributor

Makes sense; nice work!

@Snuffleupagus Snuffleupagus deleted the rm-_getCurrentVisiblePage branch April 8, 2022 18:31
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.

None yet

3 participants