Commit Graph

17732 Commits

Author SHA1 Message Date
Jonas Jenwald
8bd45cb260 [Editor] Change the resize cursors to bidirectional variants
When resizing an editor we're currently using unidirectional cursors, please refer to https://developer.mozilla.org/en-US/docs/Web/CSS/cursor
Given that editors can (generally) be resized to become either smaller or larger, it seems overall more appropriate to use bidirectional cursors to make this clearer to the user.

Note that as mentioned in the MDN article some environments, which seems to apply to e.g. Windows 11, doesn't differentiate between the two cursor formats and simply use bidirectional ones unconditionally.

One additional benefit of these changes is that the relevant CSS rules become slightly more compact.
2023-08-06 22:09:15 +02:00
Tim van der Meij
de1f31aae8
Merge pull request #16794 from Snuffleupagus/CSS-round
Use the `round` CSS function in the `setLayerDimensions` helper function
2023-08-06 13:22:07 +02:00
Tim van der Meij
b67c60922f
Merge pull request #16790 from Snuffleupagus/addGlobalExports
Attempt to expose e.g. `pdfjsLib` globally regardless of how the library is imported (issue 16778)
2023-08-06 12:58:58 +02:00
Tim van der Meij
64b33da236
Merge pull request #16795 from Snuffleupagus/update-packages
Update packages and translations
2023-08-06 12:48:30 +02:00
Jonas Jenwald
1182f4965d Update l10n files 2023-08-06 09:25:38 +02:00
Jonas Jenwald
d50237da3c Update npm packages 2023-08-06 09:25:30 +02:00
Jonas Jenwald
e414dfcff7 Use the round CSS function in the setLayerDimensions helper function
This has now been enabled unconditionally in Firefox, see https://bugzilla.mozilla.org/show_bug.cgi?id=1814589

For the `page`-containers in the viewer, this patch should restore the behaviour prior to PR 15770; see e.g. https://github.com/mozilla/pdf.js/pull/15770/files#diff-c48e3561004f5db8f11d5ebab2fd661591222ba911cb4173fbced15f026bac6bL182-L183
Note that these changes this will lead to a tiny bit of movement in some `text` and `annotations` reference tests.

Please find additional information at https://developer.mozilla.org/en-US/docs/Web/CSS/round
2023-08-04 14:33:06 +02:00
calixteman
399475247f
Merge pull request #16781 from calixteman/editor_rewrite_dragging
[Editor] Refactor dragging and dropping an editor (bug 1802895, bug 1844618)
2023-08-03 15:38:12 +02:00
Calixte Denizet
b59b1a81a9 [Editor] Refactor dragging and dropping an editor (bugs 1802895, 1844618)
It'll help to have a full control on what's happening when moving an editor.
2023-08-03 14:47:16 +02:00
calixteman
be29a4dce5
Merge pull request #16786 from calixteman/editor_resizers_blur
[Editor] Stop the resize session when the window is blurred
2023-08-03 13:47:11 +02:00
Jonas Jenwald
42e6243ebf Attempt to expose e.g. pdfjsLib globally regardless of how the library is imported (issue 16778)
We obviously don't want to re-introduce any `require` usage in e.g. the viewer, since we should strive to only use native `import` statements wherever possible.[1]
Hopefully exposing e.g. the library globally in more cases won't break anything, however it's somewhat difficult for me to imagine all the ways in which third-party users may be accessing the PDF.js library. (Given the lack of a runnable test-case in the issue, I also cannot guarantee that this is enough to fully address the problem.)

---
[1] Ideally we should probably not rely on e.g. `pdfjsLib` being globally available in the *built* viewer, and rather always `import` the library instead.
Unfortunately this would require larger (possibly breaking) changes in the builds that we provide, however note that Firefox only recently got support for `import` in workers and that Webpack still only have *experimental* support for outputting "proper" modules.
2023-08-03 12:53:27 +02:00
Calixte Denizet
99c62f9248 [Editor] Stop the resize session when the window is blurred 2023-08-03 10:51:47 +02:00
calixteman
2747928a54
Merge pull request #16784 from calixteman/editor_fix_rescale_svg
[Editor] Use a getter and not a function for the _checkIfSVGFitsInCanvas (bug 1846727)
2023-08-03 10:16:28 +02:00
Calixte Denizet
fcfb2457bc [Editor] Use a getter and not a function for the _checkIfSVGFitsInCanvas (bug 1846727)
It's a followup of #16780.
2023-08-03 09:46:31 +02:00
calixteman
0725b6299f
Merge pull request #16780 from calixteman/editor_fix_rescale_svg
[Editor] Let SVG images be resized horizontally/vertically without keeping the aspect ratio (bug 1846727)
2023-08-02 14:21:21 +02:00
Calixte Denizet
556f42fe52 [Editor] Let SVG images be resized horizontally/vertically without keeping the aspect ratio (bug 1846727) 2023-08-02 12:43:39 +02:00
Jonas Jenwald
e6728f94f4
Merge pull request #16779 from Snuffleupagus/deprecate-getJavaScript
[api-minor] Deprecate the `PDFDocumentProxy.getJavaScript` method
2023-08-01 20:58:36 +02:00
calixteman
4735ed8f16
Merge pull request #16776 from calixteman/gv_print_or_save
[GeckoView] Allow to query pdf.js to know if we can avoid to print a pdf (bug 1846296)
2023-08-01 15:21:10 +02:00
Calixte Denizet
8bd4a18190 [GeckoView] Allow to query pdf.js to know if we can avoid to print a pdf (bug 1846296) 2023-08-01 15:15:04 +02:00
Jonas Jenwald
64e8557fb5 [api-minor] Deprecate the PDFDocumentProxy.getJavaScript method
This method is very old, however with the exception of the auto-print hack (when scripting is disabled) in the viewer it's never actually been used.

Most likely the idea with `PDFDocumentProxy.getJavaScript` was that it'd be useful if scripting support was added, however it turned out that it was a bit too simplistic and instead a number of new methods were added for the scripting use-cases.
2023-08-01 09:02:05 +02:00
calixteman
5b8f680480
Merge pull request #16029 from calixteman/bug1815196
[api-minor] Don't print hidden annotations (bug 1815196)
2023-07-31 20:14:43 +02:00
Calixte Denizet
71960bea64 Don't print hidden annotatons (bug 1815196)
and handle correctly the NoView and NoPrint flags when they're changed
from JS.
2023-07-31 13:04:15 +02:00
calixteman
ce9f94848c
Merge pull request #16773 from calixteman/editor_stamp_input_filter
[Editor] Limit image types to the ones supported by the browser (bug 1846230)
2023-07-31 11:06:21 +02:00
Calixte Denizet
f2bf0ccc4f [Editor] Limit image types to the ones supported by the browser (bug 1846230) 2023-07-31 11:01:28 +02:00
Jonas Jenwald
0e6d141edf
Merge pull request #16771 from Snuffleupagus/gv-dialog-css-vars
[GeckoView] Add missing CSS variables for the dialog functionality
2023-07-30 19:45:09 +02:00
calixteman
621c92dbdd
Merge pull request #16766 from calixteman/fix_willprint
Make sure WillPrint ran before starting printing
2023-07-30 18:37:26 +02:00
Jonas Jenwald
ffb932b84a [GeckoView] Add missing CSS variables for the dialog functionality
Without this patch the password dialog is pretty difficult to use in the GeckoView-viewer, because of a number of missing CSS variables.

*Please note:* This patch makes no effort at actually styling the dialog to better suite the overall look of the GeckoView-viewer, but focuses solely on making it actually usable (since password protected PDF documents are somewhat rare).
2023-07-30 17:23:21 +02:00
Jonas Jenwald
02aa561003 Ensure that the password dialog is always closed with the document
If the current PDF document is closed while the password dialog is open, e.g. manually by calling `PDFViewerApplication.close()` from the console, the password dialog wouldn't be closed as intended.

*Please note:* This could only affect the GENERIC viewer, although it's very unlikely to ever happen, since that's the only one that supports opening more than one PDF document.
2023-07-30 17:13:39 +02:00
Tim van der Meij
f7155ad8fa
Merge pull request #16770 from Snuffleupagus/fix-baseVersion
Fix typo in the `baseVersion` commit hash (PR 16769 follow-up)
2023-07-30 16:58:53 +02:00
Jonas Jenwald
1ca3bbd2b6 Fix typo in the baseVersion commit hash (PR 16769 follow-up)
Looking at the demo-viewer I noticed that the version number seems to be stuck at version `3.10.0` despite a couple of PRs having landed since the version bump in PR 16769.

Searching for the current `baseVersion` doesn't find an actual commit, see https://github.com/search?q=repo%3Amozilla%2Fpdf.js+1ef6fbc525856318e78a6035b200ba1c6ec02d491&type=commits

However, looking at the commit hash it seems to be too long and removing the trailing `1` appears to fix things; see https://github.com/search?q=repo%3Amozilla%2Fpdf.js+1ef6fbc525856318e78a6035b200ba1c6ec02d49&type=commits
2023-07-30 15:21:49 +02:00
calixteman
7bdd3491b0
Merge pull request #16767 from calixteman/color_storage
Add the color changes in the annotation storage
2023-07-30 15:17:27 +02:00
Calixte Denizet
d16d1f0d23 Add the color changes in the annotation storage 2023-07-30 14:03:27 +02:00
Tim van der Meij
8ad0f08099
Merge pull request #16769 from timvandermeij/bump
Bump versions in `pdfjs.config`
2023-07-30 13:17:48 +02:00
Tim van der Meij
445ffa920a
Bump versions in pdfjs.config 2023-07-30 13:13:09 +02:00
Calixte Denizet
8439e11160 Make sure WillPrint ran before starting printing 2023-07-30 12:38:46 +02:00
Tim van der Meij
1ef6fbc525
Merge pull request #16768 from Snuffleupagus/pr-15335-followup
Ensure that failing to open the password dialog once won't permanently disable it (PR 15335 follow-up)
2023-07-30 12:18:49 +02:00
Jonas Jenwald
930cbc4d27 Make the passwordCapability field, in WorkerTransport, actually private as intended 2023-07-30 11:45:35 +02:00
Jonas Jenwald
81dfa61777 Ensure that failing to open the password dialog once won't permanently disable it (PR 15335 follow-up)
*Please note:* This situation should never happen in practice, but it nonetheless cannot hurt to fix this.

If the `PasswordPrompt.open` method would ever be called synchronously back-to-back *and* if opening of the dialog fails the first time, then the second invocation would remain pending indefinitely since we just clear out the capability.
2023-07-30 08:46:11 +02:00
Tim van der Meij
7ae5a0fef7
Merge pull request #16731 from Snuffleupagus/rm-useOnlyCssZoom
[api-minor] Replace the `useOnlyCssZoom` option with `maxCanvasPixels = 0` instead (PR 16729 follow-up)
2023-07-29 14:07:45 +02:00
Jonas Jenwald
0ee2a352ec [api-minor] Replace the useOnlyCssZoom option with maxCanvasPixels = 0 instead (PR 16729 follow-up)
Given that the `useOnlyCssZoom` option is essentially just a special-case of the `maxCanvasPixels` functionality, we can combine the two options in order to simplify the overall implementation.
Note that the `useOnlyCssZoom` functionality was only ever used, by default, in the PDF Viewer for the B2G/FirefoxOS project (which was abandoned years ago).
2023-07-29 13:58:03 +02:00
Tim van der Meij
2a77f0877c
Merge pull request #16765 from Snuffleupagus/bug-858128-test
Add an `eq` test for bug 858128
2023-07-29 13:48:30 +02:00
Tim van der Meij
aea13b4478
Merge pull request #16744 from Snuffleupagus/app-small-simplifications
A few small `web/app.js` simplifications
2023-07-29 13:41:01 +02:00
Jonas Jenwald
69a9d777d7 Add an eq test for bug 858128
The ten year old bug 858128 was recently fixed upstream, see https://bugzilla.mozilla.org/show_bug.cgi?id=858128#c25, and it seems like a good idea for us to add a test-case to help catch any future regressions here.
2023-07-29 12:37:58 +02:00
calixteman
cfd179f23f
Merge pull request #16163 from Snuffleupagus/bug-1810111
[GeckoView] Bundle the Firefox printing code in the viewer (bug 1810111)
2023-07-28 14:28:57 +02:00
Jonas Jenwald
e77c7f336d [GeckoView] Bundle the Firefox printing code in the viewer (bug 1810111)
This may not be enough, on its own, to completely fix [bug 1810111](https://bugzilla.mozilla.org/show_bug.cgi?id=1810111) however it's impossible for printing to work in GeckoView without this patch.
2023-07-28 14:10:40 +02:00
calixteman
0b715e2a73
Merge pull request #16762 from calixteman/editor_focus
[Editor] When an editor is unselected give the focus to the current page
2023-07-27 21:31:24 +02:00
Calixte Denizet
9d576d5097 [Editor] When an editor is unselected give the focus to the current page
Follow-up of #16756.
2023-07-27 21:12:26 +02:00
Jonas Jenwald
0ad5a5551a
Merge pull request #16760 from Snuffleupagus/issue-16759
Avoid eagerly matching "trailer"-strings when searching for incomplete objects in `XRef.indexObjects` (issue 16759, PR 15854 follow-up, bug 1845762)
2023-07-27 18:39:50 +02:00
Jonas Jenwald
d6c0950389 Avoid eagerly matching "trailer"-strings when searching for incomplete objects in XRef.indexObjects (issue 16759, PR 15854 follow-up, bug 1845762)
When searching for "endobj"-operators, make sure that we don't accidentally match a "trailer"-string in /Content-streams without /Filter-entries (i.e. streams that contain "raw" and thus human-readable data).
2023-07-27 17:57:12 +02:00
Jonas Jenwald
5560643597
Merge pull request #16758 from Snuffleupagus/cMapUrl-standardFontDataUrl-validation
Tweak the `useWorkerFetch` default value checks (PR 15879 follow-up)
2023-07-27 17:52:57 +02:00