Commit Graph

11487 Commits

Author SHA1 Message Date
Jonas Jenwald
ba2edeae18 [api-minor] Add support, in getMetadata, for custom information dictionary entries (issue 5970, issue 10344) (#10346)
The custom entries, provided that they exist *and* that their types are safe to include, are exposed through a new `Custom` infoDict entry to clearly separate them from the standard ones.

Fixes 5970.
Fixes 10344.
2018-12-18 23:26:02 +01:00
Thiago da Silva
811c8803b3 Fix small visual quirk in thumbnail viewer 2018-12-18 22:48:26 +01:00
Tim van der Meij
417c234c1c
Merge pull request #10266 from timvandermeij/gulp-4
Upgrade to Gulp 4
2018-12-17 17:00:51 +01:00
Tim van der Meij
fa85f86298
Upgrade to Gulp 4
This required the following changes in the Gulpfile:

- Defining a series of tasks is no longer done with arrays, but with the
  `gulp.series` function. The `web` target is refactored to use a
  smaller number of tasks to prevent tasks from running multiple times.
- Getting all tasks must now be done through the task registry.
- Tasks that don't return anything must call `done` upon completion.

Moreover, this upgrade allows us to use the latest Node.js on Travis CI
again.
2018-12-17 16:20:13 +01:00
Tim van der Meij
bc465695d5
Merge pull request #10358 from tsilvap/toggle-sidebar-keybinding
Add keyboard shortcut to toggle sidebar (F4, same as Adobe Reader).
2018-12-16 20:38:13 +01:00
Thiago da Silva
2abea7d7c2 Add keyboard shortcut to toggle sidebar 2018-12-16 13:00:15 -02:00
Tim van der Meij
e716038b12
Merge pull request #10356 from brendandahl/icon-dpi
Use high DPI icons on semi-high DPI screens.
2018-12-15 15:11:40 +01:00
Brendan Dahl
826893e6f4 Use high DPI icons on semi-high DPI screens.
The icons looks really fuzzy on a machine with a device pixel ratio of
1.5. Using the 2x icons looks much better.
2018-12-14 16:27:38 -08:00
Tim van der Meij
74934db910
Merge pull request #10354 from Snuffleupagus/TESTING-no-sourceMaps
Disable source-map generation when running tests
2018-12-13 23:05:04 +01:00
Jonas Jenwald
b60ea67a11 Disable source-map generation when running tests
This should save, a little bit of, time/resources on the bots since source-maps aren't used for anything during testing.
2018-12-13 17:41:27 +01:00
Tim van der Meij
fc607e35de
Merge pull request #10350 from Snuffleupagus/sig-fieldValue-null
Ignore the `fieldValue` for Signature annotations, since they're currently unsupported (issue 10374)
2018-12-12 23:01:53 +01:00
Tim van der Meij
c13a426eed
Merge pull request #10351 from Snuffleupagus/tab-switch-no-wheel-zoom
Attempt to ignore mouse wheel zooming during tab switches (bug 1503412)
2018-12-12 22:50:11 +01:00
Jonas Jenwald
437fb8a8a7 Ignore the fieldValue for Signature annotations, since they're currently unsupported (issue 10374)
Given that Signature (Widget) annotations are currently not supported, since they cannot be validated, simply ignoring the `fieldValue` seems OK for now considering that attempting to blindly include unparsed/unvalidated data isn't very useful.

Fixes 10347.
2018-12-12 18:01:43 +01:00
Jonas Jenwald
5d594885de Attempt to ignore mouse wheel zooming during tab switches (bug 1503412)
This patch re-factors, and extends, the already existing `zoomDisabledTimeout` used during mouse wheel zooming.
Unfortunately I haven't got the required hardware to actually test this patch, but there's a decent chance that it will fix, or at least reduce, the problems reported in https://bugzilla.mozilla.org/show_bug.cgi?id=1503412.
2018-12-12 13:46:47 +01:00
Tim van der Meij
cad0e61262
Merge pull request #10337 from wojtekmaj/turn-on-eslint-in-examples
Turn on ESLint in examples
2018-12-11 23:44:54 +01:00
Tim van der Meij
d9bf3d320f
Merge pull request #10295 from wojtekmaj/eslint-plugin-mozilla-update
Update eslint-plugin-mozilla to ^1.0.1
2018-12-11 23:35:43 +01:00
Wojciech Maj
9e3f7ac7fa Manually fix remaining ESLint errors 2018-12-11 15:23:26 +01:00
Wojciech Maj
ef1f255649 ESLint --fix 2018-12-11 15:23:26 +01:00
Wojciech Maj
80d7ff4912 Turn on ESLint in examples directory, apply examples-specific exceptions 2018-12-11 15:23:26 +01:00
Wojciech Maj
e70a22a854 Update eslint-plugin-mozilla to ^1.0.1 2018-12-11 12:14:06 +01:00
Tim van der Meij
2f4c7e01f5
Merge pull request #10304 from april/master
Add protection against directory traversal attacks
2018-12-10 23:18:30 +01:00
April King
64cb8c6b98
Add protection against directory traversal attacks 2018-12-10 12:59:04 -06:00
Tim van der Meij
45c0197465
Merge pull request #10330 from janpe2/svg-line-width-zero
Handle line width of zero in SVG
2018-12-07 23:34:27 +01:00
Tim van der Meij
5b8c51c1bf
Merge pull request #10340 from Snuffleupagus/history-tryPushCurrentPosition-viewer-modes
Tweak the `PDFHistory._tryPushCurrentPosition` method to work better with the different Scroll/Spread viewer modes
2018-12-07 23:18:00 +01:00
Jonas Jenwald
89e479dd6c Tweak the PDFHistory._tryPushCurrentPosition method to work better with the different Scroll/Spread viewer modes
Given that a larger number of pages may now be visible at once, and importantly that their layout may be non-vertical, one of the conditions should be tweaked to not accidentally miss cases where a page is still visible.

Please note: This patch is based on code-inspection, and the only ill effect occurring without it would be a couple of (near) duplicate history entries in some *rare* edge-cases.
2018-12-07 15:06:58 +01:00
Jani Pehkonen
ddabeb0645 Handle line width of zero in SVG 2018-12-04 16:05:32 +02:00
Tim van der Meij
9a1e51af24
Merge pull request #10323 from Snuffleupagus/unittestcli
Test the code as-is, in Node.js/Travis, rather than its Babel translated version
2018-12-02 14:56:06 +01:00
Jonas Jenwald
08584efdfe Test the code as-is, in Node.js/Travis, rather than its Babel translated version
This patch does three things:

 - Updates the `gulp unittestcli` command, using `gulp lint` as a guide, such that it can be run locally on Windows without any modifications.

 - Updates the `gulp lib` command to support disabling of Babel through the `SKIP_BABEL` environment variable. Note that all other build targets support this mode, and there's no good reason for `lib` to be any different here.

 - Updates the `npm test` command, used in Node.js/Travis, to test the code as-is test. Since modern Node.js versions seem to have no problems with ES6 compatible code in general, we should just test the source code as-is instead (similar to the tests running on the regular bots).
2018-12-02 10:15:27 +01:00
Tim van der Meij
4ff3435517
Merge pull request #10322 from felipeaugustox/patch-1
Remove unuseful variable
2018-12-01 14:44:57 +01:00
Felipe augusto
1a75647a27
Remove unuseful variable
Variable is declared, but never used.
2018-12-01 01:44:18 -02:00
Tim van der Meij
c91f437eaa
Merge pull request #10318 from Snuffleupagus/disablePreferences
In `GENERIC` builds, dispatch a "webviewerloaded" event (from the `webViewerLoad` function) before initializing the viewer
2018-11-30 22:40:10 +01:00
Jonas Jenwald
0dc995c7e0 In GENERIC builds, dispatch a "webviewerloaded" event (from the webViewerLoad function) before initializing the viewer
With the removal of the global `PDFJS` object, in PDF.js version `2.0`, the viewer options are no longer as easily accessible as they previously were (and issues have been filed about this).
In particular, since the viewer files aren't necessarily loaded *immediately*, this means that `PDFViewerApplication`/`PDFViewerApplicationOptions` aren't necessarily available directly. By dispatching an event once all viewer files are loaded but *before* the viewer initialization has run, setting `AppOptions` during load (in custom implementations of the default viewer) should hopefully become a little bit easier[1].

---
[1] In hindsight, this should probably have been implemented when the global `PDFJS` object was removed...
2018-11-30 10:04:30 +01:00
Jonas Jenwald
d9743e462d Replace the OVERRIDES list in PDFViewerApplication._readPreferences with a disablePreferences, in GENERIC builds, `AppOption instead
Rather than having a (somewhat) randomly choosen list of Preferences which `AppOptions` are allowed to override, it makes much more sense to simply add an AppOption to allow custom implementations to ignore Preferences altogether (it's also inline with the AppOption that allows the `ViewHistory` to be bypassed on load).
2018-11-29 11:46:40 +01:00
Tim van der Meij
1cb7cc9bf4
Merge pull request #10300 from timvandermeij/updates-followup
Include forgotten changes after Wintersmith update
2018-11-24 21:54:00 +01:00
Tim van der Meij
e15a9797e3
Include forgotten changes after Wintersmith update
This should have been part of the previous commit that updated the
Wintersmith dependency. Markdown support is no longer included in Pug
itself and should be done by a transformer instead.
2018-11-24 21:39:54 +01:00
Tim van der Meij
327cf38a94
Merge pull request #10299 from timvandermeij/updates
Update packages and translations
2018-11-24 21:13:59 +01:00
Tim van der Meij
2f2d5776e7
Update translations 2018-11-24 21:03:40 +01:00
Tim van der Meij
498eaadcfb
Update packages 2018-11-24 21:00:22 +01:00
Tim van der Meij
87e3fb8413
Merge pull request #10275 from Snuffleupagus/trees-get-binary-search
Fix `NameOrNumberTree.get` to actually perform a binary search to find the requested key
2018-11-24 20:51:12 +01:00
Jonas Jenwald
d0fec7c6fb Fix NameOrNumberTree.get to actually perform a binary search to find the requested key
The intent of the code, based on existing comments, is to perform a binary search. However, because of what appears to be a typo in the code responsible for computing the current search index, this code is always checking *every* entry (albeit only at the "final" node) starting from the last one.
2018-11-23 23:52:33 +01:00
Tim van der Meij
b9b8cef04b
Merge pull request #10293 from wojtekmaj/babel-7
Upgrade to Babel 7
2018-11-23 23:36:58 +01:00
Tim van der Meij
33fa33ec75
Merge pull request #10292 from wojtekmaj/replace-uglify-es-with-terser
Replace uglify-es with Terser
2018-11-23 23:14:47 +01:00
Tim van der Meij
34e79189d2
Merge pull request #10294 from wojtekmaj/eslint-plugin-import
Add ESLint plugin import to be warned against invalid paths
2018-11-23 23:12:42 +01:00
Wojciech Maj
b46ec5195f Update Babel to 7.x
Update configuration to work with Babel 7
Explicitly require globals - eslint-plugin-mozilla needs it, but doesn't require it on its own.
Fix Regexp to match Babel 7's inlined _interopRequireDefault
2018-11-23 14:32:17 +01:00
Wojciech Maj
9921f92a36 Enable eslint-plugin-import to prevent unresolved paths 2018-11-23 13:50:28 +01:00
Wojciech Maj
616135962a Fix badly formatted .eslintrc 2018-11-23 13:49:58 +01:00
Wojciech Maj
01727e0fcc Replace UglifyJS with Terser 2018-11-23 12:18:36 +01:00
Tim van der Meij
7b4f3035d2
Merge pull request #10274 from Snuffleupagus/out-of-order-trees
Fallback to an exhaustive search, in corrupt PDF files, for NameTrees/NumberTrees that are not correctly ordered (issue 10272)
2018-11-21 22:57:44 +01:00
Jonas Jenwald
fdad0a0b0b Fallback to an exhaustive search, in corrupt PDF files, for NameTrees/NumberTrees that are not correctly ordered (issue 10272)
According to the specification, see https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#G6.2384179, the keys of NameTree/NumberTree should be ordered.
For corrupt PDF files, which violate this assumption, we thus need to fallback to an exhaustive search in order to e.g. find all destinations.

*Please note:* Given that this only implements a fallback for the "final" node of the Tree, there's obviously a risk that the patch isn't sufficient for dealing with all kinds of out-of-order corruption. However, this kind of problem should be rare in practice, and without a real-world test-case it's difficult to implement a completely general solution (and there's obviously a question if you'd even want to).
2018-11-20 17:50:47 +01:00
Jani Pehkonen
9e990f6f3e Repair CFF fonts if stem hints are in wrong order 2018-11-20 18:50:37 +02:00