-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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 a redundant PDFViewer.currentScale
call from PDFViewerApplication.load
#8539
Remove a redundant PDFViewer.currentScale
call from PDFViewerApplication.load
#8539
Conversation
…cation.load` Since this call occurs *before* the `PDFViewer.setDocument` call, it won't actually cause any scale change. Furthermore, moving it should not be necessary, since the `scale` is already used as the fallback case in `PDFViewerApplication.setInitialView` (provided it's non-zero, which isn't even the case in the default viewer). Hence this patch should cause no functional changes at all, since it simply removes a piece of unnecessary code.
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/dff2c7c9ea53a9b/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/dff2c7c9ea53a9b/output.txt Total script time: 2.18 mins Published |
Nice find! |
It unfortunately appears that removing this one line uncovered existing issues elsewhere the code :-( For example, if you load http://www.texample.net/media/pgf/builds/pgfmanualCVS2012-11-04.pdf#disableStream=true&disableAutoFetch=true.[1] The pre-existing issue is that The following cases currently exists, and are problematic for different reasons:
So, to try and summarize, there's a couple of methods that simply does not work if called before Also, in the A compromise would perhaps be to only allow @timvandermeij, @yurydelendik How do you think that we should proceed here, to solve the underlying issue this PR uncovered? [1] The debugging parameters are merely intended to slow down loading somewhat, such that you have more time to do the next step. |
I personally think we should return early and not allow setting any of these properties before |
…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 mozilla#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.
… Scroll/Spread modes in the `BaseViewer` constructor Since other viewer state, such as the current page/scale/rotation[1], are not available as `BaseViewer` constructor options, this makes the Scroll/Spread modes stand out quite a bit. Hence it probably makes sense to remove/deprecate this, to avoid inconsistent/confusing state. --- [1] These properties are *purposely* not available in the constructor, since attempting to set them before a document is loaded has number of issues; please refer to mozilla#8539 (comment) for additional details.
… Scroll/Spread modes in the `BaseViewer` constructor Since other viewer state, such as the current page/scale/rotation[1], are not available as `BaseViewer` constructor options, this makes the Scroll/Spread modes stand out quite a bit. Hence it probably makes sense to remove/deprecate this, to avoid inconsistent/confusing state. --- [1] These properties are *purposely* not available in the constructor, since attempting to set them before a document is loaded has number of issues; please refer to mozilla#8539 (comment) for additional details.
… Scroll/Spread modes in the `BaseViewer` constructor Since other viewer state, such as the current page/scale/rotation[1], are not available as `BaseViewer` constructor options, this makes the Scroll/Spread modes stand out quite a bit. Hence it probably makes sense to remove/deprecate this, to avoid inconsistent and possibly confusing state in this code. --- [1] These properties are *purposely* not available in the constructor, since attempting to set them before a document is loaded has number of issues; please refer to mozilla#8539 (comment) for additional details.
… Scroll/Spread modes in the `BaseViewer` constructor Since other viewer state, such as the current page/scale/rotation[1], are not available as `BaseViewer` constructor options, this makes the Scroll/Spread modes stand out quite a bit. Hence it probably makes sense to remove/deprecate this, to avoid inconsistent and possibly confusing state in this code. --- [1] These properties are *purposely* not available in the constructor, since attempting to set them before a document is loaded has number of issues; please refer to mozilla#8539 (comment) for additional details.
… Scroll/Spread modes in the `BaseViewer` constructor Since other viewer state, such as the current page/scale/rotation[1], are not available as `BaseViewer` constructor options, this makes the Scroll/Spread modes stand out quite a bit. Hence it probably makes sense to remove/deprecate this, to avoid inconsistent and possibly confusing state in this code. --- [1] These properties are *purposely* not available in the constructor, since attempting to set them before a document is loaded has number of issues; please refer to mozilla#8539 (comment) for additional details.
… Scroll/Spread modes in the `BaseViewer` constructor Since other viewer state, such as the current page/scale/rotation[1], are not available as `BaseViewer` constructor options, this makes the Scroll/Spread modes stand out quite a bit. Hence it probably makes sense to remove/deprecate this, to avoid inconsistent and possibly confusing state in this code. --- [1] These properties are *purposely* not available in the constructor, since attempting to set them before a document is loaded has number of issues; please refer to mozilla#8539 (comment) for additional details.
…le-call Remove a redundant `PDFViewer.currentScale` call from `PDFViewerApplication.load`
…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 mozilla#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.
… Scroll/Spread modes in the `BaseViewer` constructor Since other viewer state, such as the current page/scale/rotation[1], are not available as `BaseViewer` constructor options, this makes the Scroll/Spread modes stand out quite a bit. Hence it probably makes sense to remove/deprecate this, to avoid inconsistent and possibly confusing state in this code. --- [1] These properties are *purposely* not available in the constructor, since attempting to set them before a document is loaded has number of issues; please refer to mozilla#8539 (comment) for additional details.
Since this call occurs before the
PDFViewer.setDocument
call, it won't actually cause any scale change.Furthermore, moving it should not be necessary, since the
scale
is already used as the fallback case inPDFViewerApplication.setInitialView
(provided it's non-zero, which isn't even the case in the default viewer).Hence this patch should cause no functional changes at all, since it simply removes a piece of unnecessary code.