-
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
[api-minor] Fix the AnnotationStorage
usage properly in the viewer/tests (PR 12107 and 12143 follow-up)
#12147
[api-minor] Fix the AnnotationStorage
usage properly in the viewer/tests (PR 12107 and 12143 follow-up)
#12147
Conversation
…tests (PR 12107 and 12143 follow-up) *The [api-minor] label probably ought to have been added to the original PR, given the changes to the `createAnnotationLayerBuilder` signature (if nothing else).* This patch fixes the following things: - Let the `AnnotationLayer.render` method create an `AnnotationStorage`-instance if none was provided, thus making the parameter *properly* optional. This not only fixes the reference tests, it also prevents issues when the viewer components are used. - Stop exporting `AnnotationStorage` in the official API, i.e. the `src/pdf.js` file, since it's no longer necessary given the change above. Generally speaking, unless absolutely necessary we probably shouldn't export unused things in the API. - Fix a number of JSDocs `typedef`s, in `src/display/` and `web/` code, to actually account for the new `annotationStorage` parameter. - Update `web/interfaces.js` to account for the changes in `createAnnotationLayerBuilder`. - Initialize the storage, in `AnnotationStorage`, using `Object.create(null)` rather than `{}` (which is the PDF.js default).
ad98eeb
to
346afd1
Compare
… as cloning a `PageViewport`, when no annotations exist for a page
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/bf37c8009b1cde8/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/e6d0aa755e12bcc/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/bf37c8009b1cde8/output.txt Total script time: 26.83 mins
Image differences available at: http://54.67.70.0:8877/bf37c8009b1cde8/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/e6d0aa755e12bcc/output.txt Total script time: 29.18 mins
Image differences available at: http://54.215.176.217:8877/e6d0aa755e12bcc/reftest-analyzer.html#web=eq.log |
Thank you for improving this! |
I also marked the original PR as |
The [api-minor] label probably ought to have been added to the original PR, given the changes to the
createAnnotationLayerBuilder
signature (if nothing else).This patch fixes the following things:
AnnotationLayer.render
method create anAnnotationStorage
-instance if none was provided, thus making the parameter properly optional. This not only fixes the reference tests, it also prevents issues when the viewer components are used.AnnotationStorage
in the official API, i.e. thesrc/pdf.js
file, since it's no longer necessary given the change above. Generally speaking, unless absolutely necessary we probably shouldn't export unused things in the API.typedef
s, insrc/display/
andweb/
code, to actually account for the newannotationStorage
parameter.web/interfaces.js
to account for the changes increateAnnotationLayerBuilder
.AnnotationStorage
, usingObject.create(null)
rather than{}
(which is the PDF.js default).