Commit Graph

17201 Commits

Author SHA1 Message Date
Tim van der Meij
eca40773b8
Merge pull request #16399 from timvandermeij/bump
Bump versions in `pdfjs.config`
2023-05-07 13:33:09 +02:00
Tim van der Meij
594ce65a47
Bump versions in pdfjs.config 2023-05-07 13:22:16 +02:00
Jonas Jenwald
4d3dfe254f
Merge pull request #16396 from Snuffleupagus/issue-16395
Improve handling of JPEG images with non-standard /Decode-entries (issue 16395)
2023-05-06 16:59:05 +02:00
Jonas Jenwald
722e5910e1 Improve handling of JPEG images with non-standard /Decode-entries (issue 16395)
The /Decode-implementation in the our JPEG decoder, i.e. `src/core/jpg.js`, seems to only handle *inverting* of images properly. To support arbitrary /Decode-entries correctly we'll always use the `PDFImage.decodeBuffer` method, even for "simple" JPEG images, which should be fine since non-default /Decode-entries aren't a very common occurrence.

*Please note:* This patch will lead to a little bit of movement in some existing test-cases, however it should be virtually imperceivable to the naked eye.
2023-05-06 13:55:39 +02:00
Tim van der Meij
3aa96e071b
Merge pull request #16394 from Snuffleupagus/no-invalid-remove-event-listener
Enable the `unicorn/no-invalid-remove-event-listener` ESLint plugin rule
2023-05-06 12:59:52 +02:00
Jonas Jenwald
b4aa10bb86 Enable the unicorn/no-invalid-remove-event-listener ESLint plugin rule
This rule won't only be helpful when writing code, but will also help during reviews to make sure that we don't accidentally leave any event-listeners attached; please see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-remove-event-listener.md
2023-05-06 09:08:11 +02:00
calixteman
da03d322ed
Merge pull request #16391 from calixteman/gv_open_in_app
[GeckoView] Add a button to download and open the file in an external app (bug 1829367)
2023-05-05 16:38:46 +02:00
Calixte Denizet
a652dc85e4 [GeckoView] Add a button to download and open the file in an external app (bug 1829367) 2023-05-05 15:52:15 +02:00
calixteman
f151a39d14
Merge pull request #16387 from calixteman/issue16384
[Annotations] Draw readonly annotations on their own canvas and show the HTML elements when there is a JS interaction (issue #16384)
2023-05-04 21:49:08 +02:00
Calixte Denizet
72da14f005 [Annotations] Draw readonly annotations on their own canvas and show the HTML elements when there is a JS interaction (issue #16384) 2023-05-04 20:08:32 +02:00
calixteman
a24e11a91c
Merge pull request #16106 from bungeman/improve_color_stop_detection
Better approximate gradient color stops
2023-05-04 19:48:57 +02:00
Jonas Jenwald
2fab583fb4
Merge pull request #16379 from Snuffleupagus/sidebar-forceRendering
Simplify the `PDFSidebar.#forceRendering` method
2023-05-04 13:12:16 +02:00
Jonas Jenwald
9dcc50402e Simplify the PDFSidebar.#forceRendering method
The fallback code-path has never really been used, since the `PDFSidebar` is only used in the default viewer (and has never been exposed in e.g. the COMPONENTS-build).
2023-05-04 12:51:30 +02:00
Jonas Jenwald
4931f293eb
Merge pull request #16374 from Snuffleupagus/thumbnail-styles
Simplify the thumbnail styling in the viewer
2023-05-04 12:24:58 +02:00
Jonas Jenwald
74c615b5b0 Remove unused canvas clean-up code in PDFThumbnailView.reset (PR 13357 follow-up) 2023-05-04 12:17:51 +02:00
Jonas Jenwald
1b6a83da4a Simplify the thumbnail styling in the viewer
This patch tries to simplify, and improve, the thumbnail styling:
 - For rendered thumbnails there's one less DOM-element per thumbnail, which can't hurt in longer documents.
 - Use CSS-variables to set the dimensions of all relevant DOM-elements at once.
 - Simplify the visual styling of the thumbnails, e.g. remove the border since the viewer no longer has visible borders around pages, since the relevant CSS-rules are quite old code.
   These changes also, at least in my opinion, makes the relevant CSS-rules much easier to understand and work with.
 - Make it easier to work on e.g. [bug 1690428](https://bugzilla.mozilla.org/show_bug.cgi?id=1690428) without affecting the other sidebarViews.
2023-05-04 12:17:49 +02:00
Jonas Jenwald
e89da6d940
Merge pull request #16375 from Snuffleupagus/pageViewsReady-tweak
Re-factor the `PDFViewer.pageViewsReady` getter slightly
2023-05-04 12:13:21 +02:00
Jonas Jenwald
667085ee33
Merge pull request #16368 from Snuffleupagus/rm-GlobalImageCache-addPageIndex
Inline the `addPageIndex` method in `GlobalImageCache.shouldCache`
2023-05-04 12:09:04 +02:00
Jonas Jenwald
001acfb5ac
Merge pull request #16381 from Snuffleupagus/rm-isStandardFont-prop
Remove the unused `isStandardFont` font-property (PR 15880 follow-up)
2023-05-04 00:30:05 +02:00
Jonas Jenwald
f31b320113
Merge pull request #12563 from Snuffleupagus/rm-SystemJS-worker
[api-minor] Remove SystemJS usage, in development mode, from the worker
2023-05-03 23:57:17 +02:00
calixteman
ade1e52227
Merge pull request #16380 from calixteman/hcm_annotation_canvas
Apply HCM filters on annotations which have their own canvas (bug 1830850)
2023-05-03 22:30:21 +02:00
Jonas Jenwald
24a75bda5d Remove the unused isStandardFont font-property (PR 15880 follow-up)
This property was added in PR 12726 specifically for use in the `getFontType` function, indirectly used by the `PDFDocumentProxy.stats` getter in the API.
In PR 15880 that functionality was removed, but I forgot to remove this now unused font-property.
2023-05-03 11:52:54 +02:00
Calixte Denizet
c07149a44f Apply HCM filters on annotations which have their own canvas (bug 1830850) 2023-05-03 10:19:59 +02:00
Jonas Jenwald
c8246b0720 Re-factor the PDFViewer.pageViewsReady getter slightly 2023-04-30 22:32:13 +02:00
Jonas Jenwald
88616f77ae Remove the closure from BitModel in the src/core/jpx.js file 2023-04-29 13:49:39 +02:00
Jonas Jenwald
b0a1af306d Simplify initialization of static class properties in the worker-thread
Now that we no longer depend on the old Babel version in SystemJS we can remove the `static get ...` work-arounds used to define constants, which leads to slightly more compact code.
2023-04-29 13:49:38 +02:00
Jonas Jenwald
d950b91c4e Introduce some logical assignment in the src/core/ folder 2023-04-29 13:49:37 +02:00
Jonas Jenwald
317abd6d07 Change the createPromiseCapability helper function into a PromiseCapability class
This is not only slightly more compact, but it also simplifies the handling of the `settled` getter.
2023-04-29 13:43:24 +02:00
Jonas Jenwald
f9c2a8d437 Introduce some optional chaining in the src/shared/ folder 2023-04-29 13:43:24 +02:00
Jonas Jenwald
94c2d08975 Revert "Add a getArrayLookupTableFactory helper function and use it to re-format src/core/{glyphlist, unicode}.js"
This reverts commit 56fa6d414c now that SystemJS is gone.
2023-04-29 13:43:24 +02:00
Jonas Jenwald
95bf9fc17f Remove SystemJS usage, in development mode, from the worker
Now that https://bugzilla.mozilla.org/show_bug.cgi?id=1247687 has landed in Firefox, we're able to use worker-modules during development :-)

This removes the final piece of SystemJS usage from the PDF.js library, thus allowing a fair bit of clean-up, and we now use *only* native `import`/`export` statements everywhere in development mode.
2023-04-29 13:43:24 +02:00
Tim van der Meij
797f8d3dca
Merge pull request #16370 from Snuffleupagus/publish-website-only-master
Limit the `publish_website.yml` work-flow to only the `master` branch (issue 16369)
2023-04-29 11:36:33 +02:00
Tim van der Meij
16017d6669
Merge pull request #16371 from Snuffleupagus/issue-16366
Include the entire `git` history in the work-flows (issue 16366)
2023-04-29 11:34:51 +02:00
Jonas Jenwald
7c1e505f6a Include the entire git history in the work-flows (issue 16366)
Without this change we're not able to correctly determine the version number, please refer to https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches
2023-04-29 10:50:37 +02:00
Jonas Jenwald
09edd6657f Limit the publish_website.yml work-flow to only the master branch (issue 16369)
This is a tentative patch, based on https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#using-filters
2023-04-28 10:31:52 +02:00
Jonas Jenwald
f28d915a42
Merge pull request #16362 from SebCorbin/update-types
Update type documentations for #16307, #16359
2023-04-28 10:19:08 +02:00
Jonas Jenwald
bb1228cb64 Inline the addPageIndex method in GlobalImageCache.shouldCache
When the `GlobalImageCache` implementation originally landed, back in PR 11912, the image handling was slightly more complex (with e.g. browser-decoding of some JPEG images). At this point it no longer seems necessary to manually handle pageIndexes in this way, and we should be able to simply inline that in the `GlobalImageCache.shouldCache` method.
2023-04-28 09:40:32 +02:00
Sebastien Corbin
d18b9ee472 Update type documentations for #16307 and #16359 2023-04-28 09:28:21 +02:00
Marco Castelluccio
9eea9993df
Merge pull request #16364 from timvandermeij/github-pages
Introduce a GitHub Actions workflow for publishing the website
2023-04-27 23:17:16 +02:00
calixteman
de42ecb59f
Merge pull request #16365 from calixteman/chmod_1
Chmod ugo-x gv-toolbarButton-download.svg
2023-04-27 20:33:16 +02:00
Calixte Denizet
263ef59fc7 Chmod ugo-x gv-toolbarButton-download.svg 2023-04-27 20:27:27 +02:00
Tim van der Meij
30ca27ac48
Introduce a GitHub Actions workflow for publishing the website
This commit migrates this functionality away from the bots. Nowadays
it's possible to build and deploy the website to GitHub Pages directly
through the GitHub Actions, which provides a nice simplication of the
process. Not only does this remove the requirement to have a `gh-pages`
branch in the repository, it also avoids the complexity of having to
configure the workflow to commit to Git branches and allows us to remove
the Git committing code from the Gulpfile.

Note that deploying directly though GitHub Actions workflows needs to be
enabled in the repository settings, but this is easy and well documented
on the link below.

The following resources are relevant for this patch:

- Enabling deployment to GitHub Pages directly through GitHub Actions:
  https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow
- Uploading GitHub Pages artifacts example:
  https://github.com/actions/upload-pages-artifact#usage
- Deploying GitHub Pages artifacts example:
  https://github.com/actions/deploy-pages#usage
2023-04-27 19:18:03 +02:00
calixteman
4dee3b83d5
Merge pull request #16344 from calixteman/intermittent_integration_test
Fix two intermittents issues in integration tests
2023-04-27 17:18:41 +02:00
Jonas Jenwald
cefa8c601a
Merge pull request #16361 from timvandermeij/jsdoc-pdfvieweroptions
Declare the `linkService` and `l10n` properties as optional in the `PDFViewerOptions` documentation
2023-04-27 17:16:32 +02:00
Tim van der Meij
8259fb4d2f
Declare the linkService and l10n properties as optional in the PDFViewerOptions documentation
Both properties have a fallback to `SimpleLinkService` respectively
`NullL10n` if no other value is provided explicitly.
2023-04-27 15:39:29 +02:00
Tim van der Meij
34ee77396c
Merge pull request #16356 from Snuffleupagus/issue-16355
Update the styling of the findbar `findMsg`-element (issue 16355)
2023-04-27 14:23:18 +02:00
Tim van der Meij
0ee0fcc6b3
Merge pull request #16350 from Snuffleupagus/dist-rm-lib
[api-minor] Stop including the "lib"-build in the `pdfjs-dist` repository
2023-04-27 14:01:55 +02:00
Tim van der Meij
a86265f7b7
Merge pull request #16354 from Snuffleupagus/crypto-less-stringToBytes
Avoid some repeated `stringToBytes`-calls in the `src/core/crypto.js` file
2023-04-27 14:00:50 +02:00
Tim van der Meij
13b168f1bb
Merge pull request #16357 from Snuffleupagus/network-rm-getXhr
Remove the unused `getXhr`-option in the `NetworkManager` constructor
2023-04-27 13:59:23 +02:00
Jonas Jenwald
924a8901d1 Remove the unused getXhr-option in the NetworkManager constructor
Originally this file was shared, using pre-processor statements, between the generic PDF.js library and the *built-in* Firefox PDF Viewer. In the latter case the `getXhr`-option is being used, see https://searchfox.org/mozilla-central/rev/f32d5f3949a3f4f185122142b29f2e3ab776836e/toolkit/components/pdfjs/content/PdfStreamConverter.sys.mjs#612-621
2023-04-27 11:32:32 +02:00