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

Fix exception when rotate page without a document #6445

Merged
merged 1 commit into from
Oct 30, 2015

Conversation

xlc
Copy link
Contributor

@xlc xlc commented Sep 13, 2015

Fixes #6438

This also fixes the exception when click Rotate Clockwise/Counterclockwise buttons in the menu.

There is still exception thrown after 30s
Uncaught TypeError: Cannot read property 'cleanup' of null
and it is tracked by #6440

@timvandermeij
Copy link
Contributor

This patch seems reasonable to me. The only thing that may be a problem is that scrollPageIntoView is called a lot of times when scrolling as far as I know, so I'm not sure if this check would have any performance impact. What do others think?

@yurydelendik
Copy link
Contributor

Thank you for the patch.

... if this check would have any performance impact.

The impact will be negligible -- it is called a lot, however it's not in a tight/hot loop.

yurydelendik added a commit that referenced this pull request Oct 30, 2015
Fix exception when rotate page without a document
@yurydelendik yurydelendik merged commit 15b00ea into mozilla:master Oct 30, 2015
@Snuffleupagus
Copy link
Collaborator

The only thing that may be a problem is that scrollPageIntoView is called a lot of times when scrolling as far as I know,

@timvandermeij I wonder if you're perhaps thinking of the PDFViewer_scrollUpdate method, which is called whenever scrolling occurs, through the watchScroll function.

scrollPageIntoView, on the other hand, should only be called when the page changes, e.g through the user: clicking on the previous/next buttons in the UI, using the keyboard to change page (P, N, ...), or when clicking on an internal link.
Hence I wouldn't expect scrollPageIntoView to be a particularly hot method, quite the opposite :-)

@timvandermeij
Copy link
Contributor

You are right, I was confused here. Thanks for the clarification!

@xlc xlc deleted the fix-pages-rotation branch November 1, 2015 21:15
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.

Uncaught TypeError: Cannot read property 'div' of undefined
4 participants