Commit Graph

13709 Commits

Author SHA1 Message Date
dependabot[bot]
6312a321df
Bump pug-code-gen from 2.0.1 to 2.0.3
Bumps [pug-code-gen](https://github.com/pugjs/pug) from 2.0.1 to 2.0.3.
- [Release notes](https://github.com/pugjs/pug/releases)
- [Commits](https://github.com/pugjs/pug/compare/pug-code-gen@2.0.1...pug@2.0.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-03 02:28:49 +00:00
Tim van der Meij
9d91237d14
Merge pull request #13039 from Snuffleupagus/issue-13036
Change the background to ensure that the sidebar is visible/readable when the viewer is narrow (issue 13036)
2021-03-01 23:25:44 +01:00
Jonas Jenwald
7c52c01267 Change the background to ensure that the sidebar is visible/readable when the viewer is narrow (issue 13036)
This is more fallout from PR 11077.
2021-03-01 18:27:27 +01:00
Tim van der Meij
63c5d449f2
Merge pull request #13033 from timvandermeij/annotation-line-without-appearance
Implement rendering line annotations without appearance stream
2021-02-28 20:02:01 +01:00
Tim van der Meij
5828ff6cb0
Implement rendering line annotations without appearance stream 2021-02-28 18:57:58 +01:00
Tim van der Meij
d6e0b2d92e
Merge pull request #13032 from Snuffleupagus/parseDestDictionary-actionName-warn
Don't warn about actions that require scripting support in `Catalog.parseDestDictionary`
2021-02-28 14:52:06 +01:00
Tim van der Meij
5f37d4e2b4
Merge pull request #13031 from timvandermeij/annotation-square-circle-no-appearance-stream
Implement rendering square/circle annotations without appearance stream
2021-02-28 14:47:13 +01:00
Jonas Jenwald
39cf4a0008 Don't warn about actions that require scripting support in Catalog.parseDestDictionary
Now that we have scripting support, warning about e.g. JavaScript actions doesn't seem necessary anymore. Especially considering that scripting-related actions are/will not be parsed by the `Catalog.parseDestDictionary` method anyway, since it's intended for handling "simple" actions.
2021-02-28 13:13:17 +01:00
Tim van der Meij
fa6cebf045
Implement rendering square/circle annotations without appearance stream 2021-02-27 19:05:12 +01:00
Tim van der Meij
8e74278b65
Merge pull request #13030 from Snuffleupagus/cmap-class-async
Modernize some of the code in `src/core/cmap.js` by using classes and async/await
2021-02-27 16:11:37 +01:00
Jonas Jenwald
05de20071a Modernize some of the code in src/core/cmap.js by using classes and async/await
This converts a couple of our old "classes" to proper ECMAScript classes, and replaces a lot of manual Promise-wrapping with async/await instead.
2021-02-27 14:20:43 +01:00
Tim van der Meij
5a8b849944
Merge pull request #13029 from timvandermeij/no-var
Enable the `no-var` linting rule in more core files
2021-02-27 13:35:49 +01:00
Tim van der Meij
4e96d59fca
Use a buffer instead of string concatenation in reverseIfRtl in src/core/unicode.js
This avoids creating intermediate strings and should be slightly more
efficient.
2021-02-27 13:20:09 +01:00
Tim van der Meij
24f80f1e38
Enable the no-var linting rule in src/core/primitives.js 2021-02-27 12:51:01 +01:00
Tim van der Meij
ed33727419
Enable the no-var linting rule in src/core/glyphlist.js 2021-02-27 12:46:57 +01:00
Tim van der Meij
e051d4d029
Enable the no-var linting rule in src/core/ccitt_stream.js 2021-02-27 12:44:55 +01:00
Tim van der Meij
0897dddbbe
Enable the no-var linting rule in src/core/unicode.js 2021-02-27 12:44:50 +01:00
Tim van der Meij
cb82dda755
Enable the no-var linting rule in src/core/metrics.js 2021-02-27 12:44:45 +01:00
Tim van der Meij
052db45e7a
Merge pull request #13023 from calixteman/fix_color_test
Fix integration test with js-colors
2021-02-26 23:22:23 +01:00
Tim van der Meij
2da850d8c9
Merge pull request #13024 from Snuffleupagus/Puppeteer-8
Update Puppeteer to version 8
2021-02-26 22:42:11 +01:00
Tim van der Meij
55786a4880
Merge pull request #13026 from Snuffleupagus/crypto-classes
Convert code in `src/core/crypto.js` to use "normal" classes
2021-02-26 22:39:30 +01:00
Tim van der Meij
848753671f
Merge pull request #13025 from Snuffleupagus/function-classes
Convert code in `src/core/function.js` to use "normal" classes
2021-02-26 22:22:38 +01:00
Brendan Dahl
5dd749cd60
Merge pull request #13014 from Snuffleupagus/Firefox-contentDispositionFilename
[api-minor] Support the Content-Disposition filename in the Firefox PDF Viewer (bug 1694556, PR 9379 follow-up)
2021-02-26 07:50:00 -08:00
Jonas Jenwald
6b4c4f80e4 Convert code in src/core/crypto.js to use "normal" classes
All of this code predates the existence of native JS classes, however we can now clean this up a bit. This patch thus let us remove some variable "shadowing" from the code.
2021-02-26 15:51:45 +01:00
Jonas Jenwald
b884757873 Inline the concatArrays function in calculatePDF20Hash
This helper function is first of all only called *twice*, and secondly it also leads to unnecessary intermediate allocations given how the `TypedArray`s are handled.
Hence we can simply inline this small function, and thus directly allocate the combined `TypedArray` instead.
2021-02-26 15:51:39 +01:00
Jonas Jenwald
9a9a5b2365 Replace the compareByteArrays functions, in src/core/crypto.js, with the isArrayEqual helper function
The `compareByteArrays` is first of all duplicated in multiple closures in the `src/core/crypto.js` file. Secondly, despite its name, it's also functionally equivalent to the now existing `isArrayEqual` helper function.

The `isArrayEqual` helper function is changed to use a standard `for`-loop, rather than `Array.prototype.every`, since that ought to be slightly more efficient given that we're now using it with (potentially) larger data.
2021-02-26 15:51:32 +01:00
Jonas Jenwald
e69e8622a9 Convert code in src/core/function.js to use "normal" classes
All of this code predates the existence of native JS classes, however we can now clean this up a bit. This patch thus let us remove some variable "shadowing" from the code.
2021-02-26 13:20:59 +01:00
Jonas Jenwald
bb155cea5d Update Puppeteer to version 8
Hopefully the updated Chromium-version might help reduce the number of intermittent test failures.

Please find additional information at https://github.com/puppeteer/puppeteer/releases/tag/v8.0.0
2021-02-26 12:08:02 +01:00
Calixte Denizet
17363bbc6f Fix integration test with js-colors
- need to wait for color change to check its value.
2021-02-26 11:40:02 +01:00
Jonas Jenwald
6fd899dc44 [api-minor] Support the Content-Disposition filename in the Firefox PDF Viewer (bug 1694556, PR 9379 follow-up)
As can be seen [in the mozilla-central code](https://searchfox.org/mozilla-central/rev/a6db3bd67367aa9ddd9505690cab09b47e65a762/toolkit/components/pdfjs/content/PdfStreamConverter.jsm#1222-1225), we're already getting the Content-Disposition filename. However, that data isn't passed through to the viewer nor to the `PDFDataTransportStream`-implementation, which explains why it's currently being ignored.

*Please note:* This will also require a small mozilla-central patch, see https://bugzilla.mozilla.org/show_bug.cgi?id=1694556, to forward the necessary data to the viewer.
2021-02-26 10:50:29 +01:00
Tim van der Meij
061637d3f4
Merge pull request #13021 from Snuffleupagus/createObjectURL-rm-shadow
Remove the, strictly unnecessary, closure and variable shadowing from `createObjectURL`
2021-02-25 23:35:17 +01:00
Tim van der Meij
163a840a1e
Merge pull request #13020 from Snuffleupagus/rm-some-NullL10n-use
Remove the `NullL10n` default value from viewer components not included in the `COMPONENTS`-bundle
2021-02-25 23:27:49 +01:00
Tim van der Meij
6cb911cdd0
Merge pull request #13019 from Snuffleupagus/PDFFindBar-null
Remove the `findResultsCount`-check from `PDFFindBar.updateResultsCount`, and unnecessary defaults from the constructor
2021-02-25 23:22:29 +01:00
Jonas Jenwald
70d1869fe5 Remove the, strictly unnecessary, closure and variable shadowing from createObjectURL
Note that this particular helper function is, with the exception of the `GENERIC` default viewer and the (unsupported) SVG-backend, mostly unused at this point in time. Hence we should be able to clean-up this helper function slightly.

Also, fixes a small inconsistency in the `SVGGraphics` initialization in the viewer, by passing in the `disableCreateObjectURL` compatibility-option. Given that the SVG-backend isn't officially supported/recommended this shouldn't have been an issue, but given that I spotted this it can't hurt to fix it.
2021-02-25 16:34:23 +01:00
Jonas Jenwald
85251da218 Remove the NullL10n default value from viewer components not included in the COMPONENTS-bundle
For any viewer component not listed in `web/pdf_viewer.component.js`, it shouldn't be necessary to provide a default value for the `l10n`-parameters.
Note also that these *specific* components are heavily tailored towards the default viewer use-case, rather than for general usage.
2021-02-25 16:08:04 +01:00
Jonas Jenwald
c277e39b0b Remove the findResultsCount-check from PDFFindBar.updateResultsCount, and unnecessary defaults from the constructor
Given that `PDFFindBar` is written *specifically* for the default viewer, rather than general usage (as opposed to the `PDFFindController`), we should be able to simply assume that the `findResultsCount` DOM-element is always present. Even more so, when we're purposely not doing any similar checks for other DOM-elements in this code.

Also, remove unnecessary `null` defaults for the various DOM-element options in the constructor, since the code simply assumes that all of the relevant DOM-elements are in fact available.
2021-02-25 16:05:07 +01:00
Tim van der Meij
8b7dee0aae
Merge pull request #13009 from Snuffleupagus/openOrDownloadData
Move the opening of PDF file attachments into the `DownloadManager`-implementations
2021-02-24 20:57:12 +01:00
Brendan Dahl
0b7415f982
Merge pull request #13011 from brendandahl/remove-new-line
Remove extra new line from HTML source.
2021-02-24 08:37:44 -08:00
Calixte Denizet
ecd45cc9af JS - Avoid a popup to ask for updating Acrobat.
- this popup appears because js is enabled;
  - and because the pdf contains some unsupported features (e.g. XFA);
  - can be tested with: https://www.cbsa-asfc.gc.ca/publications/forms-formulaires/a10.pdf.
2021-02-24 15:52:48 +01:00
calixteman
45329af926
XFA -- Add support for SOM expressions (#12983)
- specifications: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.364.2157&rep=rep1&type=pdf#page=87;
 - add a parser for SOM expressions;
 - add search functions to resolve those expressions;
 - search functions will be used to bind data into template.
2021-02-24 10:13:02 +01:00
Brendan Dahl
19c3fd1e2f Remove extra new line from HTML source.
This avoids issues in mozcentral with linting.
2021-02-23 18:00:05 -08:00
Jonas Jenwald
df931ef685 Move the opening of PDF file attachments into the DownloadManager-implementations
Note how the `PDFAttachmentViewer` handles PDF file attachments specially, by opening them in a new window/tab, rather than forcing them to be downloaded. This is done to improve the overall UX, since browsers in general are able to handle PDF files internally.
However, for file *annotations* we're currently not attempting to do the same thing and are instead just downloading them directly. In order to unify the behaviour, without having to duplicate a lot of code, the opening of PDF file attachments is thus moved into a new `DownloadManager.openOrDownloadData` method.
2021-02-23 13:44:23 +01:00
Tim van der Meij
fafe039849
Merge pull request #13008 from timvandermeij/webpack-stream
Allow minor and patch versions for the `webpack-stream` dependency again
2021-02-21 15:21:38 +01:00
Tim van der Meij
62d5b15a24
Allow minor and patch versions for the webpack-stream dependency again
Fixes #11996.
2021-02-21 15:13:41 +01:00
Tim van der Meij
f3aa4408a5
Merge pull request #13005 from calixteman/colors
JS - Fix setting a color on an annotation
2021-02-21 14:50:03 +01:00
Tim van der Meij
34fd197621
Merge pull request #13007 from Snuffleupagus/update-packages
Update packages and translations
2021-02-21 14:37:43 +01:00
Jonas Jenwald
476230bd17 Update l10n files 2021-02-21 12:07:32 +01:00
Jonas Jenwald
385bf67bc9 Update npm packages 2021-02-21 11:52:55 +01:00
Tim van der Meij
2194fb940d
Merge pull request #13004 from Snuffleupagus/cancelBound
Add a `this`-bound method for `InternalRenderTask.cancel`
2021-02-20 18:50:31 +01:00
Calixte Denizet
4a5f1d1b7a JS - Fix setting a color on an annotation
- strokeColor corresponds to borderColor;
 - support fillColor and textColor;
 - support colors on the different annotations;
 - fix typo in aforms (+test).
2021-02-20 15:24:37 +01:00