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

Attempt to display the File size quicker in the Document Properties dialog #5169

Merged
merged 1 commit into from
Aug 11, 2014
Merged

Attempt to display the File size quicker in the Document Properties dialog #5169

merged 1 commit into from
Aug 11, 2014

Conversation

Snuffleupagus
Copy link
Collaborator

Currently the File size field in the Document Properties dialog isn't set until PDFView.pdfDocument.getDownloadInfo() is resolved. If the Document Properties dialog is opened while a PDF file is loading with range requests, this leads to the less desirable situation where all fields except File size are available.

In cases where PDFView.open() is called with the args parameter defined, and args contains the property length, we actually know the File size when the PDF file begins to load. (This is usually the case when ranged loading is used in the Firefox addon/built-in version.)
Hence we can use args.length to set the File size immediately when PDFView.open() is called, resulting in a better user experience.

…ialog

Currently the File size field in the Document Properties dialog isn't set until `PDFView.pdfDocument.getDownloadInfo()` is resolved. If the Document Properties dialog is opened while a PDF file is loading with range requests, this leads to the less desirable situation where all fields *except* File size are available.

In cases where `PDFView.open()` is called with the `args` parameter defined, and `args` contains the property `length`, we actually know the File size when the PDF file begins to load. (This is usually the case when ranged loading is used in the Firefox addon/built-in version.)
Hence we can use `args.length` to set the File size immediately when `PDFView.open()` is called, resulting in a better user experience.
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/955ef12d733dedb/output.txt

timvandermeij added a commit that referenced this pull request Aug 11, 2014
…-fileSize

Attempt to display the File size quicker in the Document Properties dialog
@timvandermeij timvandermeij merged commit f1c73c2 into mozilla:master Aug 11, 2014
@timvandermeij
Copy link
Contributor

Confirmed with the generated extension. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants