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

19801 commits

Author SHA1 Message Date
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
Tim van der Meij
0543e9e49c
Merge pull request #18874 from Snuffleupagus/ColorPicker-AbortSignal-any
[Editor] Remove `ColorPicker` event listeners with `AbortSignal.any()` (PR 18586 follow-up)
2024-10-10 19:55:19 +02:00
calixteman
a77bf87c50
Merge pull request #18879 from calixteman/highlight_hover
Don't add the grey outline when hovering a selected highlight
2024-10-10 15:28:59 +02:00
calixteman
5f522d1c60
Merge pull request #18878 from calixteman/issue18876
Avoid exceptions in the console with ill-formed flate streams
2024-10-10 14:25:35 +02:00
Calixte Denizet
fa7df01568 Don't add the grey outline when hovering a selected highlight
When playing with a pen, I noticed that sometimes a free highlight has still its
gray outline when an other one is drawn: for any reason the pointerleave event isn't
triggered.
2024-10-10 14:12:50 +02:00
Calixte Denizet
f2f56b6464 Avoid exceptions in the console with ill-formed flate streams
It fixes #18876.
2024-10-10 12:07:30 +02:00
Jonas Jenwald
14537d1412 [Editor] Remove ColorPicker event listeners with AbortSignal.any() (PR 18586 follow-up)
Also, removes another "unnecessary" bound-method.
2024-10-09 10:58:35 +02:00
Tim van der Meij
233ac1773d
Merge pull request #18873 from Snuffleupagus/visibilitychange-AbortSignal-any
Remove the temporary "visibilitychange" listener, in `PDFViewer`, with `AbortSignal.any()`
2024-10-08 20:41:43 +02:00
Tim van der Meij
1269c6a4f9
Merge pull request #18871 from Snuffleupagus/PDFDocument-more-ensure
Improve the promise-caching in the `PDFDocument.fieldObjects` getter
2024-10-08 20:11:46 +02:00
Tim van der Meij
b15dd55c3a
Merge pull request #18862 from timvandermeij/integration-scripting-delays
Fix typing logic in the scripting integration tests
2024-10-08 19:59:13 +02:00
Jonas Jenwald
31b0a496fd Remove the temporary "visibilitychange" listener, in PDFViewer, with AbortSignal.any()
This is similar to a lot of other code, where we've been replacing explicit `removeEventListener`-calls.
Given the somewhat limited availability of `AbortSignal.any()`, see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static#browser_compatibility), this event listener will no longer be immediately removed in older browsers (however that should be fine).
2024-10-08 15:38:31 +02:00
Jonas Jenwald
662bd022ce Reduce duplication in the PDFDocument.calculationOrderIds getter 2024-10-08 12:24:09 +02:00
Jonas Jenwald
e3b5ed2e40 Improve the promise-caching in the PDFDocument.fieldObjects getter
After PR 18845 we're accessing this getter more, hence it seems like a good idea to ensure that the initial `formInfo` access is covered as well.
While unlikely to be a problem in practice, at least theoretically that data may not be available and the code in `fieldObjects` could thus currently be *unintentionally* invoked more than once.
2024-10-08 12:15:04 +02:00
Tim van der Meij
1d4376c2e2
Fix typing logic in the scripting integration tests
The default `page.type()` API from Puppeteer works for text fields that
only dispatch a sandbox event on e.g. focus loss (i.e. after all
characters have been inserted), and for those we can also use the
default typing delay from Puppeteer instead of defining our own value.

However, it doesn't work correctly for text fields where every character
insertion dispatches a sandbox event. This is because processing the
sandbox event takes some time and Puppeteer must wait for that before it
can (safely) insert the next character. This commit therefore introduces
a helper function to type a given value correctly in such text fields.

Not only does this fix intermittent failures if our delay was too low
for sandbox processing to complete, but it also speeds up the tests by
eliminating our delays in places where they were (much) higher than
necessary. In total the runtime of the scripting integration test suite
goes from 137 seconds before this patch to 100 seconds after this patch.
2024-10-06 21:13:46 +02:00
Tim van der Meij
81cf42df47
Merge pull request #18858 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2024-10-06 13:49:12 +02:00
Tim van der Meij
32caffb438
Bump the stable version in pdfjs.config 2024-10-06 13:46:35 +02:00
Tim van der Meij
8b73b828b6
Merge pull request #18844 from calixteman/bug1922063
Use Calibri and Lucida Console, when it's possible, in place of sans-serif and monospaced (bug 1922063)
2024-10-06 12:52:58 +02:00
Tim van der Meij
7eee86e078
Merge pull request #18855 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-10-06 12:46:41 +02:00
Tim van der Meij
e6a413d201
Update translations to the most recent versions 2024-10-06 12:43:07 +02:00
Tim van der Meij
dcc46ceafa
Upgrade eslint-plugin-unicorn to version 56.0.0
This is a major version bump, but the changelog at
https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v56.0.0
doesn't indicate any breaking changes that should impact us.
2024-10-06 12:43:07 +02:00
Tim van der Meij
78bf5287d1
Update dependencies to the most recent versions
Note that the new version of `eslint-plugin-import` contains support
for ESLint 9.

Moreover, the new version of Babel removed the leading space for import
comments (see https://github.com/babel/babel/pull/16780), so we update
the corresponding test expectation to match this.

Fixes a part of #17928.
2024-10-06 12:43:07 +02:00
Calixte Denizet
a45e4a391a Use Calibri and Lucida Console, when it's possible, in place of sans-serif and monospaced (bug 1922063)
A recent change in Firefox induced too much difference between the text widths computed in using a Canvas
and the ones computed by the text layout engine when rendering the text layer. Consequently, the
text selection can be bad on Windows with some fonts like Arial or Consolas.
This patch is a workaround to try to use in first place some fonts which don't have the problem.
2024-10-05 20:45:25 +02:00
calixteman
5a25c477b7
Merge pull request #18853 from calixteman/issue18036
Keep the empty lines in the text fields
2024-10-05 17:44:21 +02:00
Calixte Denizet
3194f3de8b Keep the empty lines in the text fields
It fixes #18036.
2024-10-05 16:19:41 +02:00
Tim van der Meij
9e69735914
Merge pull request #18854 from sylvestre/patch-1
Add more authors
2024-10-05 13:00:42 +02:00
Sylvestre Ledru
64ca2eeb83
Add more authors 2024-10-04 22:38:31 +02:00
Jonas Jenwald
6aef332bcd
Merge pull request #18852 from Snuffleupagus/bug-1922618
Change how we handle l10n-args for dates in the DocumentProperties dialog (bug 1922618)
2024-10-04 20:21:07 +02:00
calixteman
ac563b90b3
Merge pull request #18845 from calixteman/issue15096
Fix missing annotation parent in using the one from the Fields entry
2024-10-04 20:16:05 +02:00
Calixte Denizet
3103deaa44 Fix missing annotation parent in using the one from the Fields entry
Fixes #15096.
2024-10-04 20:00:19 +02:00
calixteman
7c1883a839
Merge pull request #18851 from calixteman/issue18849
[Editor] Avoid an exception when undoing the deletion of a pre-existing annotation
2024-10-04 19:54:18 +02:00
Jonas Jenwald
c681ff25d8 Change how we handle l10n-args for dates in the DocumentProperties dialog (bug 1922618)
Strangely enough the code works just fine as-is in the GENERIC viewer, so there must be some difference between the Firefox built-in Fluent implementation and the Fluent.js one.

It seems that we can work-around the problem by handling this l10n-arg the same way that we handle dates in the AnnotationLayer, and testing this with the Firefox Devtools it seems that it should work.
2024-10-04 19:50:05 +02:00
Calixte Denizet
b6e60d033a [Editor] Avoid an exception when undoing the deletion of a pre-existing annotation
It fixes #18849.

When such an annotation is deleted, we make sure that there are some data
to restore.
The version of this patch was making undoing a svg deletion buggy, so it's fixed now and
an integration test has been added for this case.
2024-10-04 18:24:58 +02:00
calixteman
e5b6144bfa
Merge pull request #18846 from flodolo/undo_number
Fluent: remove NUMBER() function from variant selector
2024-10-04 08:03:10 +02:00