1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00
Commit graph

20109 commits

Author SHA1 Message Date
Calixte Denizet
832fc93aa4 Use vertical variant of a char when it's in a missing vertical font (bug 1905623) 2024-07-03 09:46:54 +02:00
Tim van der Meij
4e8a015a78
Update translations to the most recent versions 2024-07-02 18:29:19 +02:00
Tim van der Meij
bb54e7e64c
Update dependencies to the most recent versions 2024-07-02 18:20:49 +02:00
Tim van der Meij
ccad2f889a
Merge pull request #18349 from Snuffleupagus/rm-renderTextLayer
[api-minor] Remove the deprecated `renderTextLayer` and `updateTextLayer` functions (PR 18104 follow-up)
2024-07-02 17:23:54 +02:00
calixteman
59620d3748
Merge pull request #18366 from calixteman/clean_switch_annot
[Editor] Make sure everything is cleaned up when we switch to annotation editor mode
2024-07-02 17:13:57 +02:00
Calixte Denizet
68175323f1 [Editor] Make sure everything is cleaned up when we switch to annotation editor mode 2024-07-02 16:54:19 +02:00
calixteman
4f1d4c6bd0
Merge pull request #18365 from calixteman/bump_4.5
Bump library version to 4.5
2024-07-02 15:50:36 +02:00
calixteman
c154b1da23
Update pdfjs.config
Co-authored-by: Jonas Jenwald <jonas.jenwald@gmail.com>
2024-07-02 15:46:05 +02:00
Calixte Denizet
2060944bda Bump library version to 4.5 2024-07-02 15:08:43 +02:00
calixteman
bdcc4a0feb
Merge pull request #18134 from calixteman/hide_annotations
[api-minor][Editor] When switching to editing mode, redraw pages containing editable annotations (bug 1883884)
2024-07-02 15:05:42 +02:00
Jonas Jenwald
033623c8d6 Update the year in the license_header files 2024-07-02 14:34:59 +02:00
Jonas Jenwald
ecb39a75ed [Firefox] Generate a PDF.js default-prefs file that can be used directly in mozilla-central (bug 1905864) 2024-07-02 14:12:23 +02:00
Calixte Denizet
64635f3b35 [api-minor][Editor] When switching to editing mode, redraw pages containing editable annotations
Right now, editable annotations are using their own canvas when they're drawn, but
it induces several issues:
 - if the annotation has to be composed with the page then the canvas must be correctly
   composed with its parent. That means we should move the canvas under canvasWrapper
   and we should extract composing info from the drawing instructions...
   Currently it's the case with highlight annotations.
 - we use some extra memory for those canvas even if the user will never edit them, which
   the case for example when opening a pdf in Fenix.

So with this patch, all the editable annotations are drawn on the canvas. When the
user switches to editing mode, then the pages with some editable annotations are redrawn but
without them: they'll be replaced by their counterpart in the annotation editor layer.
2024-07-02 14:11:40 +02:00
calixteman
75129fd61a
Merge pull request #18361 from calixteman/issue18360.pdf
[Editor] Take into account the page translation when computing the quadpoints when saving an highlight
2024-07-02 11:21:06 +02:00
Calixte Denizet
576aaf7cc1 [Editor] Take into account the page translation when computing the quadpoints when saving an highlight
It fixes #18360.
2024-07-02 10:12:26 +02:00
Tim van der Meij
c280c520ee
Merge pull request #18359 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2024-07-01 20:14:50 +02:00
Tim van der Meij
2f4d5d25a8
Bump the stable version in pdfjs.config 2024-07-01 20:10:35 +02:00
Tim van der Meij
19fbc89985
Merge pull request #18358 from timvandermeij/npm-url
Fix the repository URL in the `package.json` file for `pdfjs-dist`
2024-07-01 19:55:07 +02:00
Tim van der Meij
bf5dd7ea10
Fix the repository URL in the package.json file for pdfjs-dist
For provenance, enabled in PR #18352, to work the repository URL in
`package.json` is required to match the repository URL of the GitHub
Actions invocation. This should fix the following error we encountered
publishing a new release today:

```
npm error 422 Unprocessable Entity - PUT https://registry.npmjs.org/pdfjs-dist - Error verifying sigstore provenance bundle: Failed to validate repository information: package.json: "repository.url" is "git+https://github.com/mozilla/pdfjs-dist.git", expected to match "https://github.com/mozilla/pdf.js" from provenance
```
2024-07-01 19:32:03 +02:00
Tim van der Meij
7114796430
Merge pull request #18352 from wojtekmaj/provenance
Generate provenance statements on npm publish
2024-07-01 17:42:16 +02:00
Tim van der Meij
067ec20092
Merge pull request #18356 from calixteman/no_newtabpage
Disable new tab page stuff in Firefox when running tests
2024-07-01 16:47:39 +02:00
Calixte Denizet
efb45a705e Disable new tab page stuff in Firefox when running tests
It should help to have such a garbage in the logs:
```
console.warn: TopSitesFeed: Failed to fetch data from Contile server: NetworkError when attempting to fetch resource.
JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
```
2024-07-01 16:20:07 +02:00
Wojciech Maj
aaa65bf3fc
Generate provenance statements on npm publish
This PR adds [Provenance statements](https://docs.npmjs.com/generating-provenance-statements) on `npm publish`, increasing supply-chain security.
2024-07-01 15:37:25 +02:00
Tim van der Meij
8556a26390
Merge pull request #18353 from wojtekmaj/npm-ci
Use `npm ci`, not `npm install`, on CI
2024-07-01 15:25:02 +02:00
Wojciech Maj
6b449d8884
Use npm ci, not npm install, on CI
This PR switches from `npm install` to `npm ci` on CI. This enables some additional checks to ensure repo integrity when using CI/CD.

Read more: https://docs.npmjs.com/cli/v10/commands/npm-ci
2024-07-01 13:46:23 +02:00
calixteman
b5d554e1b4
Merge pull request #18350 from timvandermeij/github-actions-release
Introduce a GitHub Actions workflow for publishing a release and fix `npm publish` warnings about the `package.json` format
2024-07-01 10:02:41 +02:00
Tim van der Meij
dddb74d5e4
Fix npm publish warnings about the package.json format
This commit removes the following warnings from the `npm publish` output:

```
npm warn publish npm auto-corrected some errors in your package.json when publishing.  Please run "npm pkg fix" to address these errors.
npm warn publish errors corrected:
npm warn publish Removed invalid "scripts"
npm warn publish "repository.url" was normalized to "git+https://github.com/mozilla/pdfjs-dist.git"
```

For the "scripts" section it turns out that if the package doesn't have
any scripts it's expected to explicitly set it to an empty object; refer
to https://github.com/npm/cli/issues/6918 and
https://github.com/denoland/dnt/pull/414.
2024-06-30 16:03:52 +02:00
Tim van der Meij
a5f2b9faeb
Introduce a GitHub Actions workflow for publishing a release
This commit migrates this functionality away from the bots. Note that
the NPM token must be configured as a repository secret before this
workflow can execute.

The following resources are relevant for this patch:

- Publishing packages to the NPM registry:
  https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry
- Creating secrets for a repository:
  https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository
2024-06-30 16:03:52 +02:00
Jonas Jenwald
f3d177e3e4 [api-minor] Remove the deprecated renderTextLayer and updateTextLayer functions (PR 18104 follow-up) 2024-06-30 15:16:00 +02:00
Tim van der Meij
40b0c848ee
Merge pull request #18346 from Snuffleupagus/webserver-dev-note
Add a comment about `test/webserver.mjs` being development-only code
2024-06-30 13:45:30 +02:00
Jonas Jenwald
046e281e20 Add a comment about test/webserver.mjs being development-only code 2024-06-29 12:05:28 +02:00
calixteman
fb3a4e4f5c
Merge pull request #18345 from calixteman/issue18305
Take into account PageOpen and PageClose actions which are present in some fields
2024-06-28 22:43:23 +02:00
Calixte Denizet
dacf8bb0d1 Take into account PageOpen and PageClose actions which are present in some fields 2024-06-28 22:21:03 +02:00
calixteman
8709202021
Merge pull request #18341 from calixteman/issue17779_not_in_talos
Ignore test issue17779.pdf in talos because it times out
2024-06-28 18:58:08 +02:00
Calixte Denizet
4d91ae3cde Ignore test issue17779.pdf in talos because it times out 2024-06-28 17:38:58 +02:00
calixteman
a609bd89b3
Merge pull request #18338 from calixteman/fix_stamp_test
Fix intermittent failures with freetext and stamp tests
2024-06-27 20:03:04 +02:00
calixteman
abdc3fa7cf
Merge pull request #18339 from calixteman/add_port_option
Add a port option to gulp server
2024-06-27 20:01:46 +02:00
Tim van der Meij
53aca5fab1
Merge pull request #18336 from Snuffleupagus/InternalRenderTask-cancel-cancelAnimationFrame
Cancel the `requestAnimationFrame` in the API when cancelling rendering
2024-06-27 19:40:16 +02:00
Calixte Denizet
f006aa36d1 Add a port option to gulp server 2024-06-27 18:57:00 +02:00
Calixte Denizet
0e94f2bd00 Fix intermittent failures with freetext and stamp tests
They're potentially due to some concurrent access to the system clipboard.
So this patch makes them sequential.
2024-06-27 18:23:41 +02:00
Jonas Jenwald
a4f1a9a41b Cancel the requestAnimationFrame in the API when cancelling rendering
Errors related to this `requestAnimationFrame` show up intermittently when running the integration-tests on the bots, however I've been unable to reproduce it locally.
Hence I cannot guarantee that it's enough to fix the timing issues, however this should be generally safe since the `requestAnimationFrame` invokes the `_next`-method and the first thing that one does is check that rendering hasn't been cancelled.
2024-06-26 17:26:02 +02:00
Tim van der Meij
af16aa62ad
Merge pull request #18335 from Snuffleupagus/watchScroll-cancelAnimationFrame
Cancel the `requestAnimationFrame` in the `watchScroll` helper (PR 18193 follow-up)
2024-06-26 16:57:02 +02:00
Jonas Jenwald
4dad1e34b9 Cancel the requestAnimationFrame in the watchScroll helper (PR 18193 follow-up)
While the event listener is removed during testing, the `requestAnimationFrame` isn't cancelled and that occasionally shows up when the integration-tests are run on the bots.
2024-06-26 16:31:07 +02:00
Tim van der Meij
6d579081c4
Merge pull request #18331 from timvandermeij/integration-test-copy-pasting
Refactor the copy/paste logic in the integration tests and fix a race condition involving the `waitForEvent` integration test helper function
2024-06-26 16:20:57 +02:00
Tim van der Meij
7128b95d29
Fix a race condition involving the waitForEvent integration test helper function
Debugging #17931 uncovered a race condition in the way we use the
`waitForEvent` function. Currently the following happens:

1. We call `waitForEvent`, which starts execution of the function body
   and immediately returns a promise.
2. We do the action that triggers the event.
3. We await the promise, which resolves if the event is triggered or
   the timeout is reached.

The problem is in step 1: function body execution has started, but not
necessarily completed. Given that we don't await the promise, we
immediately trigger step 2 and it's not unlikely that the event we
trigger arrives before the event listener is actually registered in the
function body of `waitForEvent` (which is slower because it needs to be
evaluated in the page context and there is some other logic before the
actual `addEventListener` call).

This commit fixes the issue by passing the action to `waitForEvent` as
a callback so `waitForEvent` itself can call it once it's safe to do so.
This should make sure that we always register the event listener before
triggering the event, and because we shouldn't miss events anymore we
can also remove the retry logic for pasting.
2024-06-26 15:25:33 +02:00
Tim van der Meij
55ba4aa66a
Refactor the copy/paste logic in the integration tests
The integration tests are currently not consistent in how they do
copy/pasting: some tests use the `kbCopy`/`kbPaste` functions with
waiting for the event inline, some have their own helper function to
combine those actions and some even call `kbCopy`/`kbPaste` without
waiting for the event at all (which can cause intermittent failures).

This commit fixes the issues by providing a set of four helper functions
that all tests use and that abstract e.g. waiting for the event away
from the caller. This makes the invididual tests simpler and consistent,
reduces code duplication and fixes possible intermittent failures
due to not waiting for events to trigger.
2024-06-26 14:48:42 +02:00
calixteman
2fbd61944b
Merge pull request #18332 from calixteman/bug1904585
Add the possibility to dispatch some pdf.js events at the chrome level (bug 1904585)
2024-06-25 21:15:15 +02:00
Calixte Denizet
35474f8ef4 Add the possibility to dispatch some pdf.js events at the chrome level (bug 1904585) 2024-06-25 21:03:34 +02:00
Jonas Jenwald
7f586182ba
Merge pull request #18333 from Snuffleupagus/l10n-destroy-rm-requestAnimationFrame
Remove the `requestAnimationFrame` work-around in `L10n.prototype.destroy` (PR 18313 follow-up)
2024-06-25 18:34:42 +02:00
Jonas Jenwald
f676ce5760 Remove the requestAnimationFrame work-around in L10n.prototype.destroy (PR 18313 follow-up)
With `@fluent/dom 0.10.0` just published this work-around is no longer necessary.
2024-06-25 17:23:57 +02:00