Commit Graph

17835 Commits

Author SHA1 Message Date
Jonas Jenwald
2d79be941e Convert PDFBug, in web/debugger.js, to a class with static methods
This gets rid of one more closure from the code-base.
2023-09-17 08:06:43 +02:00
Jonas Jenwald
c9cd934f8a Stop hard-coding the panel width in web/debugger.js
Thanks to CSS variables we can avoid hard-coding the panel width in the JavaScript code.
2023-09-17 08:06:33 +02:00
Jonas Jenwald
22cd0c6ff8 Remove the closure from the Stepper class in web/debugger.js 2023-09-17 08:06:26 +02:00
Tim van der Meij
b49fe5baac
Merge pull request #16958 from timvandermeij/puppeteer
Update Puppeteer to version 21.2.1
2023-09-16 15:09:56 +02:00
Tim van der Meij
7f8de83e96
Merge pull request #16957 from Snuffleupagus/SaveDocument-more-await
Use `await` even more in the "SaveDocument" worker-thread handler
2023-09-16 14:31:05 +02:00
Tim van der Meij
6c5d5f3cb9
Update Puppeteer to version 21.2.1
This release fixes the upstream bug that caused old Firefox revisions to
not be removed from the cache.

Fixes #16904.
2023-09-16 14:05:26 +02:00
Tim van der Meij
89c8f90a14
Merge pull request #16956 from Snuffleupagus/opMap-rm-getLookupTableFactory
Simplify the `EvaluatorPreprocessor.opMap` getter a little bit
2023-09-16 13:51:33 +02:00
Jonas Jenwald
ff96c413d3 Use await even more in the "SaveDocument" worker-thread handler
Given that the function is already asynchronous we can make use of `await` even more and reduce the amount of indentation a little bit.
2023-09-16 13:06:48 +02:00
Tim van der Meij
4dd197ae3f
Merge pull request #16954 from Snuffleupagus/rm-colorspace-closure
Remove the remaining closures in the `src/core/colorspace.js` file
2023-09-16 12:28:32 +02:00
Jonas Jenwald
316d1ec5ef Simplify the EvaluatorPreprocessor.opMap getter a little bit
Given that this is a shadowed getter, the `opMap` is already lazily initialized and it shouldn't be necessary to *also* use the `getLookupTableFactory` helper function here. Looking at the history of the code, it seems that this is simply a leftover from before JavaScript classes existed.
2023-09-16 12:26:38 +02:00
Jonas Jenwald
8cb5d01acd Remove the closure from the LabCS class
Now that modern JavaScript is fully supported also in the worker-thread we no longer need to keep old closures, which slightly reduces the size of the code.
2023-09-16 12:20:14 +02:00
Jonas Jenwald
52fa66a98b Remove the closure from the CalRGBCS class
Now that modern JavaScript is fully supported also in the worker-thread we no longer need to keep old closures, which slightly reduces the size of the code.
2023-09-16 12:20:12 +02:00
Jonas Jenwald
4d615f087f Remove the closure from the CalGrayCS class
Now that modern JavaScript is fully supported also in the worker-thread we no longer need to keep old closures, which slightly reduces the size of the code.
2023-09-15 15:53:16 +02:00
Jonas Jenwald
d2c8997380 Remove the closure from the DeviceCmykCS class
Now that modern JavaScript is fully supported also in the worker-thread we no longer need to keep old closures, which slightly reduces the size of the code.
2023-09-15 15:53:05 +02:00
Jonas Jenwald
586d3add46
Merge pull request #16951 from Snuffleupagus/tweak-pattern-getB
Make it possible to clear the cache, used by the `getB` function in `src/core/pattern.js`
2023-09-15 14:06:51 +02:00
Jonas Jenwald
628ca737dd Make it possible to clear the cache, used by the getB function in src/core/pattern.js
While this cache will not contain a huge amount of data in practice, it's nonetheless a *global* cache that currently will never be cleared.

This patch also removes the existing closure, since it shouldn't really be necessary nowadays given that the code is a JavaScript module which means that only explicitly listed properties will be exported.
2023-09-15 12:23:06 +02:00
calixteman
4c0fbe51e5
Merge pull request #16950 from calixteman/resizers_hcm
[Editor] Change the colors of the outline and the resizers for selected editors in HCM
2023-09-15 11:52:27 +02:00
Jonas Jenwald
93ce7c5a89 Change the getB function, in src/core/pattern.js, to use the exponentiation operator 2023-09-15 11:46:00 +02:00
Calixte Denizet
38f60a7eff [Editor] Change the colors of the outline and the resizers for selected editors in HCM 2023-09-15 10:29:49 +02:00
calixteman
8d695c982f
Merge pull request #16943 from calixteman/new_resizers
[Editor] Change the style of the bounding box and the resizers (bug 1852897)
2023-09-14 10:42:18 +02:00
Calixte Denizet
01f9f385d7 [Editor] Change the style of the bounding box and the resizers (bug 1852897) 2023-09-14 09:45:41 +02:00
calixteman
920e51a1e6
Merge pull request #16944 from calixteman/move_dom_after_position
[Editor] Move an editor in the DOM just after having moved it on the screen
2023-09-13 12:34:21 +02:00
Calixte Denizet
720963bbe6 [Editor] Move an editor in the DOM just after having moved it on the screen
It avoids to have to remember to call moveInDOM after fixAndSetPosition is called.
2023-09-13 10:51:25 +02:00
Jonas Jenwald
b1578225fc
Merge pull request #16941 from Snuffleupagus/SaveDocument-await-requestLoadedStream
Ensure that the entire PDF document is loaded *before* we begin saving it
2023-09-12 17:34:34 +02:00
Jonas Jenwald
50937a3539 Ensure that the entire PDF document is loaded *before* we begin saving it
When I started looking at PR 16938 it occurred to me that some of the new structTree-methods are synchronously accessing certain dictionary-data (not used during "normal" structTree-parsing), which may not be generally safe since everything in a dictionary could be a reference (and the relevant data may not have been loaded yet).

Rather than suggesting that we make all those new methods even more asynchronous, to me the overall simplest and safest solution is to ensure that the *entire* PDF document has been loaded *before* we begin saving it. In practice this shouldn't really affect "performance" of saving noticeably, since it's always depended on the entire PDF document being downloaded.

Finally note that with the exception of the PDF document possibly not having been fully downloaded when saving is triggered, all other "global" document properties are pretty much guaranteed to already be available at this point.
2023-09-12 13:26:57 +02:00
calixteman
953f271425
Merge pull request #16940 from calixteman/get_back_focus_when_required
[Editor] Only get back the focus when it has been lost after an editor has been moved in the DOM
2023-09-12 13:22:47 +02:00
Calixte Denizet
5646604883 [Editor] Only get back the focus when it has been lost after an editor has been moved in the DOM 2023-09-12 12:17:24 +02:00
Tim van der Meij
221ee6ca37
Merge pull request #16932 from timvandermeij/unit-test-enable
Enable unit test "creates pdf doc from non-existent URL"
2023-09-10 18:12:56 +02:00
Tim van der Meij
66507ccae8
Enable unit test "creates pdf doc from non-existent URL"
The unit test is re-enabled because it no longer seems to fail after 10
runs on Linux where this used to fail often. Code inspection also shows
that the code is correct and should raise the previous exception
(anymore). Finally, a lot has changed since this test was disabled such
as new Jasmine versions, new Linux bot OS version and new browser
versions.
2023-09-10 15:47:04 +02:00
Tim van der Meij
5f93638045
Merge pull request #16925 from timvandermeij/updates
Update packages and translations
2023-09-10 11:30:56 +02:00
Tim van der Meij
981ef9e31e
Update translations 2023-09-09 17:53:43 +02:00
Tim van der Meij
f42d70a24e
Update packages 2023-09-09 17:53:43 +02:00
Jonas Jenwald
18a661b6a0
Merge pull request #16920 from Snuffleupagus/annotationGlobals
Slightly reduce asynchronicity when parsing Annotations
2023-09-09 09:55:49 +02:00
calixteman
cf7efdb040
Merge pull request #16921 from calixteman/simplify_write
Simplify writeObject function
2023-09-08 21:25:44 +02:00
Calixte Denizet
52cc1220e4 Simplify writeObject function
It'll avoid to have the duplication of the code to get the encrypt transform,
and last but not least, it'll avoid to forget about encryption.
2023-09-08 19:59:59 +02:00
calixteman
b903b3030a
Merge pull request #16916 from calixteman/parent_in_struct_tree
[Editor] Add the parent tag id (if any) to the serialized editors (bug 1845087)
2023-09-08 16:24:47 +02:00
Jonas Jenwald
b5b061cdb6 Slightly re-factor the parameter handling in Catalog.parseDestDictionary
While it makes sense to check that the `destDict` parameter is indeed a Dictionary, since that data comes from the PDF document itself, the `resultObj` parameter is an internal PDF.js implementation detail that should always be correct (or tests will fail).
2023-09-08 13:27:31 +02:00
Jonas Jenwald
df9cce39c0 Slightly reduce asynchronicity when parsing Annotations
Over time the amount of "document level" data potentially needed during parsing of Annotations have increased a fair bit, which means that we currently need to ensure that a bunch of data is available for each individual Annotation.
Given that this data is "constant" for a PDF document we can instead create (and cache) it lazily, only when needed, *before* starting to parse the Annotations on a page. This way the parsing of individual Annotations should become slightly less asynchronous, which really cannot hurt.

An additional benefit of these changes is that we can reduce the number of parameters that need to be explicitly passed around in the annotation-code, which helps overall readability in my opinion.

One potential drawback of these changes is that the `AnnotationFactory.create` method no longer handles "everything" on its own, however given how few call-sites there are I don't think that's too much of a problem.
2023-09-08 13:27:27 +02:00
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