Commit Graph

18058 Commits

Author SHA1 Message Date
Calixte Denizet
0df9d1d934 [Editor] Update alt text dialog description 2023-09-19 09:27:43 +02:00
calixteman
5ac40b71c0
Merge pull request #16952 from calixteman/alt_text_window
[Editor] Add a dialog box in order to get alt-text data (bug 1844952)
2023-09-18 21:49:33 +02:00
Calixte Denizet
df0da86b64 [Editor] Add a dialog box in order to get alt-text data (bug 1844952)
Implement the specifications provided by UX for light, dark and HCM modes.
2023-09-18 21:42:52 +02:00
calixteman
c0ed7fff2c
Merge pull request #16975 from calixteman/alt_text_fix_icon_dims
[Editor] Use the same height as in the svg for icons for the alt-text button
2023-09-18 19:53:48 +02:00
Calixte Denizet
60ccce5cb1 [Editor] Use the same height as in the svg for icons for the alt-text button 2023-09-18 19:07:36 +02:00
calixteman
c8727d9c70
Merge pull request #16974 from calixteman/fix_css_linter_issue
Fix a CSS linter issue in removing a useless comma
2023-09-18 19:01:33 +02:00
calixteman
2bd7bb3847
Merge pull request #16972 from calixteman/alt_text_icon_alpha
[Editor] Avoid to have some transparency in the icon used in the 'Alt text' button
2023-09-18 18:46:46 +02:00
Calixte Denizet
9b6e37c2cd Fix a CSS linter issue in removing a useless comma 2023-09-18 18:45:14 +02:00
Calixte Denizet
9dbe95c63c [Editor] Avoid to have some transparency in the icon used in the 'Alt text' button 2023-09-18 18:25:03 +02:00
calixteman
b85281914f
Merge pull request #16955 from calixteman/alt_text_button
[Editor] Add a button to trigger a dialog for adding an alt text (bug 1844952)
2023-09-18 15:50:10 +02:00
Calixte Denizet
a216836fd5 [Editor] Add a button to trigger a dialog for adding an alt text (bug 1844952) 2023-09-18 15:07:09 +02:00
calixteman
3afb717eed
Merge pull request #16938 from calixteman/update_struct_tree
[Editor] Add the ability to create/update the structure tree when saving a pdf containing newly added annotations (bug 1845087)
2023-09-18 13:04:52 +02:00
Tim van der Meij
01428f1e23
Wait for visibility change in the issue15053 integration test
Especially on slower bots there is some time between clicking the
element and the actual visibility change, but we didn't await this and
checked the visibility state immediately after clicking. This can be
reproduced 100% of the time by introducing a delay in the `display` and
`hidden` handlers of the `_commonActions` shadow call.

This commit fixes the problem by waiting until the first visibility
change actually happened before continuing with the assertions.
2023-09-17 19:48:14 +02:00
Tim van der Meij
1b3ccf1321
Wait for selector instead of timeout in the freetext double click move integration test
This integration test currently fails intermittently on the bots because
of the fixed timeout in the test, which is sometimes too low on slower
systems. The issue can be reproduced 100% of the time by introducing a
delay just before dispatching the `switchannotationeditormode` event.

Puppeteer also discourages this and instead recommends waiting for a
selector instead, which we now do here. This ensures that the test only
continues if the element under test is available and therefore prevents
any timing problems.
2023-09-17 18:49:11 +02:00
Tim van der Meij
97819891b6
Merge pull request #16964 from timvandermeij/fix-intermittent-annotations-move
Fix off-by-one errors in the "FreeText must move several annotations" integration test
2023-09-17 17:46:19 +02:00
Tim van der Meij
306cca930f
Fix off-by-one errors in the "FreeText must move several annotations" integration test
The x/y-coordinates are floats instead of integers like one might
expect. The current approach rounds both the old and the new
coordinates in order to do integer comparison. However, rounding each
coordinate individually causes too much loss of precision because,
depending on the decimal value, they are either rounded up or down
which causes intermittent off-by-one errors.

This commit fixes the problem by comparing coordinate differences
instead of the coordinates themselves. The precision loss is avoided
by subtracting the old from the new coordinate as-is and only rounding
the final result.
2023-09-17 15:56:51 +02:00
Tim van der Meij
e37e7b6f39
Merge pull request #16962 from timvandermeij/fix-intermittent-bug1844576
Fix integration test "Interaction in bug1844576.pdf must check that a field has the correct formatted value"
2023-09-17 14:12:55 +02:00
Tim van der Meij
0d3fbc1818
Wait for selector instead of timeout in the bug1844576 integration test
This integration test currently fails intermittently on the bots because
of the fixed timeout in the test, which is sometimes too low on slower
systems. The issue can be reproduced 100% of the time by introducing a
delay in the `WidgetAnnotationElement.showElementAndHideCanvas` method.

Puppeteer also discourages this and instead recommends waiting for a
selector instead, which we now do here. This ensures that the test only
continues if the element under test is available and therefore prevents
any timing problems.
2023-09-17 13:15:53 +02:00
Tim van der Meij
dd46110f6b
Use the page.$eval method in the bug1844576 integration test
We already use `page.$eval` in most other integration tests and it's
simpler because it already takes the selector as argument, so we don't
have to do a separate `querySelector` call ourselves.
2023-09-17 13:09:39 +02:00
Tim van der Meij
518590ac7d
Merge pull request #16961 from Snuffleupagus/debugger-rm-closure
Remove (some) closures from `web/debugger.js`
2023-09-17 11:45:14 +02:00
Tim van der Meij
98671c3618
Merge pull request #16959 from Snuffleupagus/rm-CipherTransformFactory-closure
Remove the closure from the `CipherTransformFactory` class
2023-09-17 11:42:20 +02:00
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
Calixte Denizet
a8573d4e1b [Editor] Add the ability to create/update the structure tree when saving a pdf containing newly added annotations (bug 1845087)
When there is no tree, the tags for the new annotions are just put under the root element.
When there is a tree, we insert the new tags at the right place in using the value
of structTreeParentId (added in PR #16916).
2023-09-16 18:34:58 +02:00
Jonas Jenwald
0304b65fcd Remove the closure from the CipherTransformFactory 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 16:34:24 +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