Commit Graph

16528 Commits

Author SHA1 Message Date
Jonas Jenwald
47dbfc4ade Enable the no-typeof-undefined ESLint plugin rule
Please see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-typeof-undefined.md
2022-12-01 18:20:39 +01:00
Jonas Jenwald
4793a0717f
Merge pull request #15768 from Snuffleupagus/issue-15767
Prevent the `debugger` from breaking on unbalanced save/restore OPS (issue 15767)
2022-12-01 17:06:53 +01:00
Jonas Jenwald
0cf4e6620d Prevent the debugger from breaking on unbalanced save/restore OPS (issue 15767) 2022-12-01 15:43:17 +01:00
Jonas Jenwald
fa54a58790
Merge pull request #15765 from Snuffleupagus/rm-textLayer-timeout
[api-minor] Remove the TextLayer `timeout` parameter (PR 15742 follow-up)
2022-11-29 21:21:45 +01:00
calixteman
f3206b351f
Merge pull request #15764 from calixteman/15753
[Annotation] Send correctly the updated values to the JS sandbox
2022-11-29 20:04:12 +01:00
Jonas Jenwald
7c25b1b455 [api-minor] Remove the TextLayer timeout parameter (PR 15742 follow-up)
The deprecation is included in the current release, i.e. version `3.1.81`, and given the edge-case nature of this option I really don't think that we need to keep it deprecated for multiple releases.
2022-11-29 19:57:38 +01:00
Calixte Denizet
20fd9099f8 [Annotation] Send correctly the updated values to the JS sandbox 2022-11-29 17:34:06 +01:00
Jonas Jenwald
1f082d3e1d
Merge pull request #15761 from Snuffleupagus/platform
Stop duplicating the `platform` getter in multiple files
2022-11-29 17:32:52 +01:00
calixteman
a3ac8a6438
Merge pull request #15718 from calixteman/test_text_cursor
[Editor] Change the text annotation cursor for the high dpi screens.
2022-11-29 16:37:36 +01:00
Calixte Denizet
8689905a19 [Editor] Change the text annotation cursor for the high dpi screens. 2022-11-29 15:48:55 +01:00
Jonas Jenwald
ff9d21ff0e
Merge pull request #15762 from Snuffleupagus/bug-1803050
Ignore PDF documents opened from "data:"-URLs when handling internal links (bug 1803050)
2022-11-29 15:16:33 +01:00
Jonas Jenwald
0d648f531b Ignore PDF documents opened from "data:"-URLs when handling internal links (bug 1803050)
This patch has been successfully tested in a local, artifact, Firefox build.

*Please note:* The only thing that'll no longer work for PDF documents opened using "data:"-URLs is middle-clicking on internal/outline links, in order to open the destination in a new tab. This is however an extremely small loss of functionality, and as can be seen in the bug the alternative (i.e. doing nothing) is surely much worse.
2022-11-29 14:08:01 +01:00
Jonas Jenwald
82d127883d Stop duplicating the platform getter in multiple files
Currently both of the `AnnotationElement` and `KeyboardManager` classes contain *identical* `platform` getters, which seems like unnecessary duplication.
With the pre-processor we can also limit the feature-testing to only GENERIC builds, since `navigator` should always be available in browsers.
2022-11-29 12:14:40 +01:00
calixteman
5d79cc5bee
Merge pull request #15760 from calixteman/15759
Don't add an extra space after a Katakana or a Hiragana at the eol when searching
2022-11-29 11:05:56 +01:00
Calixte Denizet
ea1995991b Don't add an extra space after a Katakana or a Hiragana at the eol when searching 2022-11-29 10:46:48 +01:00
calixteman
44bc315444
Merge pull request #15758 from calixteman/cleanup_telemetry
[api-minor] Remove all the useless telemetry stuff in the viewer (bug 1802468)
2022-11-28 21:54:00 +01:00
Calixte Denizet
b9cb651c44 [api-minor] Remove all the useless telemetry stuff in the viewer (bug 1802468)
Add a deprecation notification for PDFDocumentLoadingTask.onUnsupportedFeature and PDFDocumentProxy.stats
which are likely useless.
The unsupported feature stuff have initially been added in (#4048) in order to be able to display a
warning bar and to help to have some numbers to know how a feature was used.
Those data are no more used in Firefox.
2022-11-28 20:55:15 +01:00
calixteman
f96b99c30c
Merge pull request #15757 from calixteman/bug1802888
[JS] By default, a text field value must be treated as a number (bug 1802888)
2022-11-28 17:31:35 +01:00
Calixte Denizet
ae7da6ae48 [JS] By default, a text field value must be treated as a number (bug 1802888) 2022-11-28 16:24:01 +01:00
calixteman
33f9d1aab2
Merge pull request #15755 from calixteman/rounding_printf
[JS] Fix a rounding issue in printf (bug 1802888)
2022-11-28 15:39:36 +01:00
Calixte Denizet
4ee0c83548 [JS] Fix a rounding issue in printf (bug 1802888) 2022-11-28 14:37:15 +01:00
Tim van der Meij
8bac57172a
Merge pull request #15751 from Snuffleupagus/modernize-isSyncFontLoadingSupported
Slightly modernize the `FontLoader.isSyncFontLoadingSupported` getter
2022-11-27 13:48:54 +01:00
Jonas Jenwald
f458b52bc7
Merge pull request #15750 from Snuffleupagus/update-packages
Update packages and translations
2022-11-27 12:35:50 +01:00
Jonas Jenwald
85f03c0ea4 Slightly modernize the FontLoader.isSyncFontLoadingSupported getter
This is very old code, which is unused (by default) in browsers nowadays since the Font Loading API will always be preferred.
For Node.js environments we use the same constant as elsewhere throughout the code-base, and we can also simplify the Firefox-specific check given that the lowest supported version is `102` (as of this writing).

Finally the old TODO is removed, since the general availability of the Font Loading API has made it redundant.
2022-11-27 12:19:11 +01:00
Jonas Jenwald
6aa8c3bd3f Update l10n files 2022-11-27 10:22:14 +01:00
Jonas Jenwald
69a2e6d3ea Update npm packages 2022-11-27 10:18:30 +01:00
Jonas Jenwald
73760144e0
Merge pull request #15747 from Snuffleupagus/FileAttachment-icons
Add default icons for FileAttachment annotations (bug 1230933)
2022-11-26 17:59:52 +01:00
Tim van der Meij
ba9174406c
Merge pull request #15749 from timvandermeij/bump
Bump versions in `pdfjs.config`
2022-11-26 15:01:12 +01:00
Tim van der Meij
67f1a5b59a
Bump versions in pdfjs.config 2022-11-26 14:52:56 +01:00
Tim van der Meij
0766898d5d
Merge pull request #15720 from Snuffleupagus/issue-15695
Ensure that the initial document position is always correct with non-default Scroll/Spread modes (issue 15695)
2022-11-26 13:05:54 +01:00
Jonas Jenwald
aa5b678f94 Add default icons for FileAttachment annotations (bug 1230933)
*Please note:* This "borrows" the icons from Thunderbird.

According to the PDF specification, see https://web.archive.org/web/20220309040754if_/https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#G11.2096626, we should be providing default icons for FileAttachment annotations without appearances.
2022-11-26 11:24:59 +01:00
Jonas Jenwald
37c2408199 Ensure that the initial document position is always correct with non-default Scroll/Spread modes (issue 15695)
Please refer to the inline comment for additional details. The patch also improves internal consistency when `#scrollIntoView` is called directly.
2022-11-26 10:06:29 +01:00
Jonas Jenwald
4f1b6f345b
Merge pull request #15715 from Snuffleupagus/getQuadPoints-refactor
Re-factor and simplify the `getQuadPoints` helper function
2022-11-25 12:38:52 +01:00
Jonas Jenwald
4b02610e8c Re-factor and simplify the getQuadPoints helper function
The use of `Array.prototype.reduce()` is, in my opinion, hurting overall readability since it's not particularly easy to look at the relevant code and immediately understand what's going on here. Furthermore this code leads to strictly speaking unnecessary allocations and parsing, since we could just track the min/max values directly in the relevant loop instead.
2022-11-25 10:40:16 +01:00
Jonas Jenwald
67741aeaa9
Merge pull request #15742 from Snuffleupagus/deprecate-textLayer-timeout
[api-minor] Deprecate the TextLayer `timeout` parameter
2022-11-25 08:44:02 +01:00
Jonas Jenwald
b3e161c328 [api-minor] Deprecate the TextLayer timeout parameter
This has never really been used anywhere within the PDF.js library[1], and when streaming of textContent was introduced this parameter was effectively made redundant.
Note that when streaming of textContent is used, all text-layout has already happened by the time that this `timeout`-functionality is actually invoked (thus making it pointless).
While the `timeout`-functionality may still "work" when the textContent is provided upfront, although it's never been used/tested, streaming will generally perform better (in e.g. a viewer setting).

*Please note:* While unrelated here, also removes a now unused property that I forgot in PR 15259.

---
[1] At least not since the code was moved into its current file, which happened in PR 6619 and landed seven years ago.
2022-11-24 23:08:39 +01:00
Jonas Jenwald
8fda3f04fe
Merge pull request #15732 from Snuffleupagus/issue-15719
Add a fallback for non-embedded *composite* Tahoma fonts (issue 15719)
2022-11-24 19:09:12 +01:00
Jonas Jenwald
823723121d
Merge pull request #15740 from mozilla/revert-15721-issue-15714
Revert "Remove the overflowing text special-case from `scrollIntoView` (issue 15714)"
2022-11-24 12:44:19 +01:00
Jonas Jenwald
9f5e1f4818
Revert "Remove the overflowing text special-case from scrollIntoView (issue 15714)" 2022-11-24 12:37:07 +01:00
Jonas Jenwald
5960e20cde
Merge pull request #15731 from Snuffleupagus/issue-15716
Add support for Optional Content in TilingPatterns (issue 15716)
2022-11-23 15:54:41 +01:00
Jonas Jenwald
d1c01b3164 Add a fallback for non-embedded *composite* Tahoma fonts (issue 15719) 2022-11-23 15:51:18 +01:00
Jonas Jenwald
47682985d3 Add support for Optional Content in TilingPatterns (issue 15716)
This can't be a particularly common feature, since we've supported Optional Content for over two years and this is the very first TilingPattern-case we've seen.
2022-11-23 12:58:00 +01:00
Jonas Jenwald
73c268dc1c
Merge pull request #15730 from Snuffleupagus/issue-15729
Support FileAttachments with hash-signs in the filename (issue 15729)
2022-11-23 12:52:11 +01:00
calixteman
8cd2adf8a1
Merge pull request #15727 from calixteman/bug1801341
Unblock the load event when the pdf has a password (bug 1801341)
2022-11-23 12:09:12 +01:00
Jonas Jenwald
f3e0f86641 Simplify the getFilenameFromUrl helper function 2022-11-23 11:48:08 +01:00
Calixte Denizet
38dd219d85 Unblock the load event when the pdf has a password (bug 1801341) 2022-11-23 11:17:58 +01:00
Jonas Jenwald
0ba242ea4a Support FileAttachments with hash-signs in the filename (issue 15729)
The reason for the issue is that we use the generic `getFilenameFromUrl` helper function, which was originally intended for regular URLs.
For the filenames we're dealing with in FileAttachments, we really only want to strip the path when one exists[1].

---
[1] See [bug 1230933](https://bugzilla.mozilla.org/show_bug.cgi?id=1230933) for an example of such a case.
2022-11-23 10:47:33 +01:00
Jonas Jenwald
a0db81723b
Merge pull request #15721 from Snuffleupagus/issue-15714
Remove the overflowing text special-case from `scrollIntoView` (issue 15714)
2022-11-22 14:51:02 +01:00
Jonas Jenwald
0ff43b27bb Remove the overflowing text special-case from scrollIntoView (issue 15714)
With the changes made in PR 14564 this *should* no longer be necessary now, however we still need to keep the `scrollMatches` parameter to handle textLayers with markedContent correctly when searching.
2022-11-22 11:54:30 +01:00
Jonas Jenwald
748be3f702
Merge pull request #15713 from Snuffleupagus/annotation-no-appearance-cleanup
Reduce duplication when creating a fallback appearance for `MarkupAnnotation`s
2022-11-20 17:12:41 +01:00