Commit Graph

17158 Commits

Author SHA1 Message Date
calixteman
4dee3b83d5
Merge pull request #16344 from calixteman/intermittent_integration_test
Fix two intermittents issues in integration tests
2023-04-27 17:18:41 +02:00
Jonas Jenwald
cefa8c601a
Merge pull request #16361 from timvandermeij/jsdoc-pdfvieweroptions
Declare the `linkService` and `l10n` properties as optional in the `PDFViewerOptions` documentation
2023-04-27 17:16:32 +02:00
Tim van der Meij
8259fb4d2f
Declare the linkService and l10n properties as optional in the PDFViewerOptions documentation
Both properties have a fallback to `SimpleLinkService` respectively
`NullL10n` if no other value is provided explicitly.
2023-04-27 15:39:29 +02:00
Tim van der Meij
34ee77396c
Merge pull request #16356 from Snuffleupagus/issue-16355
Update the styling of the findbar `findMsg`-element (issue 16355)
2023-04-27 14:23:18 +02:00
Tim van der Meij
0ee0fcc6b3
Merge pull request #16350 from Snuffleupagus/dist-rm-lib
[api-minor] Stop including the "lib"-build in the `pdfjs-dist` repository
2023-04-27 14:01:55 +02:00
Tim van der Meij
a86265f7b7
Merge pull request #16354 from Snuffleupagus/crypto-less-stringToBytes
Avoid some repeated `stringToBytes`-calls in the `src/core/crypto.js` file
2023-04-27 14:00:50 +02:00
Tim van der Meij
13b168f1bb
Merge pull request #16357 from Snuffleupagus/network-rm-getXhr
Remove the unused `getXhr`-option in the `NetworkManager` constructor
2023-04-27 13:59:23 +02:00
Jonas Jenwald
924a8901d1 Remove the unused getXhr-option in the NetworkManager constructor
Originally this file was shared, using pre-processor statements, between the generic PDF.js library and the *built-in* Firefox PDF Viewer. In the latter case the `getXhr`-option is being used, see https://searchfox.org/mozilla-central/rev/f32d5f3949a3f4f185122142b29f2e3ab776836e/toolkit/components/pdfjs/content/PdfStreamConverter.sys.mjs#612-621
2023-04-27 11:32:32 +02:00
Jonas Jenwald
89ea6b3bb6 Update the styling of the findbar findMsg-element (issue 16355)
This patch tries to mimic the look of the message-element in the Firefox browser-findbar, and thus makes the following changes:
 - Remove the red colour, since it didn't take the light/dark themes into account.
 - Display the "notFound" message in bold.
2023-04-26 22:11:02 +02:00
Jonas Jenwald
e12535457f Avoid some repeated stringToBytes-calls in the src/core/crypto.js file
Currently we repeatedly lookup, and convert to bytes, the "O" and "U" encryption-dictionary entries.
2023-04-26 17:52:46 +02:00
Jonas Jenwald
62a9435190 [api-minor] Stop including the "lib"-build in the pdfjs-dist repository
The `pdfjs-dist/lib/` directory contains a README file that explicitly advises against using those files, however based on a fairly large number of issues filed over the years users seem to be (mostly) overlooking that warning.
In particular it unfortunately seems to be somewhat common for users to attempt to "combine" proper builds from `pdfjs-dist/build/` together with individual components from the `pdfjs-dist/lib/web/` directory, which more often than not leads to subtle bugs and general problems.

When we receive bug reports about this it's often not immediately obvious what the problem is, given that many issues lack enough details (such as runnable test-cases), but after some back-and-forth it usually turns out that usage of `pdfjs-dist/lib/` is the culprit.
Considering that keeping the general PDF.js library working is challenging and time-consuming enough nowadays, this patch thus proposes that we stop including the "lib"-build in the `pdfjs-dist` repository to both reduce user confusion and the support burden.
2023-04-26 12:11:13 +02:00
Jonas Jenwald
598408b7af
Merge pull request #16347 from Snuffleupagus/getAllTextInProgress-no-copy
Prevent incomplete copy-all behaviour while text-extraction is running (PR 16286 follow-up)
2023-04-26 08:24:17 +02:00
Jonas Jenwald
2de6fd8e70 Prevent incomplete copy-all behaviour while text-extraction is running (PR 16286 follow-up)
Currently we only prevent triggering the actual text-extraction multiple times in "parallel", when using the "copy all text" feature, however the "copy"-event itself is not prevented.
The result is that if the user selects all text in a long PDF document and then uses the copy-shortcut multiple times in quick succession, we'll actually populate the clipboard with "incomplete" contents (via a `TextLayerBuilder` copy-listener) until all text-extraction finishes.
2023-04-25 21:39:16 +02:00
Calixte Denizet
b4264e9648 Fix two intermittents issues in integration tests 2023-04-25 12:31:36 +02:00
Jonas Jenwald
495819fbc6
Merge pull request #16333 from Snuffleupagus/enablePermissions-allow-text-selection
Allow text-selection, but not copying, when `enablePermissions` is set (PR 16320 follow-up)
2023-04-25 11:32:21 +02:00
Jonas Jenwald
8a9d7a18cc Allow text-selection, but not copying, when enablePermissions is set (PR 16320 follow-up) 2023-04-25 11:07:05 +02:00
calixteman
1b79b0cd21
Merge pull request #16340 from calixteman/gv_new_toolbar
[GeckoView] Change the toolbar for a static one on the top of the viewer (bug 1829366)
2023-04-24 14:35:35 +02:00
Calixte Denizet
e00d26798c [GeckoView] Change the toolbar for a static one on the top of the viewer (bug 1829366) 2023-04-24 14:03:23 +02:00
Tim van der Meij
28f96d2ac2
Merge pull request #16336 from timvandermeij/custom-event
Don't use the deprecated `CustomEvent.initCustomEvent` method anymore
2023-04-23 16:06:10 +02:00
Tim van der Meij
870b942568
Don't use the deprecated CustomEvent.initCustomEvent method anymore
In PR #16295 one occurrence of this was changed, but a few more remained
in the codebase. This commit fixes the other occurrences so that we
don't use the deprecated way of creating custom events anywhere anymore.

According to MDN, see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/initCustomEvent,
using the `CustomEvent.initCustomEvent` method is deprecated and the
`CustomEvent` constructor should be used instead.

Extends d9bf571f5c.
2023-04-23 15:41:02 +02:00
Tim van der Meij
2f86f5bb75
Merge pull request #16338 from timvandermeij/updates
Update translations and packages
2023-04-23 15:39:06 +02:00
Tim van der Meij
edb09855dc
Fix package vulnerabilities reported by npm audit
This commit is generated automatically using `npm audit fix`.
2023-04-23 14:37:51 +02:00
Tim van der Meij
f6f33065ef
Update mkdirp to version 3.0.0
The only change in this major version is the removal of the default
export, so we must simply use the named export instead.
2023-04-23 14:37:40 +02:00
Tim van der Meij
1b228091fa
Update packages to the most recent versions 2023-04-23 14:12:17 +02:00
Tim van der Meij
9c023c847c
Update translations to the most recent versions 2023-04-23 14:12:05 +02:00
Tim van der Meij
d6d3fdc489
Merge pull request #16335 from timvandermeij/npm-install-force
Don't force-install packages in the CI job anymore
2023-04-23 12:53:18 +02:00
Tim van der Meij
43d390759b
Don't force-install packages in the CI job anymore
In PR #16327 the `eslint-plugin-mozilla` package was updated so we no
longer have to force-install packages, and the force-install flags for
`npm install` were removed. However, the CI job was missing from this
commit, which we fix here. In general force-installing packages
shouldn't be necessary unless there are problems with dependencies,
which we would like to know about, so especially in the CI job it seems
like a good idea to not force-install packages to catch upcoming defects
early on.

Extends 19526d2322.
2023-04-23 12:45:29 +02:00
Tim van der Meij
bf01edb452
Merge pull request #16334 from Snuffleupagus/rm-PDF20-closure
Remove the `PDF20` closure, in the `src/core/crypto.js` file
2023-04-23 11:39:49 +02:00
Jonas Jenwald
74585c7c59 Remove the unused PDF20.hash method
This method was added in PR 4938, almost nine years ago, however it doesn't appear to ever have been used.
Given the similarities between the `PDF17` and `PDF20` classes, and how they're used, if the `PDF20.hash` method was actually necessary you'd also expect a similiar method in the `PDF17` class.
2023-04-23 10:13:46 +02:00
Jonas Jenwald
5e0722e4c2 Remove the PDF20 closure, in the src/core/crypto.js file
To allow doing this the existing helper function was changed into a "private" method instead.
2023-04-23 10:08:17 +02:00
Jonas Jenwald
6e1b234c6b
Merge pull request #16332 from Snuffleupagus/rm-primitives-closures
Remove the remaining unnecessary closures in the `src/core/primitives.js` file
2023-04-22 15:55:10 +02:00
Jonas Jenwald
9cb3236ac0 Remove the remaining unnecessary closures in the src/core/primitives.js file 2023-04-22 15:33:04 +02:00
Tim van der Meij
e304423ba1
Merge pull request #16331 from Snuffleupagus/cmap-rm-closure
Remove unnecessary closures in the CMap code
2023-04-22 14:58:13 +02:00
Tim van der Meij
2588924b0f
Merge pull request #16326 from Snuffleupagus/limit-Chrome-CSS
Don't include Chrome-specific CSS rules in MOZCENTRAL builds
2023-04-22 14:54:50 +02:00
Tim van der Meij
c9359957e6
Merge pull request #16305 from Snuffleupagus/PDFJSDev-skip-PRODUCTION
Remove the `PRODUCTION` build-target
2023-04-22 14:53:30 +02:00
Jonas Jenwald
bc7aa8a585 Re-factor some String.fromCharCode usage in the src/core/binary_cmap.js file
We can replace one case of `apply` with rest parameters, and avoid doing repeated `String.fromCharCode` calls within a loop.
2023-04-21 12:21:31 +02:00
Jonas Jenwald
cabc98f310 Remove the remaining closure in the src/core/cmap.js file
With modern JavaScript we (usually) no longer need to keep old closures, which slightly reduces the size of the code.
2023-04-21 12:21:31 +02:00
Jonas Jenwald
244002502b Move the BinaryCMapReader into its own file
The "binary" CMap-format is specific to the PDF.js library, and is used to reduce the size of the built-in CMap data-files.
By moving this code to its own file we can remove the nowadays unnecessary closures, which helps to slightly reduce the size of this code.
2023-04-21 12:21:20 +02:00
Jonas Jenwald
434445973d
Merge pull request #16327 from Snuffleupagus/update-eslint-plugin-mozilla
Update `eslint-plugin-mozilla` to avoid having to force-install packages (issue 15429)
2023-04-20 16:20:31 +02:00
Jonas Jenwald
19526d2322 Update eslint-plugin-mozilla to avoid having to force-install packages (issue 15429)
The latest version of `eslint-plugin-mozilla` removed the Prettier dependency, see https://bugzilla.mozilla.org/show_bug.cgi?id=1677562, which means that we no longer need to use `npm install --force` in the PDF.js library.
2023-04-20 16:14:31 +02:00
Jonas Jenwald
d4e8657e8f
Merge pull request #16324 from Snuffleupagus/debugger-CSS-is
Introduce some `:is` usage in the debugger CSS
2023-04-20 15:17:03 +02:00
Jonas Jenwald
1b2b6910ac Don't include Chrome-specific CSS rules in MOZCENTRAL builds 2023-04-20 14:14:33 +02:00
Jonas Jenwald
f675bfe178
Merge pull request #16323 from Snuffleupagus/viewer-CSS-is
Introduce some `:is` usage in the viewer CSS
2023-04-20 09:34:46 +02:00
Jonas Jenwald
7926c1bc88 Introduce some :is usage in the viewer CSS 2023-04-20 09:26:19 +02:00
Jonas Jenwald
3e05d7e7fd Introduce some :is usage in the debugger CSS
Also adds one more instance of `:is` in the `web/annotation_editor_layer_builder.css` file.
2023-04-19 20:47:57 +02:00
Jonas Jenwald
58b5eb89b8
Merge pull request #16315 from Snuffleupagus/annotationLayer-CSS-is
Introduce some `:is` usage in the annotationLayer CSS
2023-04-19 15:32:10 +02:00
Jonas Jenwald
36ff19c53b
Merge pull request #16314 from Snuffleupagus/pdfViewer-CSS-is
Introduce some `:is` usage in the PDFViewer CSS
2023-04-19 15:28:53 +02:00
Jonas Jenwald
5119e7fd6a
Merge pull request #16313 from Snuffleupagus/textLayer-CSS-is
Introduce some `:is` usage in the textLayer CSS
2023-04-19 15:17:22 +02:00
Jonas Jenwald
f98358aa45
Merge pull request #16310 from Snuffleupagus/xfaLayer-CSS-is
Introduce some `:is` usage in the xfaLayer CSS
2023-04-19 15:15:38 +02:00
Jonas Jenwald
3420b2fe8a
Merge pull request #16317 from Snuffleupagus/css-before-after
Enforce double-colon notation for CSS pseudo-elements
2023-04-19 15:14:01 +02:00