1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 07:08:08 +02:00
pdf.js/web
Jonas Jenwald 59548921d1 For documents with different page sizes, ensure that the correct page becomes visible on load when e.g. the 'page' hash parameter was provided (bug 1191279, issue 6393)
This issue is actually, in a sense, "caused" by the fact that the API/viewer supports partial loading/rendering. Previously when the *entire* document was always fetched before rendering begun, we knew all page sizes in advance and this issue didn't exist.

Now we use the size of *one* page in order to set the initial size of every page, until we've fetched the pages and thus know their correct sizes.
This means that during loading the size of the pages can change, which may cause the initial position to become scrolled out of view.

The most naive solution to this problem would perhaps be to delay setting the initial position on load for all documents, until all pages are fetched. However I think that would be a *really* bad idea, since doing so would make the initial rendering slower and make it feel sluggish for most documents.

Since there is generally no way of knowing if a document has different sized pages prior to loading it, we can only check once the pages are available.
Hence this patch, which treats documents with different sized pages as a special case, by re-applying the initial position when all pages have become available.
2015-09-06 12:09:22 +02:00
..
images Switch expanded/collapsed in the names of the treeitem-* assets 2015-08-27 23:21:34 +02:00
.gitignore Remove obselete file from .gitignore 2015-01-26 16:44:45 +01:00
annotations_layer_builder.css Keep the Link annotation's data URL on one line 2015-07-30 17:18:42 +02:00
annotations_layer_builder.js Simplify the SimpleLinkService and use it to pass in a linkService instance in DefaultAnnotationsLayerFactory 2015-07-06 16:34:55 +02:00
chrome-i18n-allow-access-to-file-urls.json Add translations of "Allow access to file URLs" 2015-08-14 18:59:55 +02:00
chromecom.js Restore extension tab after reload 2015-08-14 19:00:12 +02:00
compatibility.js Merge pull request #5598 from CodingFabian/chrome39-range-disable 2015-04-30 22:31:50 +02:00
compressed.tracemonkey-pldi-09.pdf Add Makefile. Move some files around to make building the website easier. 2011-07-05 10:53:57 -07:00
debugger.js Fix regression that prevents downloading of font files in the debugger 2014-10-28 19:56:55 +01:00
default_preferences.js Removes B2G preprocessing directives. 2015-06-30 16:53:32 -05:00
download_manager.js Fixes DownloadManager for IE10 and above 2014-04-28 22:43:05 +02:00
firefoxcom.js cleaned whitespace 2015-02-17 11:07:37 -05:00
grab_to_pan.js Handtool: Remove focus from previous node on click 2014-09-03 16:31:47 +02:00
hand_tool.js Break dependencies between PresentationMode and other code, and add PresentationMode related utility methods to PDFViewer 2015-04-21 16:02:32 +02:00
interfaces.js Refactors PDFHistory. 2015-05-16 11:20:36 -05:00
mozPrintCallback_polyfill.js Check availability of canvas & PDF before printing 2015-06-05 23:55:08 +02:00
overlay_manager.js [OverlayManager] Add preventDefault to the keydown event handler 2014-05-27 23:48:02 +02:00
password_prompt.js Convert the existing overlays to use the OverlayManager 2014-05-25 21:33:15 +02:00
pdf_attachment_view.js Add custom |outlineloaded| and |attachmentsloaded| events to the viewer (bug 1112947) 2015-03-21 17:49:34 +01:00
pdf_document_properties.js Simplify document properties field logic 2015-04-27 15:25:40 +02:00
pdf_find_bar.js cleaned whitespace 2015-02-17 11:07:37 -05:00
pdf_find_controller.js Merge pull request #5769 from dumyan/findcontroller-nbsp 2015-02-28 14:50:25 +01:00
pdf_history.js [CRX] Add Referer request header if needed 2015-06-05 23:24:40 +02:00
pdf_link_service.js Move handling of the 'pagemode' hash parameter into viewer.js to restore the functionality 2015-08-07 12:05:17 +02:00
pdf_outline_view.js Allow outline to be collapsed / shown via icon. 2015-08-22 18:49:08 +02:00
pdf_page_view.js Merge pull request #5857 from Rob--W/print-page-size 2015-05-14 16:52:40 +02:00
pdf_presentation_mode.js Pass in a PDFViewer instance to PDFPresentationMode and use it to eliminate all references to PDFViewerApplication 2015-07-06 09:49:51 +02:00
pdf_rendering_queue.js Refactors draw method in PDFPageView; makes optional some PDFPageViewOptions options 2014-12-20 23:41:34 -06:00
pdf_thumbnail_view.js viewer: Support Retina/HiDPI thumbnails 2015-05-18 15:13:46 +01:00
pdf_thumbnail_viewer.js Update thumbnail style only when sidebar is visible 2015-01-27 21:08:36 +01:00
pdf_viewer.component.js Using pdfjs-dist as a library for b2g viewer. 2015-06-30 16:53:32 -05:00
pdf_viewer.css Move annotation related CSS rules from pdf_viewer.css to its own file 2015-07-06 16:37:33 +02:00
pdf_viewer.js Move handling of the 'custom' scale value from pdf_viewer.js to viewer.js 2015-07-19 20:02:47 +02:00
preferences.js Removes B2G preprocessing directives. 2015-06-30 16:53:32 -05:00
secondary_toolbar.js Simplify document properties field logic 2015-04-27 15:25:40 +02:00
text_layer_builder.css Replaces text selection example 2014-12-20 23:41:34 -06:00
text_layer_builder.js Optimize text layer: Avoid unneeded .textContent 2015-07-25 10:55:00 +02:00
ui_utils.js Using pdfjs-dist as a library for b2g viewer. 2015-06-30 16:53:32 -05:00
view_history.js Removes B2G preprocessing directives. 2015-06-30 16:53:32 -05:00
viewer-snippet-chrome-extension.html Remove type="text/javascript" from script tags. 2014-05-13 02:41:01 +02:00
viewer-snippet-chrome-overlays.html Add translations of "Allow access to file URLs" 2015-08-14 18:59:55 +02:00
viewer-snippet-firefox-extension.html Remove type="text/javascript" from script tags. 2014-05-13 02:41:01 +02:00
viewer-snippet-minified.html Remove type="text/javascript" from script tags. 2014-05-13 02:41:01 +02:00
viewer-snippet-mozPrintCallback-polyfill.html Revert PR 5510, except in WebKit browsers, for breaking print preview in Firefox 2015-03-07 00:16:55 +01:00
viewer-snippet.html Remove type="text/javascript" from script tags. 2014-05-13 02:41:01 +02:00
viewer.css Switch expanded/collapsed in the names of the treeitem-* assets 2015-08-27 23:21:34 +02:00
viewer.html Teach users how to enable access to local files. 2015-08-14 18:59:30 +02:00
viewer.js For documents with different page sizes, ensure that the correct page becomes visible on load when e.g. the 'page' hash parameter was provided (bug 1191279, issue 6393) 2015-09-06 12:09:22 +02:00