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

Don't allow setting various properties, such as currentPageNumber/currentScale/currentScaleValue/pagesRotation, before {PDFViewer, PDFThumbnailViewer}.setDocument has been called #8555

Merged
merged 1 commit into from
Jul 6, 2017

Conversation

Snuffleupagus
Copy link
Collaborator

Currently a number of these properties do not work correctly if set before calling setDocument; please refer to the discussion starting in #8539 (comment).

Rather than trying to have some of these methods working, but not others, it seems much more consistent to simply always require that setDocument has been called.

/cc @timvandermeij Since your comment in #8539 (comment) seems to support doing this.
/cc @yurydelendik I know that #8539 (comment) is a long read, but can you please check that you're OK with that reasoning and this PR?

…currentScale`/`currentScaleValue`/`pagesRotation`, before `{PDFViewer, PDFThumbnailViewer}.setDocument` has been called

Currently a number of these properties do not work correctly if set *before* calling `setDocument`; please refer to the discussion starting in #8539 (comment).

Rather than trying to have *some* of these methods working, but not others, it seems much more consistent to simply always require that `setDocument` has been called.
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/2b973b4b4230022/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/2b973b4b4230022/output.txt

Total script time: 2.31 mins

Published

Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

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

Nice work! I think this makes the code much more consistent and predictable (avoiding subtle bugs). Feel free to merge this if @yurydelendik approves the patch too.

@Snuffleupagus
Copy link
Collaborator Author

Snuffleupagus commented Jul 4, 2017

This PR contains a proper fix for the underlying issues uncovered by #8539, please refer to #8539 (comment) for all the gory details.
@yurydelendik Since you originally added this code, back when the viewer was split into components, I just wanted to make sure you're on-board with this change before we land the PR.

@Snuffleupagus Snuffleupagus merged commit 12f1b74 into mozilla:master Jul 6, 2017
@Snuffleupagus Snuffleupagus deleted the viewer-components-pdfDocument-checks branch July 6, 2017 04:31
movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
…pdfDocument-checks

Don't allow setting various properties, such as `currentPageNumber`/`currentScale`/`currentScaleValue`/`pagesRotation`, before `{PDFViewer, PDFThumbnailViewer}.setDocument` has been called
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants