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

19922 commits

Author SHA1 Message Date
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
calixteman
e9c81a6e54
Merge pull request #18834 from calixteman/edit_stamp1
[Editor] Make stamp annotations editable (bug 1921291)
2024-10-04 07:53:27 +02:00
Francesco Lodolo
58d31479d7
Fluent: remove NUMBER() function from variant selector 2024-10-04 07:14:45 +02:00
Calixte Denizet
8410252eb8 [Editor] Make stamp annotations editable (bug 1921291) 2024-10-03 21:54:08 +02:00
Jonas Jenwald
ebbd019d7d
Merge pull request #18842 from Snuffleupagus/annotationEditorMode-AbortSignal-any
Remove the `PDFViewer.annotationEditorMode` setter event listeners with `AbortSignal.any()`
2024-10-03 19:38:49 +02:00
calixteman
85586c5859
Merge pull request #18843 from calixteman/editor_async_deser
[Editor] Make the editor deserialization async
2024-10-03 19:37:49 +02:00
Calixte Denizet
7bd3e5ccec [Editor] Make the editor deserialization async 2024-10-03 18:34:22 +02:00
Jonas Jenwald
b7ae92c11c Remove the PDFViewer.annotationEditorMode setter event listeners with AbortSignal.any() 2024-10-03 15:57:46 +02:00
calixteman
4fb3adfc0f
Merge pull request #18837 from calixteman/bug1838602
[GV] Increase the height (48px) of the toolbar in order to fit the a11y recommendations (bug 1838602)
2024-10-03 11:29:54 +02:00
Calixte Denizet
0ce6f8b482 [GV] Increase the height (48px) of the toolbar in order to fit the a11y recommendations (bug 1838602)
and reorganize the toolbar css to use nested styles.
2024-10-02 19:17:40 +02:00
calixteman
567df42149
Merge pull request #18805 from calixteman/update_stamp
[Editor] Add the possibility to save an updated stamp annotation (bug 1921291)
2024-10-02 13:16:35 +02:00
Calixte Denizet
c9050be863 [Editor] Add the possibility to save an updated stamp annotation (bug 1921291) 2024-10-02 11:45:16 +02:00
Jonas Jenwald
e25832c43f
Merge pull request #18831 from Snuffleupagus/toolbar-container
Fix `toolbarViewer`/`toolbarContainer` regressions (PR 18385, 18786 follow-up)
2024-10-02 09:37:12 +02:00
calixteman
0308b8075f
Merge pull request #18824 from calixteman/issue18072
Write the display flags in F entry when saving an annotation (issue 18072)
2024-10-02 09:13:06 +02:00
Jonas Jenwald
07e8afb247 Always set AppOptions.eventBus, regardless of build, to make local testing easier 2024-10-01 19:43:19 +02:00
Jonas Jenwald
7c9d177826 Update the CaretBrowsingMode toolbar-height if the toolbarDensity preference changes (PR 18786 follow-up)
Otherwise the isVisible-calculations may not work correctly.
2024-10-01 19:43:16 +02:00
calixteman
3cdc3258d9
Merge pull request #18830 from calixteman/menu_nvda
Make the secondary menu button usable with the keyboard when NVDA is enabled
2024-10-01 17:27:56 +02:00
Calixte Denizet
2481a4bab9 Write the display flags in F entry when saving an annotation (issue 18072) 2024-10-01 17:26:39 +02:00
Jonas Jenwald
f2a132f826 Use the "correct" toolbar container element in getViewerConfiguration (PR 18385 follow-up)
With the changes made in PR 18385 the `toolbarViewer` element is now shorter than before, since the padding is applied on its `toolbarContainer` parent-element instead.
This causes two separate regressions:
 - Clicking at the very top/bottom of the toolbar no longer closes the secondaryToolbar like previously.
 - The `CaretBrowsingMode`-constructor no longer computes the toolbar-height correctly.

Given how/where the `container`-property is being used these changes *should* thus be safe.
2024-10-01 17:17:40 +02:00
Calixte Denizet
392c17efa0 Make the secondary menu button usable with the keyboard when NVDA is enabled
It's a temporary workaround until bug 1921984 is fixed.
2024-10-01 16:57:39 +02:00
Jonas Jenwald
35a9a6a7b3
Merge pull request #18829 from Snuffleupagus/PDFLayerViewer-update-UI
Re-factor how `PDFLayerViewer` decides if the UI needs to updated on "optionalcontentconfigchanged" events
2024-10-01 15:17:00 +02:00
Jonas Jenwald
655ef12b14 Re-factor how PDFLayerViewer decides if the UI needs to updated on "optionalcontentconfigchanged" events
The current implementation won't work correctly in some cases, e.g. if RBGroups are present, which means that it's possible for the UI to get out-of-sync with the actual optionalContent-state.

To avoid querying the DOM unnecessarily we cache the last known UI-state and compare with the actual optionalContent-state, which thus replaces the previously used hash-comparison.
2024-10-01 13:25:22 +02:00
Jonas Jenwald
783facb312
Merge pull request #18822 from Snuffleupagus/Chrome-103
[api-minor] Update the minimum supported Google Chrome version to 103
2024-10-01 10:12:57 +02:00
Jonas Jenwald
1267e28255 [api-minor] Update the minimum supported Google Chrome version to 103
This patch updates the minimum supported browsers as follows:
 - Google Chrome 103[1], which was released on 2022-06-21; see https://chromereleases.googleblog.com/2022/06/stable-channel-update-for-desktop_21.html

Note that nowadays we usually try, where feasible and possible, to support browsers that are about two years old. By limiting support to only "recent" browsers we reduce the risk of holding back improvements of the *built-in* Firefox PDF Viewer, and also (significantly) reduce the maintenance/support burden for the PDF.js contributors.

*Please note:* As always, the minimum supported browser version assumes that a `legacy`-build of the PDF.js library is being used; see https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support

---

[1] This is consistent with the minimum supported version in the recently updated Google Chrome addon.
2024-09-29 13:11:02 +02:00
Jonas Jenwald
a7e1bf64c4
Merge pull request #18812 from Snuffleupagus/pr-15522-followup
Ensure that the CursorTools-buttons are disabled e.g. during editing (PR 15522 follow-up)
2024-09-28 19:20:56 +02:00
Jonas Jenwald
b1df164a26 Ensure that the CursorTools-buttons are disabled e.g. during editing (PR 15522 follow-up)
We disable any non-default CursorTool in PresentationMode and during Editing, since they don't make sense there and to prevent problems such as e.g. [bug 1792422](https://bugzilla.mozilla.org/show_bug.cgi?id=1792422).
Hence it seems like a good idea to *also* disable the relevant SecondaryToolbar-buttons, to avoid the user being surprised that the CursorTools-buttons do nothing if clicked.
2024-09-28 12:29:51 +02:00
calixteman
642b9a5ae6
Merge pull request #18793 from calixteman/bug1911980
[Editor] Avoid to have a selected stamp annotation on top of the secondary toolbar (bug 1911980)
2024-09-26 20:16:13 +02:00
calixteman
c46ac3f73f
Merge pull request #18800 from calixteman/popup_deletion
[Editor] When deleting an annotation with popup, then delete the popup too
2024-09-26 18:04:24 +02:00
Calixte Denizet
0382dd0e25 [Editor] When deleting an annotation with popup, then delete the popup too 2024-09-26 17:52:25 +02:00
Calixte Denizet
ec01af6b38 [Editor] Avoid to have a selected stamp annotation on top of the secondary toolbar (bug 1911980) 2024-09-26 17:48:02 +02:00