Commit Graph

16691 Commits

Author SHA1 Message Date
calixteman
d6f63b5fb7
Merge pull request #15907 from calixteman/bug1809080
Fix pinch-to-zoom on a macbook trackpad (bug 1809080)
2023-01-09 15:41:25 +01:00
Calixte Denizet
0c1cf2c237 Fix pinch-to-zoom on a macbook trackpad (bug 1809080) 2023-01-09 13:48:46 +01:00
Jonas Jenwald
067d3b70aa
Merge pull request #15906 from timvandermeij/nodejs
Upgrade Node.js to version 18 in the CI workflow
2023-01-08 20:32:22 +01:00
Tim van der Meij
588447aa90
Upgrade Node.js to version 18 in the CI workflow
Version 16 that we used before is now in maintenance mode, so we should
upgrade to the most recent LTS version. For more information on the
Node.js release schedule please refer to
https://github.com/nodejs/release#release-schedule.
2023-01-08 17:35:08 +01:00
Tim van der Meij
ca668dfd41
Merge pull request #15904 from Snuffleupagus/tweak-sidebarContent-background
Remove the `background-color` of the sidebarContent (PR 15850 follow-up)
2023-01-08 14:21:15 +01:00
Jonas Jenwald
8ab5476cb8 Remove the background-color of the sidebarContent (PR 15850 follow-up)
After the changes in PR 15850, the `background-color` of the sidebar is now unnecessarily dark in the light-theme. Hence, we can simply remove this CSS rule to improve things overall (and these changes don't affect the dark-theme much at all).
This is even an overall consistency improvement, given the existing `--sidebar-narrow-bg-color` values.
2023-01-08 14:06:02 +01:00
Jonas Jenwald
173bd88dbd
Merge pull request #15903 from mozilla/dependabot/npm_and_yarn/json5-1.0.2
Bump json5 from 1.0.1 to 1.0.2
2023-01-08 11:33:15 +01:00
dependabot[bot]
f51e85e84b
Bump json5 from 1.0.1 to 1.0.2
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-08 06:05:38 +00:00
calixteman
fcaeb5db88
Merge pull request #15901 from calixteman/15289_followup
Avoid null ExpansionFactor in type1 fonts (follow-up of #15289)
2023-01-07 18:20:31 +01:00
Jonas Jenwald
74e4b515c5
Merge pull request #15897 from Snuffleupagus/issue-15893
Support parsing encrypted documents in `XRef.indexObjects` (issue 15893)
2023-01-07 16:55:41 +01:00
Calixte Denizet
c170245fc0 Avoid null ExpansionFactor in type1 fonts (follow-up of #15289) 2023-01-07 16:25:24 +01:00
calixteman
e1f7355de4
Merge pull request #15900 from calixteman/15289
Set ExpansionFactor to 0.06 when it's equals to 0 in the private dict of CFF fonts
2023-01-07 16:13:33 +01:00
Calixte Denizet
e565e455e2 Set ExpansionFactor to 0.06 when it's equals to 0 in the private dict of CFF fonts 2023-01-07 14:53:13 +01:00
Tim van der Meij
d6984f9395
Merge pull request #15899 from Snuffleupagus/tweak-toolbar-border-color
Tweak the `--toolbar-border-color` CSS variable (PR 15850 follow-up)
2023-01-07 13:53:35 +01:00
Jonas Jenwald
bd84bf4ebd Tweak the --toolbar-border-color CSS variable (PR 15850 follow-up)
After the changes in PR 15850, the toolbar-border is now quite difficult to spot in the light-theme. Hence, let's tweak it slightly to improve things.
2023-01-07 13:44:21 +01:00
Tim van der Meij
38e46e7614
Merge pull request #15850 from calixteman/15836
Remove shadow around each pages (fix issue #15836)
2023-01-07 13:29:41 +01:00
Tim van der Meij
69113f08f2
Merge pull request #15887 from Snuffleupagus/rm-setPDFNetworkStreamFactory
Inline the `setPDFNetworkStreamFactory` functionality in `src/display/api.js`
2023-01-07 13:16:23 +01:00
Tim van der Meij
b428824269
Merge pull request #15879 from Snuffleupagus/useWorkerFetch-defaults
[api-minor] Improve the `useWorkerFetch` default value checks
2023-01-07 13:13:25 +01:00
calixteman
91c44ec7ab
Merge pull request #15857 from calixteman/delay_loading_icon
Delay the loading icon display
2023-01-06 16:09:32 +01:00
Jonas Jenwald
1d5de9f4f4 Inline the setPDFNetworkStreamFactory functionality in src/display/api.js
Given that this is internal functionality, not exposed in the official API, it's not entirely clear (at least to me) why we can't just initialize this directly in `src/display/api.js` instead.
When testing both the development viewer and all the ways in which we run tests, everthing still appears to work just fine with this patch.
2023-01-06 13:23:07 +01:00
Jonas Jenwald
7d94fdeb48 Support parsing encrypted documents in XRef.indexObjects (issue 15893)
*Please note:* The reduced test-case is *not* a perfect reproduction of the original PDF document, since this one fails to open in e.g. Adobe Reader, but I do believe that it captures the most important points here.

For corrupt *and* encrypted PDF documents, it's possible that only some trailer dictionaries actually contain an /Encrypt-entry. Previously we'd could easily miss that, since we generally pick the first not obviously corrupt trailer dictionary, and the solution implemented here is to simply pre-parse all trailer dictionaries to see if there's any /Encrypt-entries.
2023-01-06 13:09:37 +01:00
Calixte Denizet
dd29f8705c Delay the loading icon display
In most of the cases, showing the loading icon is useless because
it's for a very short time, consequently it doesn't bring any useful
information for the user.
After a delay (400ms), the icon is shown in order to inform the user
that the viewer isn't stuck but it's doing something.
2023-01-06 12:28:32 +01:00
calixteman
e36564668b
Merge pull request #15896 from calixteman/gv_update_matches_count
[GV] Add an option in the find controller to update matches count only when the last page is reached (bug 1803188).
2023-01-06 12:11:20 +01:00
Calixte Denizet
661f425934 [GV] Add an option in the find controller to update matches count only when the last page is reached (bug 1803188).
In GeckoView, on an event, a callback must be executed with the result of an action,
but the callback can be used only one time.
So for each FindInPage event, we must trigger only one matches count update.
2023-01-06 10:56:26 +01:00
calixteman
8a0ca04399
Merge pull request #15894 from calixteman/gv_disable_print
[GV] Remove print stuff because window.print isn't implemented (bug 1808668)
2023-01-05 13:43:53 +01:00
Calixte Denizet
409c8b344f [GV] Remove print stuff because window.print isn't implemented (bug 1808668) 2023-01-05 13:02:29 +01:00
calixteman
7da591048c
Merge pull request #15892 from calixteman/fix_autoprint
[JS] UserActivation must be enabled before running document actions
2023-01-04 21:50:29 +01:00
Calixte Denizet
dea2471e96 [JS] UserActivation must be enabled before running document actions
else auto-print is broken (it's a regression from patch #15822).
2023-01-04 21:26:36 +01:00
Jonas Jenwald
1e1a2fce49
Merge pull request #15891 from Snuffleupagus/accumulateTicks
Reduce duplication in the `accumulateWheelTicks`/`accumulateTouchTicks` methods (PR 15886 follow-up)
2023-01-04 19:30:47 +01:00
Jonas Jenwald
66a3aa28fd Reduce duplication in the accumulateWheelTicks/accumulateTouchTicks methods (PR 15886 follow-up)
It just occurred to me that we can reduce some duplication by having the, virtually identical, `accumulateWheelTicks`/`accumulateTouchTicks` methods use a common helper instead that takes advantage of [bracket notation](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics#bracket_notation).
2023-01-04 18:19:39 +01:00
calixteman
4faf927030
Merge pull request #15886 from calixteman/pinch_to_zoom
[api-minor] Add the pinch-to-zoom feature (bug 1677933)
2023-01-04 17:20:29 +01:00
Calixte Denizet
d6b7a1f034 [api-minor] Add the pinch-to-zoom feature (bug 1677933) 2023-01-04 16:00:46 +01:00
Jonas Jenwald
da1365a309
Merge pull request #15885 from Snuffleupagus/font-update-type-subtype
Update the `type`/`subtype` at the end of font parsing
2023-01-02 17:18:05 +01:00
Jonas Jenwald
6bdbb5c5ca Update the type/subtype at the end of font parsing
This fixes a warning reported by CodeQL, and should also make general sense given that we parse the font-data to determine the *actual* `type`/`subtype` rather than trusting the PDF document.
2023-01-02 16:21:48 +01:00
Jonas Jenwald
42aa08563b
Merge pull request #15880 from Snuffleupagus/rm-docStats
[api-minor] Remove the `PDFDocumentProxy.stats` getter (PR 15758 follow-up)
2023-01-02 16:03:53 +01:00
Jonas Jenwald
1ba6e9437c
Merge pull request #15884 from Snuffleupagus/enable-defaultZoomDelay
Enable the `defaultZoomDelay` option/preference unconditionally, and other (small) improvements
2023-01-02 15:38:29 +01:00
Calixte Denizet
685b5866e4 Remove shadow around each pages (fix issue #15836) 2023-01-02 14:58:53 +01:00
Jonas Jenwald
9089e75cce Validate the options before adding the ResizeObserver in the PDFViewer constructor (PR 15830 follow-up)
In the GENERIC viewer, it doesn't make sense to register the `ResizeObserver` if the `container`/`viewer` options are not valid.
2023-01-02 14:52:00 +01:00
Jonas Jenwald
0860a5b168 Ensure that a document is loaded in PDFViewer.{increaseScale, decreaseScale} (PR 14053 follow-up)
This was always "wrong", since these methods (just like all the zoom-related ones) don't make sense unless there's an active document.
2023-01-02 14:05:33 +01:00
Jonas Jenwald
9f50b0af37 Enable the defaultZoomDelay option/preference unconditionally (PR 15812 follow-up)
This option/preference was disabled in GENERIC builds, see PR 15812, to avoid landing it *just before* a new release. Hence it should be fine to enable this now.
2023-01-02 14:00:16 +01:00
calixteman
e7cea29ad4
Merge pull request #15883 from calixteman/infinite_loop_search_diacritic
Avoid an infinite loop when searching for a single diacritic
2023-01-02 13:13:32 +01:00
Calixte Denizet
69c88477a9 Avoid an infinite loop when searching for a single diacritic 2023-01-02 12:27:07 +01:00
Jonas Jenwald
1a69d537c1 [api-minor] Limit the PDFDocumentLoadingTask.onUnsupportedFeature functionality to GENERIC builds (PR 15758 follow-up)
This was deprecated in PR 15758 but it's unfortunately quite difficult to tell if third-party users are depending on this, e.g. to implement custom error reporting, and if so to what extent.
However, thanks to the pre-processor we can limit *most* of this code to GENERIC builds which still seem like a worthwhile change.

These changes reduce the bundle size of the Firefox PDF Viewer by 3.8 kB in total.
2023-01-01 17:53:12 +01:00
Jonas Jenwald
0c1fb4e740 [api-minor] Remove the PDFDocumentProxy.stats getter (PR 15758 follow-up)
This was deprecated in PR 15758 and given that it's quite unlikely that any third-party users are relying on this functionality, since it was only ever added to support telemetry reporting in the Firefox PDF Viewer, it should hopefully be fine to remove this fairly quickly.

These changes reduce the bundle size of the Firefox PDF Viewer by 4.5 kB in total.
2023-01-01 17:06:47 +01:00
Jonas Jenwald
2c57a4232c [api-minor] Improve the useWorkerFetch default value checks
Given that the Fetch API only supports the http/https protocols, worker-thread fetching of CMaps and Standard-fonts may thus fail in certain cases. To improve the default behaviour we'll now also check that the `cMapUrl` and `standardFontDataUrl` options are appropriate, except in Firefox where this should always work.
2023-01-01 14:48:28 +01:00
Tim van der Meij
1e3e2defe4
Merge pull request #15878 from timvandermeij/bump
Bump versions in `pdfjs.config`
2023-01-01 14:44:41 +01:00
Tim van der Meij
195846a716
Bump versions in pdfjs.config 2023-01-01 14:35:58 +01:00
Tim van der Meij
3fd2a35482
Merge pull request #15874 from Snuffleupagus/progressBar-decouple-colors
Decouple the loadingBar `background-color` from the rest of the viewer
2022-12-31 15:14:59 +01:00
Jonas Jenwald
c791e01bfc
Merge pull request #15875 from Snuffleupagus/viewer-name-consistency
Improve name consistency in the viewer (PR 15812 follow-up)
2022-12-29 11:52:25 +01:00
Jonas Jenwald
88432a0e3f Improve name consistency in the viewer (PR 15812 follow-up)
This tweaks a few name that originated in PR 15812, to improve overall consistency:
 - Use the `drawingDelay` parameter-name in all methods that accept a delay.
 - Use the `postponeDrawing` variable-name in all relevant methods.
2022-12-28 13:26:01 +01:00