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

19543 commits

Author SHA1 Message Date
Tim van der Meij
2e94511330
Merge pull request #17934 from calixteman/warn_invalid_name
Warn when a non-embedded font has an invalid name
2024-04-12 14:15:02 +02:00
Calixte Denizet
acc56491c9 Warn when a non-embedded font has an invalid name
It can be helpful to find out some heuristics when trying
to find a substitution font.
2024-04-12 13:59:18 +02:00
Tim van der Meij
e005e6ecdd
Merge pull request #17933 from Snuffleupagus/pr-17464-followup
Fix resetting of cursor-tools when closing the document (PR 17464 follow-up)
2024-04-12 13:32:52 +02:00
Tim van der Meij
2d885e2862
Merge pull request #17930 from calixteman/issue17929
Remove the tag for missing font subset when trying to find a substitution
2024-04-12 13:27:32 +02:00
Jonas Jenwald
60832fee27 Fix resetting of cursor-tools when closing the document (PR 17464 follow-up)
With the removal of the "secondarytoolbarreset" event in PR 17464 resetting of cursor-tools state accidentally broke.
2024-04-12 13:16:44 +02:00
Tim van der Meij
f0ad4f00ce
Merge pull request #17927 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-04-12 13:12:56 +02:00
Tim van der Meij
355432fc71
Merge pull request #17925 from timvandermeij/web-history-private-methods
Convert the history code to use proper private methods
2024-04-12 13:12:30 +02:00
Calixte Denizet
52ea2333b3 Remove the tag for missing font subset when trying to find a substitution
Fixes #17929.
2024-04-11 20:34:28 +02:00
Tim van der Meij
ac7bd17cf8
Update translations to the most recent versions 2024-04-11 19:48:32 +02:00
Tim van der Meij
5db84e7930
Fix vulnerabilities in dependency versions
This patch is generated automatically using `npm audit fix`.
2024-04-11 19:48:31 +02:00
Tim van der Meij
b379b0e999
Upgrade eslint-plugin-unicorn to version 52.0.0
This is a major version bump, but the changelog at
https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v52.0.0
doesn't indicate any breaking changes that should impact us.
2024-04-11 19:48:31 +02:00
Tim van der Meij
28962da91b
Update dependencies to the most recent versions 2024-04-11 19:48:31 +02:00
Tim van der Meij
a45aec6393
Convert the history code to use proper private methods
This allows us to get rid of the `@private` JSDoc comments, which were
used to convey intent back when proper private methods could not be used
yet in JavaScript. This improves code readability/maintenance and enables
better usage validation by tooling such as ESlint.
2024-04-11 15:17:30 +02:00
Tim van der Meij
e78ce74b5f
Merge pull request #17924 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2024-04-11 14:52:11 +02:00
Tim van der Meij
09a8b981f2
Bump the stable version in pdfjs.config 2024-04-11 14:47:17 +02:00
Tim van der Meij
fcb76a78dd
Merge pull request #17893 from timvandermeij/find-integration-test
Fix the "must highlight text in the right position" integration test
2024-04-11 14:10:01 +02:00
Tim van der Meij
253a7333d8
Fix the "must highlight text in the right position" integration test
This commit implements the following improvements for the test:

- Replace the hardcoded highlight padding with a dynamic calculation. It
  turns out that the amount of padding can differ per system, possibly
  due to e.g. local (font) settings, which could cause the test to fail.
  The test now no longer implicitly depends on the environment.
- Remove the page offset subtraction. It's only needed for one assertion,
  and we can simply add the page offset there once.
- Improve the "magic" numbers in the test. The number 5 is removed now
  that the padding calculation made it obsolete, the number 28 is changed
  to 30 because that's the actual value in the PDF data and the number 4
  is explained a bit more to state that the space also counts as a glyph.
- Annotate the steps and checks to improve readability of the test and
  to explain why certain calculations have to be performed.
2024-04-11 13:42:08 +02:00
Tim van der Meij
f4b5ec930f
Merge pull request #17913 from timvandermeij/gulp-github-actions
Don't install `gulp-cli` globally in the GitHub Actions workflows
2024-04-11 12:26:46 +02:00
Tim van der Meij
d70caca3e2
Merge pull request #17915 from timvandermeij/lint-waitfortimeout
Implement a linting rule to discourage using `waitForTimeout` for new usages
2024-04-11 12:19:36 +02:00
Jonas Jenwald
f3b03e5c4b
Merge pull request #17917 from Snuffleupagus/showAll-rtl
Fix the RTL-rule for the `editorHighlightShowAll` button, such that it works outside of the Firefox PDF Viewer
2024-04-10 12:55:30 +02:00
Jonas Jenwald
e9604e5f3d
Merge pull request #17916 from Snuffleupagus/stamp-icon-fill
Tweak the `fill`-value of the Stamp-icon to work better in non-Firefox browsers
2024-04-10 12:54:55 +02:00
Jonas Jenwald
3596a03279 Fix the RTL-rule for the editorHighlightShowAll button, such that it works outside of the Firefox PDF Viewer
These CSS rules were imported straight from mozilla-central, and contains a property that causes the RTL-rule to be skipped everywhere else (even when using the development viewer in Firefox).
2024-04-10 11:35:04 +02:00
Jonas Jenwald
8a1511cdd5 Tweak the fill-value of the Stamp-icon to work better in non-Firefox browsers
Currently this icon is invisible in e.g. Google Chrome, so update the `fill`-value to be more inline with the other editor-icons.
2024-04-10 11:14:41 +02:00
calixteman
77ee914bd6
Merge pull request #17882 from calixteman/bug1889122
Use the string value of the field when calling the Format callback (bug 1889122)
2024-04-10 09:40:54 +02:00
calixteman
2c7ae50c4b
Merge pull request #17908 from calixteman/issue17906
Don't render annotations with a null dimension
2024-04-10 09:33:30 +02:00
Calixte Denizet
b643c0fcfb Use the string value of the field when calling the Format callback (bug 1889122) 2024-04-09 22:52:11 +02:00
Tim van der Meij
d4633ba478
Implement a linting rule to discourage using waitForTimeout for new tests
The `waitForTimeout` function should not be used anymore and only exists
for old usages that have to be rewritten, but there was nothing in place
to signal this. This commit therefore implements a linting rule, specific
to the integration tests, to make it clear that this function should no
longer be used. We exclude the old usages from it because we are already
tracking those in #17656 (so this patch is mostly to not make the scope
of that issue bigger).
2024-04-09 16:12:15 +02:00
Calixte Denizet
41aaa083df Don't render annotations with a null dimension
Fixes #17906.
2024-04-09 16:03:49 +02:00
Tim van der Meij
92de2b7b15
Don't install gulp-cli globally in the GitHub Actions workflows
It's recommended to always install dependencies locally in the project
folder because global dependencies can easily conflict with other
projects and, because they are not managed by the project, diverge from
versions defined in e.g. `package.json`. Previously we installed
`gulp-cli` globally because at the time we lacked a convenient mechanism
to use Gulp otherwise, but nowadays NPM provides the `npx` command for
that purpose and recommends using it over global installations (see
https://docs.npmjs.com/downloading-and-installing-packages-globally
and PR #17489 that provided the ground work for using it).

This commit therefore updates our GitHub Actions workflows to no longer
install `gulp-cli` globally but instead install it locally from the
already existing entries in `package.json` like all other dependencies
we use. Not only does this remove the special-casing for `gulp-cli`
which simplifies the workflow definitions, it also ensures that the
version ranges provided in `package.json` are respected. This makes the
local and workflow setups more similar, but is also relevant for the
upcoming upgrade to Gulp 5 which from a quick try is a bit involved and
having `package.json` be the single source of truth for the dependency
versions we use is therefore important.
2024-04-09 14:52:00 +02:00
calixteman
a208d6bca7
Merge pull request #17903 from calixteman/moved_freetext
[Editor] Avoid calling setTimeout when editing an existing freetext
2024-04-09 09:48:17 +02:00
Calixte Denizet
3b93fdea26 [Editor] Avoid calling setTimeout when editing an existing freetext
The code was added in order to guess if an editor has been moved but
it's simpler to just set a variable when it's dragged or moved with
the keyboard. This way we remove a bit of asynchronicity.
2024-04-08 22:43:39 +02:00
Tim van der Meij
30b65ca067
Merge pull request #17907 from calixteman/fix_draw_ink
[Editor] Don't add an already added editor (bug 1890367)
2024-04-08 20:44:21 +02:00
Tim van der Meij
fb21c4261d
Merge pull request #17890 from timvandermeij/font-tests-callbacks
Modernize the TTX driver code
2024-04-08 20:12:08 +02:00
Tim van der Meij
be4b56edda
Merge pull request #17891 from timvandermeij/thumbnail-private-methods
Convert the thumbnail view(er) code to use proper private methods
2024-04-08 20:11:42 +02:00
Calixte Denizet
976ee96aa8 [Editor] Don't add an already added editor (bug 1890367) 2024-04-08 19:50:55 +02:00
Tim van der Meij
2aeafc0d55
Merge pull request #17905 from timvandermeij/annotation-dash-array
Fix annotation border style parsing by handling empty dash arrays
2024-04-08 18:11:10 +02:00
Tim van der Meij
d01a0bd0c8
Fix annotation border style parsing by handling empty dash arrays
The PDF specification states that empty dash arrays, i.e. arrays with
zero elements, are in fact valid. In that case the dash array simply
corresponds to a solid, unbroken line. However, this case was erroneously
being flagged as invalid and therefore the annotation was not drawn
because its width was set to zero. This commit fixes the issue by
allowing dash arrays to have a length of zero.
2024-04-08 16:34:27 +02:00
Tim van der Meij
862c27ee67
Convert the thumbnail view(er) code to use proper private methods
This allows us to get rid of the `@private` JSDoc comments, which were
used to convey intent back when proper private methods could not be used
yet in JavaScript. This improves code readability/maintenance and enables
better usage validation by tooling such as ESlint.
2024-04-05 14:44:48 +02:00
Tim van der Meij
ac03d7054d
Convert the TTX driver code to promises
This commit removes the final callbacks in this code by switching to a
promises-based interface, overall simplifying the code. Moreover, we
document why we write to files on disk and modernize the code using e.g.
template strings.
2024-04-05 13:34:54 +02:00
Tim van der Meij
64065141b6
Remove the timeout logic from the TTX driver code
The original `test.py` code, see
c2376e5cea/test/test.py,
did not have any timeout logic for TTX, but it got introduced when
`test.py` was ported from Python to JavaScript as `test.js` in
c2376e5cea (diff-a561630bb56b82342bc66697aee2ad96efddcbc9d150665abd6fb7ecb7c0ab2f).

However, I don't think we've ever actually seen TTX timing out.
Moreover, back then we used a very old version of TTX and ran the font
tests on the bots (where a hanging process would block other jobs and
would require a manual action to fix), so this code was most likely
only included defensively.

Fortunately, nowadays it should not be necessary anymore because we use
the most recent version of TTX (which either returns the result or
errors out, but isn't known to hang on inputs) and we run the font tests
on GitHub Actions which doesn't block other jobs anymore and also
automatically times the job out for us in the unlikely event that a hang
would ever occur.

In short, we can safely remove this logic to simplify the code and to get
rid of a callback.
2024-04-05 12:49:26 +02:00
Tim van der Meij
5adad89eb3
Merge pull request #17880 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-04-04 19:09:25 +02:00
Tim van der Meij
a5308e129a
Merge pull request #17885 from calixteman/bug1889623
[Editor] Remove the mark from the highlight element and set its role to mark (bug 1889623)
2024-04-04 18:24:59 +02:00
Calixte Denizet
54110de109 [Editor] Remove the mark from the highlight element and set its role to mark (bug 1889623)
Set aria-label to the highlighted text, this way the focus frame is exactly set
on the highlight element and the higlighted text is read.
2024-04-04 18:06:05 +02:00
calixteman
25f6a0c139
Merge pull request #17875 from calixteman/jbig2_issue
Update the current stride before composing when decoding a text region
2024-04-03 20:41:24 +02:00
Calixte Denizet
3f2f98336e Update the current stride before composing when decoding a text region
Fixes #17871.

We do something similar to:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/pdfium/core/fxcodec/jbig2/JBig2_TrdProc.cpp;l=373-379;drc=24c6be6924df3ff585bb63f6aed4e2c81e791fb2
2024-04-03 18:44:50 +02:00
calixteman
d8331e3100
Merge pull request #17810 from calixteman/issue17808
Don't translate char codes when platform,encoding isn't (3,0)
2024-04-03 17:05:14 +02:00
Calixte Denizet
8f5d907a52 Don't translate char codes when platform,encoding isn't (3,0) 2024-04-03 16:08:11 +02:00
Tim van der Meij
cecbcd126f
Update translations to the most recent versions 2024-04-03 14:43:26 +02:00
Tim van der Meij
97f40807c7
Update dependencies to the most recent versions 2024-04-03 14:42:19 +02:00
Tim van der Meij
2e5282928f
Merge pull request #17854 from Snuffleupagus/rm-PromiseCapability
[api-minor] Replace the `PromiseCapability` with  `Promise.withResolvers()`
2024-04-02 15:21:43 +02:00