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

19983 commits

Author SHA1 Message Date
Jonas Jenwald
9c6f85f1f2
Merge pull request #18920 from Snuffleupagus/FreeText-l10n-default-content
Simplify localization of the "default-content" in FreeText editors
2024-10-20 19:31:34 +02:00
Tim van der Meij
347f155ebc
Replace eslint-plugin-sort-exports by eslint-plugin-perfectionist
The `eslint-plugin-sort-exports` plugin doesn't support ESLint 9 or has
published plans to do so. The `eslint-plugin-perfectionist` does support
ESLint 9 [1], seems more actively maintained [2, 3] and contains other
rules that could be interesting later on [4]. Note that both plugins
behave the same, except for two cases which are updated here.

[1] https://github.com/azat-io/eslint-plugin-perfectionist/issues/154
[2] https://github.com/azat-io/eslint-plugin-perfectionist/commits/main
[3] https://www.npmjs.com/package/eslint-plugin-perfectionist?activeTab=versions
[4] https://perfectionist.dev/rules
2024-10-20 18:50:35 +02:00
Jonas Jenwald
2ef3fd2a81 Simplify localization of the "default-content" in FreeText editors
By using "data-l10n-attrs" it's possible to instruct Fluent to localize *custom* attributes, which means that we don't need to manually translate/update the "default-content" in FreeText editors.
2024-10-20 18:46:44 +02:00
Tim van der Meij
f9659f4635
Merge pull request #18921 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-10-20 16:35:14 +02:00
Tim van der Meij
ccfb8a20c2
Update translations to the most recent versions 2024-10-20 15:59:03 +02:00
Tim van der Meij
b4651390bb
Update dependencies to the most recent versions 2024-10-20 15:58:59 +02:00
Tim van der Meij
29b2f26131
Merge pull request #18927 from timvandermeij/eslint-plugin-cleanup
Remove the `eslint-plugin-{fetch-options,html}` and `eslint-config-prettier` dependencies
2024-10-20 15:56:04 +02:00
Tim van der Meij
6def1c8453
Remove the eslint-config-prettier dependency
The `eslint-plugin-prettier` dependency already installs this dependency
by default nowadays, so we don't have to specify it ourselves anymore.
2024-10-20 15:38:22 +02:00
Tim van der Meij
760dd24ea0
Remove the eslint-plugin-{fetch-options,html} dependencies
The plugins have originally been introduced in commit d63da81 for the
`eslint-plugin-mozilla` dependency, but the `eslint-plugin-mozilla`
plugin got removed in commit be93d53 and we also don't use the plugins
ourselves in e.g. our `.eslintrc` files (as evidenced by `npx gulp lint`
not failing while it does fail if we remove any of the other plugins).
2024-10-20 15:38:22 +02:00
Tim van der Meij
df77401821
Merge pull request #18925 from Snuffleupagus/ci-test-Node-23
Run CI tests in Node.js version 23
2024-10-20 14:03:20 +02:00
Jonas Jenwald
6604adb5ff Run CI tests in Node.js version 23
Node.js version 23 was recently released, see https://github.com/nodejs/release#release-schedule, hence it cannot hurt to start testing in that environment.
2024-10-20 13:50:48 +02:00
Jonas Jenwald
521f5b8cdc
Merge pull request #18924 from Snuffleupagus/version-4.8
Bump library version to `4.8`
2024-10-20 12:52:16 +02:00
Jonas Jenwald
4165910fd9 Bump library version to 4.8 2024-10-20 12:49:06 +02:00
Jonas Jenwald
2a4630f89a
Merge pull request #18922 from Snuffleupagus/node-canvas-3
[api-minor] Update the `canvas` package to version 3
2024-10-20 12:42:59 +02:00
Jonas Jenwald
54e00b0104 Catch errors when invoking applyPath2DToCanvasRenderingContext
This way we allow the rest of the packages to be loaded successfully, such that e.g. the Node.js unit-tests work correctly.

Note that this occurred after updating the `node-canvas` package to version `3.0.0-rc2`, however it's not immediately clear to me if it's a problem there or in the `path2d` package; see also nilzona/path2d-polyfill/issues/84.
2024-10-20 12:39:10 +02:00
Jonas Jenwald
6ae13fac9b [api-minor] Update the canvas package to version 3
This allows us to run the Node.js unit-tests in version 22, which is good since it'll very soon become the active LTS release; see https://github.com/nodejs/release#release-schedule.
2024-10-20 12:39:08 +02:00
Tim van der Meij
025c0875b0
Merge pull request #18919 from Snuffleupagus/GrabToPan-AbortSignal
Remove event listeners with `AbortSignal` in the `GrabToPan` class
2024-10-19 13:08:10 +02:00
Jonas Jenwald
c3bbeb51e3 Remove event listeners with AbortSignal in the GrabToPan class 2024-10-19 12:01:43 +02:00
Jonas Jenwald
c88d3a31cf
Merge pull request #18888 from Snuffleupagus/MessageHandler-AbortSignal
Re-factor the `MessageHandler`-class event handler function
2024-10-18 17:27:14 +02:00
calixteman
762667b2df
Merge pull request #18916 from calixteman/bug1922766
When changing a property on a radio button then change it for the siblings (bug 1922766)
2024-10-17 20:21:00 +02:00
Calixte Denizet
86d1272d1b When changing a property on a radio button then change it for the siblings (bug 1922766) 2024-10-17 18:27:12 +02:00
Jonas Jenwald
788eabc76a Re-factor the MessageHandler-class event handler function
- Change the "message" event handler function to a private method.

 - Remove the "message" event listener with an `AbortSignal`.

 - Extend the `LoopbackPort`-class with `AbortSignal` support.
2024-10-16 10:16:27 +02:00
Jonas Jenwald
689ffda9df
Merge pull request #18902 from Snuffleupagus/pdkids-rm-linked-test
Add the `pdkids` PDF document to the repository
2024-10-15 22:15:09 +02:00
Tim van der Meij
96bced7f5b
Merge pull request #18884 from hubgit/patch-1
Handle null parentElement for selection anchor
2024-10-15 20:55:23 +02:00
Tim van der Meij
ec79316379
Merge pull request #18905 from Snuffleupagus/optionalContentConfig-determine-groups
Reduce duplication when collecting optional content groups
2024-10-15 20:46:23 +02:00
Tim van der Meij
e8149b3982
Merge pull request #18898 from Snuffleupagus/PDFViewerApplication-bindEvents-opts
Create fewer Objects in `PDFViewerApplication.bindEvents`
2024-10-15 20:34:45 +02:00
Tim van der Meij
54606e9b7b
Merge pull request #18893 from Snuffleupagus/PDFViewerApplication-rm-removeEventListener-opts
Remove unnecessary options from `removeEventListener` in the `web/app.js` file
2024-10-15 20:26:19 +02:00
Jonas Jenwald
805f962181 Reduce duplication when collecting optional content groups
After PR 18825 we can easily "compute" the optional content groups, and can thus avoid tracking them manually.
2024-10-15 13:20:30 +02:00
Jonas Jenwald
424f81c4db
Merge pull request #18825 from agrahn/rbgroups
implementing optional content radiobutton groups
2024-10-15 13:11:19 +02:00
Alexander Grahn
441efe456e Optional Content (OC) radiobutton (RB) groups implemented. Resolves #18823.
The code parses the /RBGroups entry in the OC configuration dict and adds the property `rbGroups' to instances of the OptionalContentGroup class. rbGroups takes an array of Sets, where each Set instance represents an RB group the OptionalContentGroup instance is a member of. Such a Set instance contains all OCG ids within the corresponding RB group. RB groups an OCG is associated with are processed when its visibility is set to true, as required by the PDF spec.
2024-10-15 11:34:45 +02:00
Jonas Jenwald
fb3c7b6d8f Add the pdkids PDF document to the repository
Given that the sub-title of that document is "Public domain texts for young people." and that the images have clear sources at the end of the document, it should (hopefully) be OK to add it to the repository rather than relying on a linked test-case.
2024-10-15 10:55:17 +02:00
calixteman
c10d0935c4
Merge pull request #18899 from calixteman/issue18896
Some jpx images can have a mask
2024-10-14 21:56:36 +02:00
Calixte Denizet
8b7b39f5d6 Some jpx images can have a mask
It fixes #18896.
2024-10-14 21:50:32 +02:00
Jonas Jenwald
4d7f29d736 Create fewer Objects in PDFViewerApplication.bindEvents
Given that all listeners need the same options we can create and re-use a single options-Objects for all of them.
2024-10-14 11:48:41 +02:00
calixteman
e1f9fa4ea5
Merge pull request #18895 from calixteman/issue18894
Fallback on gray colorspace when there are no colorspace and no name in the scn/SCN arguments
2024-10-13 17:56:52 +02:00
Calixte Denizet
e7ab8cd8c1 Fallback on gray colorspace when there are no colorspace and no name in the scn/SCN arguments
It fixes #18894.
2024-10-13 16:02:07 +02:00
Jonas Jenwald
4ae6132d07 Remove unnecessary options from removeEventListener in the web/app.js file
Only the `capture` parameter matters when removing an event listener, see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener#matching_event_listeners_for_removal
2024-10-13 11:39:36 +02:00
calixteman
1c0c070847
Merge pull request #18890 from calixteman/clamp_indexedcs_hival
Clamp the hival parameter of Indexed color space to the range [0; 255]
2024-10-12 23:53:59 +02:00
calixteman
e28dd8e824
Merge pull request #18889 from calixteman/rm_useless_aria_has_popup
Don't add attribute 'aria-haspopup' when no popup is rendered for an annotation
2024-10-12 23:52:15 +02:00
Calixte Denizet
4dea773c5b Clamp the hival parameter of Indexed color space to the range [0; 255]
Since this value is used to allocate an array, it makes sense to avoid to use too much memory.
From the specs, this value must be in the range [0; 255] (see section 8.6.6.3).
This patch removes the unused property 'highVal'.
2024-10-12 23:50:58 +02:00
Calixte Denizet
7c43cb2dae Don't add attribute 'aria-haspopup' when no popup is rendered for an annotation
and for ink annotations, create the popup after the loop in order to avoid useless
elements creation.
2024-10-12 20:51:40 +02:00
Tim van der Meij
c3af34271e
Merge pull request #18881 from Snuffleupagus/AltTextManager-rm-events-AbortSignal
Remove event listeners with `AbortSignal` in the `AltTextManager` class
2024-10-11 19:37:00 +02:00
Tim van der Meij
02b33b970b
Merge pull request #18885 from Snuffleupagus/PDFDateString-regex
Move the regular expression caching into the `PDFDateString` class
2024-10-11 19:32:13 +02:00
calixteman
4a0c508689
Merge pull request #18833 from calixteman/gulp_testfilter
Add an option to gulp makeref/browsertest to only run tests with specific ids
2024-10-11 15:54:21 +02:00
Jonas Jenwald
8afc542ae2 Move the regular expression caching into the PDFDateString class
This code is old enough that it pre-dates availability of private class fields, hence why this wasn't done originally.
2024-10-11 15:34:58 +02:00
Alf Eaton
e97e9c93d6
Handle null parentElement for selection anchor 2024-10-11 13:58:06 +01:00
Jonas Jenwald
6f307e90a3 Remove event listeners with AbortSignal in the AltTextManager class 2024-10-11 12:05:36 +02:00
Calixte Denizet
6dd7726022 Add an option to gulp makeref/browsertest to only run tests with specific ids
It can be used like this: `gulp makeref -t tracemonkey-eq` or `gulp browsertest --testfilter tracemonkey-text`.
2024-10-10 21:58:16 +02:00
calixteman
c6d01caf65
Merge pull request #18860 from calixteman/issue18775
Fix failing integration test on Windows with Chrome
2024-10-10 21:46:36 +02:00
Calixte Denizet
edc2cd1968 Fix failing integration test on Windows with Chrome
It fixes #18775.
2024-10-10 21:27:55 +02:00