Commit Graph

13882 Commits

Author SHA1 Message Date
Jonas Jenwald
3d55b2b10e Replace done callbacks in the font-tests with async/await instead 2021-04-19 13:26:39 +02:00
Tim van der Meij
fd82adccfa
Merge pull request #13256 from timvandermeij/unit-test-async-await-pt4
Convert done callbacks to async/await in the last two unit test files
2021-04-18 14:25:40 +02:00
Tim van der Meij
d42f3d0bfe
Convert done callbacks to async/await in test/unit/evaluator_spec.js 2021-04-18 14:20:54 +02:00
Tim van der Meij
692304247c
Merge pull request #13258 from Snuffleupagus/update-packages
Update packages and translations
2021-04-18 14:19:51 +02:00
Jonas Jenwald
d3ed3761bc Update l10n files 2021-04-18 11:24:51 +02:00
Jonas Jenwald
cfa42cb0f2 Fix (some) vulnerabilities reported by npm audit
This was done automatically, using the `npm audit fix` command.
2021-04-18 11:05:52 +02:00
Jonas Jenwald
fc007028a2 Update npm packages 2021-04-18 11:02:42 +02:00
Tim van der Meij
f4237d3a09
Convert done callbacks to async/await in test/unit/annotation_spec.js 2021-04-17 19:59:18 +02:00
Tim van der Meij
c86e70ba08
Merge pull request #13253 from timvandermeij/unit-test-async-await-pt3
Convert done callbacks to async/await in `test/unit/api_spec.js`
2021-04-17 18:11:08 +02:00
Tim van der Meij
c2f3a71eca
Convert done callbacks to async/await in test/unit/api_spec.js 2021-04-17 17:52:23 +02:00
Tim van der Meij
dd7f04ea2e
Merge pull request #13254 from Snuffleupagus/scripting-misc-fixes
A couple of small scripting/XFA-related tweaks in the worker-code
2021-04-17 12:32:32 +02:00
Jonas Jenwald
f560fe6875 A couple of small scripting/XFA-related tweaks in the worker-code
- Use `PDFManager.ensureDoc`, rather than `PDFManager.ensure`, in a couple of spots in the code. If there exists a short-hand format, we should obviously use it whenever possible.

 - Fix a unit-test helper, to account for the previous changes. (Also, converts a function to be `async` instead.)

 - Add one more exists-check in `PDFDocument.loadXfaFonts`, which I missed to suggest in PR 13146, to prevent any possible errors if the method is ever called in a situation where it shouldn't be.
   Also, print a warning if the actual font-loading fails since that could help future debugging. (Finally, reduce overall indentation in the loop.)

 - Slightly unrelated, but make a small tweak of a comment in `src/core/fonts.js` to reduce possible confusion.
2021-04-17 10:34:22 +02:00
Brendan Dahl
ac3fa1e3d7
Merge pull request #13146 from calixteman/xfa_fonts
XFA -- Load fonts permanently from the pdf
2021-04-16 12:55:12 -07:00
Tim van der Meij
6db10d159a
Merge pull request #13250 from Snuffleupagus/rm-_delayedFallback
Remove the `PDFViewerApplication._delayedFallback` functionality
2021-04-16 20:38:22 +02:00
Tim van der Meij
ad2afab585
Merge pull request #13249 from Snuffleupagus/rm-generic-signature-warn
[GENERIC viewer] Don't display the `errorWrapper`, for documents with signatures (PR 13217 follow-up)
2021-04-16 20:36:52 +02:00
Tim van der Meij
6e8ff2fed9
Merge pull request #13247 from Snuffleupagus/update-yargs
Update the `yargs` package to the latest version
2021-04-16 20:33:45 +02:00
Tim van der Meij
cba6a3f375
Merge pull request #13246 from timvandermeij/unit-test-async-await-pt2
Convert done callbacks to async/await in more unit test files
2021-04-16 20:24:53 +02:00
Jonas Jenwald
c988712bc5 Update the yargs package to the latest version
While I wasn't able to figure out *exactly* why the old format didn't work, re-factoring the `parseOptions` function to use `yargs` differently "just worked" so that's hopefully good enough here.
With these changes everything related to a *particular* option now appears in one place, rather than being spread out, which aids readability in my opinion. Also, the options are now sorted alphabetically, to make it easier to find a particular one.

https://www.npmjs.com/package/yargs
2021-04-16 12:04:35 +02:00
Jonas Jenwald
4ef187e903 Remove the PDFViewerApplication._delayedFallback functionality
According to a decision by UX and PM, please see https://bugzilla.mozilla.org/show_bug.cgi?id=1705060#c2 (and implemented in https://bugzilla.mozilla.org/show_bug.cgi?id=1705327), we no longer show the notification-bar in Firefox; hence the special `PDFViewerApplication._delayedFallback` functionality should no longer be necessary.
Furthermore, note that at this point in time *most* of the features which used the `PDFViewerApplication._delayedFallback` functionality is now enabled by default; hence that provides even less reason to keep this code around and existing calls are thus converted to "regular" `PDFViewerApplication.fallback` calls.
2021-04-16 10:16:48 +02:00
Jonas Jenwald
a6e29ab43c Remove the special handling of "errorFontLoadNative" and "errorFontMissing" in PDFViewerApplication.fallback (PR 12931 follow-up, PR 12995 follow-up)
According to a decision by UX and PM, please see https://bugzilla.mozilla.org/show_bug.cgi?id=1705060#c2 (and implemented in https://bugzilla.mozilla.org/show_bug.cgi?id=1705327), we no longer show the notification-bar in Firefox.
Hence there's (obviously) no need to ignore certain `featureId`s in `PDFViewerApplication.fallback` anymore.
2021-04-16 09:54:02 +02:00
Jonas Jenwald
7d7a8a1a3c [GENERIC viewer] Don't display the errorWrapper, for documents with signatures (PR 13217 follow-up)
According to a decision by UX and PM, please see https://bugzilla.mozilla.org/show_bug.cgi?id=1705060#c2, in Firefox we should first of all *not* display the notification-bar for signatures. Secondly, as can also be seen there, we shouldn't display the notification-bar *at all* and it's thus disabled in https://bugzilla.mozilla.org/show_bug.cgi?id=1705327.

If we purposely don't display a notification, for documents with signatures, in the *built in* Firefox PDF Viewer then it cannot be necessary in the GENERIC viewer either.
2021-04-16 09:53:59 +02:00
Calixte Denizet
7e9579045f XFA -- Load fonts permanently from the pdf
- Different fonts can be used in xfa and some of them are embedded in the pdf.
  - Load all the fonts in window.document.

Update src/core/document.js

Co-authored-by: Jonas Jenwald <jonas.jenwald@gmail.com>

Update src/core/worker.js

Co-authored-by: Jonas Jenwald <jonas.jenwald@gmail.com>
2021-04-15 17:57:42 +02:00
Tim van der Meij
38ed655562
Convert done callbacks to async/await in test/unit/cmap_spec.js 2021-04-14 22:24:28 +02:00
Tim van der Meij
046467ff47
Drop obsolete done callbacks in test/unit/annotation_storage_spec.js
There is no asynchronous code involved here, so we can get rid of all
done callbacks here and simply use the fact that if the function call
ends without failed assertion that the test passed.
2021-04-14 22:11:45 +02:00
Tim van der Meij
82bdba78fb
Drop obsolete done callbacks in test/unit/crypto_spec.js
There is no asynchronous code involved here, so we can get rid of all
done callbacks here and simply use the fact that if the function call
ends without failed assertion that the test passed.
2021-04-14 22:09:17 +02:00
Tim van der Meij
43eb4302ff
Convert done callbacks to async/await in test/unit/message_handler_spec.js 2021-04-14 21:59:13 +02:00
Tim van der Meij
bc8c0bbbfd
Convert done callbacks to async/await in test/unit/display_svg_spec.js 2021-04-14 21:59:13 +02:00
Tim van der Meij
ae48d07582
Merge pull request #13243 from janpe2/ocg-ve
Implement visibility expressions for optional content
2021-04-14 20:42:49 +02:00
Tim van der Meij
cd2c4e277c
Merge pull request #13222 from timvandermeij/unit-test-async
Convert done callbacks to async/await in the smaller unit test files
2021-04-14 20:37:17 +02:00
Tim van der Meij
eddb9087a1
Merge pull request #13240 from Snuffleupagus/update-eslint-helpers
Update `eslint-config-prettier`/`eslint-plugin-unicorn` packages to their latest versions
2021-04-14 20:36:45 +02:00
Tim van der Meij
b9d87b8c0d
Merge pull request #13244 from Snuffleupagus/update-postcss-calc
Update the `postcss-calc` package to the latest version
2021-04-14 20:35:51 +02:00
Tim van der Meij
6bb0ffd374
Merge pull request #13238 from Snuffleupagus/update-es-module-shims
Update the `es-module-shims` package to the latest version
2021-04-14 20:34:57 +02:00
Jani Pehkonen
3a96977ea8 Implement visibility expressions for optional content 2021-04-14 17:39:41 +03:00
Jonas Jenwald
3e113cd38f Update the es-module-shims package to the latest version
Beside the unit/font-test suites, this is primarily used in the development viewer (i.e. `gulp server`).

https://www.npmjs.com/package/es-module-shims
2021-04-14 15:40:41 +02:00
Jonas Jenwald
da93bd18cc Update the postcss-calc package to the latest version
I've successfully run `gulp mozcentral` and `gulp generic` locally, with/without this patch and diff-ed the *built* `web/viewer.css` files. There were no changes, in the build-output, caused by this update.

https://www.npmjs.com/package/postcss-calc
2021-04-14 15:32:38 +02:00
Jonas Jenwald
f2156fc0cf Update eslint-config-prettier/eslint-plugin-unicorn packages to their latest versions
Both of these ESLint "helpers" has increased their *major* version numbers, which `npm update` doesn't handle automatically (since that could cause errors), hence this patch which updates them manually.

https://www.npmjs.com/package/eslint-config-prettier
https://www.npmjs.com/package/eslint-plugin-unicorn
2021-04-14 12:46:57 +02:00
Tim van der Meij
3ff7627120
Merge pull request #13235 from Snuffleupagus/split-core-obj
Split the classes in `src/core/obj.js` into separate files
2021-04-13 22:13:46 +02:00
Tim van der Meij
c1e9f6025f
Convert done callbacks to async/await in test/unit/custom_spec.js 2021-04-13 21:51:27 +02:00
Tim van der Meij
a1c1e1b9f8
Convert done callbacks to async/await in test/unit/fetch_stream_spec.js 2021-04-13 21:51:27 +02:00
Tim van der Meij
5607484402
Convert done callbacks to async/await in test/unit/network_spec.js 2021-04-13 21:51:26 +02:00
Tim van der Meij
fcf4d02fca
Convert done callbacks to async/await in test/unit/node_stream_spec.js 2021-04-13 21:51:26 +02:00
Tim van der Meij
99dc0d6b65
Convert done callbacks to async/await in test/unit/primitives_spec.js 2021-04-13 21:50:13 +02:00
Tim van der Meij
a56ffb92be
Convert done callbacks to async/await in test/unit/ui_utils_spec.js 2021-04-13 21:50:13 +02:00
Tim van der Meij
a2811e925d
Convert done callbacks to async/await in test/unit/util_spec.js 2021-04-13 21:47:53 +02:00
Jonas Jenwald
1d6d476cab Rename the src/core/obj.js file to src/core/catalog.js
Now that only the `Catalog` remains in this file, after the previous patches, it makes sense to rename the file to reduce confusion.
2021-04-13 21:00:30 +02:00
Jonas Jenwald
088a55f80d Enable the no-var rule in the src/core/xref.js file 2021-04-13 21:00:30 +02:00
Jonas Jenwald
bc828cd41f Convert the XRef to a "normal" class 2021-04-13 21:00:30 +02:00
Jonas Jenwald
e8750cfe95 Move the XRef from src/core/obj.js and into its own file
The size of the `src/core/obj.js` file has increased slowly over the years, and it also contains a fair amount of *distinct* functionality.
In order to improve readability and make it easier to navigate through the code, this patch moves the `XRef` into its own file.
2021-04-13 21:00:30 +02:00
Jonas Jenwald
24e5ecdf76 Move NameTree/NumberTree from src/core/obj.js and into its own file
The size of the `src/core/obj.js` file has increased slowly over the years, and it also contains a fair amount of *distinct* functionality.
In order to improve readability and make it easier to navigate through the code, this patch moves `NameTree`/`NumberTree` into its own file.
2021-04-13 21:00:30 +02:00
Jonas Jenwald
92141e0468 Enable the no-var rule in the src/core/file_spec.js file 2021-04-13 21:00:30 +02:00