Commit Graph

16552 Commits

Author SHA1 Message Date
Calixte Denizet
4f0bfabe7a Take all the viewBox into account when computing the coordinates of an annotation in the page (fixes #15789) 2022-12-08 15:02:20 +01:00
calixteman
fe3df4dcb4
Merge pull request #15782 from calixteman/15780
[api-minor][Editor] Don't use the editor parent which can be null.
2022-12-08 14:27:42 +01:00
Calixte Denizet
b93bf9f654 [Editor] Don't use the editor parent which can be null.
An annotation editor layer can be destroyed when it's invisible, hence some
annotations can have a null parent but when printing/saving or when changing
font size, color, ... of all added annotations (when selected with ctrl+a) we
still need to have some parent properties especially the page dimensions, global
scale factor and global rotation angle.
This patch aims to remove all the references to the parent in the editor instances
except in some cases where an editor should obviously have one.
It fixes #15780.
2022-12-08 14:06:06 +01:00
Jonas Jenwald
c639063050
Merge pull request #15776 from Snuffleupagus/rm-createDownloadManager-options
Remove the unused `DefaultExternalServices.createDownloadManager` options (PR 12191 follow-up)
2022-12-07 10:31:15 +01:00
Jonas Jenwald
0ca92bf2a8
Merge pull request #15775 from Snuffleupagus/vars-all
Tighten the `vars`-argument for the ESLint `no-unused-vars` rule
2022-12-07 10:30:47 +01:00
calixteman
feb6f5951c
Merge pull request #15786 from calixteman/15780_bis
[Editor] Add a very basic and incomplete workaround for issue #15780
2022-12-06 19:11:33 +01:00
Calixte Denizet
9af89381cd [Editor] Add a very basic and incomplete workaround for issue #15780
The main issue is due to the fact that an editor's parent can be null when
we want to serialize it and that lead to an exception which break all the
saving/printing process.
So this incomplete patch fixes only the saving/printing issue but not the
underlying problem (i.e. having a null parent) and doesn't bring that much
complexity, so it should help to uplift it the next Firefox release.
2022-12-06 16:22:24 +01:00
Jonas Jenwald
cdd39ec69e
Merge pull request #15778 from Snuffleupagus/keep-structTree
Don't re-create the `structTreeLayer` on zooming and rotation
2022-12-06 10:02:20 +01:00
Jonas Jenwald
96152f56e7
Merge pull request #15779 from Snuffleupagus/textContentSource
[api-minor] Combine the `textContent`/`textContentStream` parameters
2022-12-06 09:58:07 +01:00
Jonas Jenwald
0274245e90 Remove the unused TextLayerRenderTask._renderingDone property (PR 15259 follow-up)
This is yet another property that I forgot to remove in PR 15259.
2022-12-05 11:49:14 +01:00
Jonas Jenwald
fe8fded23b [api-minor] Combine the textContent/textContentStream parameters
Rather than handling these parameters separately, which is a left-over from back when streaming of textContent was originally added, we can simply pass either data directly to the `TextLayer` and let it handle things accordingly.

Also, improves a few JSDoc comments and `typedef`-imports.
2022-12-04 21:22:14 +01:00
Jonas Jenwald
b659bacc43 Tighten the vars-argument for the ESLint no-unused-vars rule
Please see https://eslint.org/docs/latest/rules/no-unused-vars#vars
2022-12-04 16:15:50 +01:00
Jonas Jenwald
da0e6bc590 Don't re-create the structTreeLayer on zooming and rotation
Compared to the recent PR 15722 for the `textLayer` this one should be a (comparatively) much a smaller win overall, since most documents don't have any structTree-data and the required parsing should be cheaper. However, it seems to me that it cannot hurt to improve this nonetheless.

Note that by moving the `structTreeLayer` initialization we remove the need for the "textlayerrendered" event listener, which thus simplifies the code a little bit.

Also, removes the API-caching of the structTree-data since this was basically done to offset the lack of caching in the viewer.
2022-12-04 10:18:58 +01:00
Jonas Jenwald
cd72818438 Remove unused StructTreeLayerBuilder constructor parameter
Also change the "private" methods into properly private ones.
2022-12-03 22:58:37 +01:00
Jonas Jenwald
9369adb4bd Remove the unused DefaultExternalServices.createDownloadManager options (PR 12191 follow-up) 2022-12-03 12:52:36 +01:00
Tim van der Meij
67e1c37e0f
Merge pull request #15773 from Snuffleupagus/view-worker-normalize
[api-minor] Normalize the `view`-getter on the worker-thread
2022-12-02 19:52:44 +01:00
Tim van der Meij
99cfef882f
Merge pull request #15752 from Snuffleupagus/no-typeof-undefined
Enable the `no-typeof-undefined` ESLint plugin rule
2022-12-02 19:48:16 +01:00
Jonas Jenwald
5f8598abb7 [api-minor] Normalize the view-getter on the worker-thread
*Please note:* I don't really expect that this is will be an observable change, since virtually all PDF documents already order e.g. /MediaBox and /CropBox entries correctly.

By normalizing boundingBoxes already on the worker-thread, we can be sure that even a corrupt document won't cause issues.
Note how we're passing the `view`-getter to the `PartialEvaluator.getTextContent` method, in order to detect textContent which is outside of the page, hence it makes sense to ensure that it's formatted as expected.
Furthermore, by normalizing this once on the worker-tread we should no longer have to worry about a possibly negative width/height in the `PageViewport` constructor.

Finally, the patch also simplifies the `view`-getter a little bit.
2022-12-02 15:46:39 +01:00
calixteman
e3c2af14b3
Merge pull request #15772 from calixteman/chmod
Remove execution permission on cursor-editorFreeText.svg
2022-12-02 10:02:08 +01:00
Jonas Jenwald
2c4bb5d91d
Merge pull request #15771 from mozilla/dependabot/npm_and_yarn/decode-uri-component-0.2.2
Bump decode-uri-component from 0.2.0 to 0.2.2
2022-12-02 09:55:19 +01:00
Calixte Denizet
973478e704 Remove execution permission on cursor-editorFreeText.svg 2022-12-02 09:52:03 +01:00
dependabot[bot]
b7083d7a0e
Bump decode-uri-component from 0.2.0 to 0.2.2
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-02 04:48:04 +00:00
calixteman
6e4968225e
Merge pull request #15722 from calixteman/refactor_textlayer
[api-minor] Refactor the text layer code in order to avoid to recompute it on each draw
2022-12-01 18:56:02 +01:00
Calixte Denizet
eed9bf71c5 Refactor the text layer code in order to avoid to recompute it on each draw
The idea is just to resuse what we got on the first draw.
Now, we only update the scaleX of the different spans and the other values
are dependant of --scale-factor.
Move some properties in the CSS in order to avoid any updates in JS.
2022-12-01 18:42:43 +01:00
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