Commit Graph

17797 Commits

Author SHA1 Message Date
Calixte Denizet
c6f7e722c9 [Editor] Add the parent tag id (if any) to the serialized editors (bug 1845087)
The tag id will be useful in order to update the StructTree when saving
the pdf.
2023-09-07 18:22:33 +02:00
calixteman
3e32d87be7
Merge pull request #16915 from calixteman/issue16914
Construct the correct field name and strip out classes when searching
2023-09-07 16:46:33 +02:00
Calixte Denizet
a8a50c567a Construct the correct field name and strip out classes when searching
The classes were stripped out during when creating the field name but
it led to a wrong name.
Since class components in a path are irrelevant, they're just ignored
when searching for a node in the datasets.
2023-09-07 15:56:47 +02:00
calixteman
5ffa23c7f1
Merge pull request #16911 from calixteman/issue16872
[Editor] Avoid to use parent of editors in destroyed pages
2023-09-07 14:59:47 +02:00
Calixte Denizet
8ab4e2e6e7 [Editor] Avoid to use parent of editors in destroyed pages 2023-09-07 12:30:29 +02:00
Jonas Jenwald
cf5a1d60a6
Merge pull request #16897 from mozilla/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-09-05 17:46:48 +02:00
calixteman
03eabae613
Merge pull request #16905 from calixteman/bug1851517
Only call the focus/blur callbacks when it's necessary (bug 1851517)
2023-09-05 15:19:36 +02:00
Calixte Denizet
d03494eeff Only call the focus/blur callbacks when it's necessary (bug 1851517)
Focus callback must be called only when the element has been blurred.
For example, blur callback (which implies some potential validation) is not called
because the newly focused element is an other tab, an alert dialog, ... so consequently
the focus callback mustn't be called when the element gets its focus back.
2023-09-05 14:18:51 +02:00
Jonas Jenwald
92792a8215
Merge pull request #16902 from Snuffleupagus/FileAttachment-keyboard-download
Support downloading FileAttachment annotations with the keyboard
2023-09-05 12:45:04 +02:00
Jonas Jenwald
e7800c22dd Support downloading FileAttachment annotations with the keyboard
While reviewing PR 16898 it occurred to me that it's currently impossible to trigger downloading of FileAttachment annotations using the keyboard.
Hence this patch adds `Ctrl + Enter` as the keyboard shortcut to download those, thus supplementing the existing double-clicking when using a mouse.
2023-09-05 11:31:30 +02:00
calixteman
f2a4f2adaf
Merge pull request #16899 from calixteman/bug1851498
Unconditionally render non-form annotations in the annotation layer (bug 1851498)
2023-09-05 11:28:23 +02:00
Calixte Denizet
a00b542f2f Unconditionally render non-form annotations in the annotation layer (bug 1851498)
The goal is to always have something which is focusable to let the user select
it with the keyboard.
It fixes the mentioned bug because, the annotation layer will now have a container
to attach the canvas for annotations having their own canvas.
2023-09-05 10:41:01 +02:00
calixteman
08f9e48280
Merge pull request #16898 from calixteman/make_annotation_focusable
Make annotations focusable (bug 1851489)
2023-09-04 18:08:58 +02:00
Calixte Denizet
7f44f353b3 Make annotations focusable (bug 1851489)
When the annotation has a popup then the popup can be toggled in using
the Enter key and hidden in using the Escape key.
2023-09-04 17:12:23 +02:00
dependabot[bot]
48a2c29f98
Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 12:51:59 +00:00
Jonas Jenwald
b18a1669ac
Merge pull request #16896 from Rob--W/grab-to-pan-css-fix
Drop redundant styles from .grab-to-pan-grab:active
2023-09-04 10:23:12 +02:00
Rob Wu
28bda9f68b Drop redundant styles from .grab-to-pan-grab:active
`.grab-to-pan-grab:active` is `#viewerContainer` when the mouse is
pressed down.  It is supposed to have a `cursor: grabbing` appearance
immediately on mousedown,

`.grab-to-pan-grabbing` is the overlay that is supposed to cover
everything, and also has the `cursor: grabbing` appearance. The "cover
everything" result is achieved through `position:fixed`, `inset:0`, etc.

The block with these CSS properties for "cover everything" is currently
shared by `.grab-to-pan-grab:active` and `.grab-to-pan-grabbing`, but
only "cursor" need to be shared. The original JS and CSS code at
https://github.com/Rob--W/grab-to-pan.js shows that these were supposed
to be associated with the overlay only.

The PR that added this to PDF.js also shows that the "cover everything"
CSS properties were supposed to be limited to the overlay only:
https://github.com/mozilla/pdf.js/pull/4209#discussion-diff-9285917

But the final version of the PR mistakenly merged them together.
This patch rectifies that mistake.
2023-09-03 19:45:18 +02:00
Tim van der Meij
1e7c907fbf
Merge pull request #16881 from Snuffleupagus/InternalRenderTask-tweaks
A couple of small `InternalRenderTask` changes
2023-09-03 13:05:31 +02:00
Tim van der Meij
11c5213185
Merge pull request #16895 from Snuffleupagus/update-packages
Update packages and translations
2023-09-03 13:03:28 +02:00
Jonas Jenwald
07cca3ddd9 Update l10n files 2023-09-03 10:01:37 +02:00
Jonas Jenwald
92831455bf Update npm packages 2023-09-03 09:59:08 +02:00
Jonas Jenwald
87ea2ed4e2
Merge pull request #16890 from stof/fix_type_generator
[Type-definitions] Fix type generator to support import maps
2023-09-01 12:00:27 +02:00
Christophe Coevoet
46f2c5893d Revert "Temporarily stop running gulp typestest in GitHub Actions"
This reverts commit d9350c3899.
2023-09-01 09:48:39 +02:00
Christophe Coevoet
d0f14b1ce3 Add support for the import map in the type generator
The typescript compiler is now configured to know about the import map
to be able to resolve those imports and find the associated types.
As tsc outputs declaration files using the original module identifiers
and not the resolved ones, tsc-alias is used to post-process the
declaration files by resolving those paths.
2023-09-01 09:48:39 +02:00
Christophe Coevoet
bbf11a5783 Migrate the typescript options to a config file
Some configurations settings like `paths` cannot be provided through CLI
arguments but only in a configuration file. And when using a
configuration file, only a few options (like `--outDir` can still be
provided) through the CLI.
2023-09-01 09:48:34 +02:00
Jonas Jenwald
b5c8849111
Merge pull request #16892 from Snuffleupagus/addLinkAttributes-rm-removeNullCharacters
Stop using `removeNullCharacters` in the `addLinkAttributes` helper function
2023-08-31 21:52:44 +02:00
Jonas Jenwald
c5ee72bb95 Stop using removeNullCharacters in the addLinkAttributes helper function
Using `removeNullCharacters` on the URL should be completely redundant, given the kind of data that we're passing to the `addLinkAttributes` helper function. Note that whenever we're handling a URL, originating in the worker-thread, in the viewer that helper function is always being used.

Furthermore, on the worker-thread all URLs are parsed with the `createValidAbsoluteUrl` helper function, which uses `new URL()` to ensure that a valid URL is obtained. Note that the `URL` constructor will either throw, or in some cases just ignore them, when encountering `\u0000`-characters during parsing.

Hence it should be *impossible* for a valid URL to contain `\u0000`-characters and we can thus simplify the viewer-code a tiny bit. The use of `removeNullCharacters` is most likely a left-over from back when `new URL()` wasn't generally available in browsers.
2023-08-31 20:10:50 +02:00
Jonas Jenwald
9190445a21
Merge pull request #16891 from Snuffleupagus/structElement-removeNullCharacters
Ignore null-chars when using structTree-data in the viewer
2023-08-31 18:09:04 +02:00
Jonas Jenwald
b159cc9e4b
Merge pull request #16888 from stof/fix_jsdoc_types
Fix JSDoc types
2023-08-31 16:36:09 +02:00
Jonas Jenwald
284f32f50b Ignore null-chars when using structTree-data in the viewer
Testing the `tagged_stamp.pdf` document locally in the viewer, I noticed that e.g. the /Alt entry for the StampAnnotation contains "Secondary text for stamp\u0000".
Elsewhere in the viewer we're skipping null-chars and it's easy enough to do that in the `StructTreeLayerBuilder` class as well. (Note that we generally let the API itself return the data as-is.)
2023-08-31 16:29:10 +02:00
calixteman
14b2a31e78
Merge pull request #16889 from calixteman/fix_aria_controls_id
Fix the id used in aria-controls used to make a relationship between the popup and its parent
2023-08-31 16:06:11 +02:00
Calixte Denizet
e7229854bd Fix the id used in aria-controls used to make a relationship between the popup and its parent 2023-08-31 15:48:32 +02:00
calixteman
20b0be973c
Merge pull request #16886 from calixteman/struct_tree_annotation
Add tagged annotations in the structure tree (bug 1850797)
2023-08-31 14:05:55 +02:00
Christophe Coevoet
f84f2646f4 Fix JSDoc types
This fixes invalid type references (either due to invalid paths for the
import or missing imports) in the JS doc, as well as some missing or
invalid parameter names for @param annotations.
2023-08-31 13:09:52 +02:00
Calixte Denizet
d185db2b70 Add tagged annotations in the structure tree (bug 1850797) 2023-08-31 12:35:32 +02:00
Jonas Jenwald
1b8441dacc Don't pass in unused pageColors to CanvasGraphics.endDrawing (PR 16380 follow-up)
This became unnecessary in PR 16380, however we forgot to update one of the API call-sites.
2023-08-28 16:14:22 +02:00
Jonas Jenwald
9b4efe2c2f Use WeakSet.prototype.delete() unconditionally in the InternalRenderTask class
It's not necessary to check if an object exists before trying remove it from a `WeakSet`; see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/delete#return_value
2023-08-28 16:10:33 +02:00
Tim van der Meij
92f7653cfb
Merge pull request #16876 from timvandermeij/bump
Bump versions in `pdfjs.config`
2023-08-27 18:09:29 +02:00
Tim van der Meij
fd32a53a86
Bump versions in pdfjs.config 2023-08-27 18:04:05 +02:00
Tim van der Meij
e142baecb1
Merge pull request #16875 from Snuffleupagus/more-optional-chaining-4
Introduce more optional chaining in the code-base
2023-08-27 11:16:56 +02:00
Jonas Jenwald
ec3d2be761 Introduce more optional chaining in the code-base
Also, use logical OR assignment a bit more.
2023-08-26 10:52:23 +02:00
Jonas Jenwald
598421b11f
Merge pull request #16856 from Snuffleupagus/limit-lineEndings
Exclude `lineEndings`, in Annotation-data, in MOZCENTRAL builds (PR 14899 follow-up)
2023-08-24 15:58:32 +02:00
calixteman
62a294bb52
Merge pull request #16864 from calixteman/issue16863
Don't reset all fields when the resetForm argument is an array
2023-08-24 09:56:11 -04:00
Calixte Denizet
24b480fabe Don't reset all fields when the resetForm argument is an array
correctly set the readonly property in the annotation layer and set the default checkbox value to Off when none is provided.
2023-08-24 09:10:27 -04:00
calixteman
08f26be7b4
Merge pull request #16862 from calixteman/revert_1838855
Revert fix for bug 1838855 (bug 1849876)
2023-08-23 13:23:59 -04:00
Calixte Denizet
ee3ac35e05 Revert fix for bug 1838855 (bug 1849876)
The issue described in the mentioned bug is reall because
Acrobat is rendering the XFA instead of the Acroform.
The original patch just tried to workaround the issue but it
induces some regressions.
2023-08-23 12:34:41 -04:00
Jonas Jenwald
847da21c95
Merge pull request #16858 from Snuffleupagus/stamp-aria-controls
Add the "aria-controls" attribute to the StampEditor toolbar-button
2023-08-23 17:17:52 +02:00
Jonas Jenwald
6da4fe5778
Merge pull request #16860 from Snuffleupagus/editorconfig-mjs
Add the `.mjs` file-extension to the EditorConfig
2023-08-23 17:16:50 +02:00
Jonas Jenwald
89779b3f6c Add the .mjs file-extension to the EditorConfig
Given that this file-extension is used for JavaScript modules, those files should obviously be formatted just like any "normal" JS file.
2023-08-23 11:22:25 +02:00
Jonas Jenwald
de52c98ddf Add the "aria-controls" attribute to the StampEditor toolbar-button
Given that the other Editor toolbar-buttons use this attribute, it seems that the StampEditor should as well.
2023-08-22 10:05:21 +02:00