Commit Graph

17973 Commits

Author SHA1 Message Date
Calixte Denizet
eebd251552 [Editor] Don't show the alt-text button when the alt-text dialog is visible
This way, the button doens't cover the image.
2023-10-02 20:34:30 +02:00
calixteman
f5367f01ca
Merge pull request #17051 from calixteman/test_stamp_svg
Fix new intermittent failures with ink and stamp tests
2023-10-02 18:10:00 +02:00
Calixte Denizet
077d239b96 Fix new intermittent failures with ink and stamp tests
It happens only on windows with chrome.
For any reason, click event isn't correctly triggered and it seems work correctly
with pointerup.
And it seems that when drawing a svg on an OffscreenCanvas we need to wait
a little in order to be able to transfer it: it's why this patch adds
a check on the canvas content.
2023-10-02 15:04:44 +02:00
Tim van der Meij
be53c7d6f5
Merge pull request #17053 from calixteman/issue17044
Add alt-text svg images to the dist (issue #17044)
2023-10-01 18:11:24 +02:00
Calixte Denizet
0d9aef1a5e Add alt-text svg images to the dist (issue #17044) 2023-10-01 16:47:34 +02:00
Tim van der Meij
71bffcc7a9
Merge pull request #17052 from Snuffleupagus/web-pdfjsLib-export
Use a standard `export` statement in the `web/pdfjs.js` file
2023-10-01 12:09:36 +02:00
Jonas Jenwald
9624505f0f Use a standard export statement in the web/pdfjs.js file
This removes the only remaining old and non-standard handling of exports in the `web/`-folder, since some initial attempts at outputting JavaScript modules in the builds have identified this file as a potential problem.
While this uses a hard-coded list, for overall simplicity, I don't believe that that's a big problem since:
 - Generating this file automatically would require a bunch more parsing *every single time* that the library is built.
 - The official API-surface doesn't change often enough for this to really impede development in any significant way.
 - The added unit-test helps ensure that this list cannot accidentally become outdated.
2023-09-30 12:10:02 +02:00
calixteman
3ca63c68ea
Merge pull request #17050 from calixteman/editor_delete_invisible
[Editor] Make a deleted (when it was invisible) editor undoable
2023-09-29 18:06:55 +02:00
calixteman
7d7a7a46a0
Merge pull request #17049 from calixteman/fix_stamp_tests
Remove the timeouts from the stampEditor integration tests
2023-09-29 17:02:10 +02:00
calixteman
12ca22ba44
Merge pull request #17048 from calixteman/fix_ink_tests
Remove the timeouts from the inkEditor integration tests
2023-09-29 16:30:07 +02:00
Calixte Denizet
b65b079ceb [Editor] Make a deleted (when it was invisible) editor undoable
When the editor is invisible (because on a non-rendered page) its parent is null.
But when we undo its deletion, we need to have a parent to attach it.
2023-09-29 16:19:11 +02:00
Calixte Denizet
b8c118db22 Remove the timeouts from the stampEditor integration tests 2023-09-29 15:57:16 +02:00
Calixte Denizet
627249f889 Remove the timeouts from the inkEditor integration tests 2023-09-29 15:01:52 +02:00
calixteman
46940a5a52
Merge pull request #17036 from calixteman/fix_test_freetext
[Editor] Remove almost all the waitForTimeout from the freetext integration tests
2023-09-29 11:41:53 +02:00
Calixte Denizet
55e5af2d01 [Editor] Remove almost all the waitForTimeout from the freetext integration tests 2023-09-29 11:14:21 +02:00
Jonas Jenwald
52862893f5
Merge pull request #17026 from Snuffleupagus/layerProperties-Object
Convert `layerProperties` to an Object (PR 15811 follow-up)
2023-09-28 18:44:32 +02:00
Jonas Jenwald
46d8d36721
Merge pull request #17027 from Snuffleupagus/update-Puppeteer
Update Puppeteer to the latest version
2023-09-28 18:43:52 +02:00
calixteman
b6d75e736a
Merge pull request #17038 from ayushmourya/master
Make downloadManager optional in JSDoc types
2023-09-28 17:23:33 +02:00
Jonas Jenwald
790b480bbc Update Puppeteer to the latest version
This also required updating the `postinstall`-step to account for recent changes in Puppeteer.
2023-09-28 17:21:07 +02:00
Jonas Jenwald
03ce3b2d54 Convert layerProperties to an Object (PR 15811 follow-up)
Given that this is accessed multiple times per page in the viewer, that leads to a number of (strictly speaking unneeded) function calls and allocated Objects for each invocation. By converting `layerProperties` to a, lazily initialized, Object we can avoid this.
2023-09-28 17:20:23 +02:00
Jonas Jenwald
3072efa064
Merge pull request #17035 from Snuffleupagus/postcss-discard-comments
Remove comments from the *built* CSS files
2023-09-28 15:54:06 +02:00
calixteman
d7d900c65d
Merge pull request #17045 from calixteman/resize_disable_mouse
[Editor] Disable pointer events in the parent layer while an editor is resized
2023-09-28 15:51:53 +02:00
Calixte Denizet
4f6fa35a28 [Editor] Disable pointer events in the parent layer while an editor is resized 2023-09-28 15:09:50 +02:00
calixteman
f78a5ff79e
Merge pull request #17043 from calixteman/bug1855641
StructParents entry isn't required on pages with no tagged contents (bug 1855641)
2023-09-28 14:43:18 +02:00
Calixte Denizet
f2196f7803 StructParents entry isn't required on pages with no tagged contents (bug 1855641) 2023-09-28 14:23:10 +02:00
calixteman
2daf9515b3
Merge pull request #17041 from calixteman/rm_timeouts
[Editor] Clear the different timeouts when destroying
2023-09-28 12:27:20 +02:00
Calixte Denizet
8417eee0c1 [Editor] Clear the different timeouts when destroying 2023-09-28 12:03:11 +02:00
Jonas Jenwald
00c8fbe7e0
Merge pull request #17040 from Snuffleupagus/rm-save-disabled-CSS
[Editor] Remove unused CSS rules for the altText "Save"-button (PR 17015 follow-up)
2023-09-27 16:29:16 +02:00
calixteman
fb16151247
Merge pull request #17039 from calixteman/alt_text_no_tooltip_when_resizing
[Editor] Disabled the alt-text button when the editor is being resized
2023-09-27 15:37:38 +02:00
Calixte Denizet
bdb8410ad4 [Editor] Disabled the alt-text button when the editor is being resized 2023-09-27 15:13:17 +02:00
Jonas Jenwald
880abd910e [Editor] Remove unused CSS rules for the altText "Save"-button (PR 17015 follow-up)
When PR 17015 removed the `disabled` handling for the "Save"-button it left a bunch of now unused CSS rules behind, which seems like a simply oversight.
Rather than shipping "dead" CSS rules, let's remove those until such a time that they're actually needed.
2023-09-27 14:58:22 +02:00
ayush
87a1baf29f docs: Make downloadManager optional in JSDoc 2023-09-27 12:47:50 +05:30
Jonas Jenwald
7413546e16 Remove comments from the *built* CSS files
The old pre-processor used for CSS, and HTML, files leaves comments intact which unnecessarily contributes to the overall size of the *built* CSS files (note that the built JavaScript files don't include comments).
Rather than trying to "hack" comment removal into the pre-processor it seems easier to use a PostCSS plugin instead. The one potential issue is that it also affects *some* whitespaces, and it's not clear to me if this'll work with the various CSS-related tests that run in mozilla-central.

Please refer to https://www.npmjs.com/package/postcss-discard-comments for additional information.
2023-09-26 13:38:26 +02:00
calixteman
3f7060e777
Merge pull request #17034 from calixteman/bug1855157
[Editor] Don't try to add data to the struct tree when there is no accessibilityData (bug 1855157)
2023-09-26 12:04:50 +02:00
Calixte Denizet
3ee5268a23 [Editor] Don't try to add data to the struct tree when there is no accessibilityData (bug 1855157) 2023-09-26 11:02:14 +02:00
calixteman
5f75404bc3
Merge pull request #17030 from calixteman/editor_remove_editing_class
[Editor] Remove the class fooEditing from the layer when destroying it
2023-09-25 19:44:50 +02:00
calixteman
549c414ff5
Merge pull request #17031 from calixteman/bug1854991
[Editor] Slightly postpone the move in the DOM in order to not block the UI (bug 1854991)
2023-09-25 19:44:27 +02:00
Calixte Denizet
71376f089c [Editor] Remove the class fooEditing from the layer when destroying it
and simplify the way to handle the different types of editors.
2023-09-25 18:56:11 +02:00
Calixte Denizet
29bc103fad [Editor] Slightly postpone the move in the DOM in order to not block the UI (bug 1854991) 2023-09-25 18:18:01 +02:00
Tim van der Meij
57d196e349
Merge pull request #17024 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2023-09-24 20:02:49 +02:00
Tim van der Meij
a93ac2a32b
Bump the stable version in pdfjs.config 2023-09-24 19:57:55 +02:00
Tim van der Meij
ce87167432
Merge pull request #17022 from timvandermeij/fix-intermittent-us
Fix integration test "Interaction in issue14307.pdf (1) must check input for US zip format"
2023-09-24 18:47:18 +02:00
Jonas Jenwald
6112f3ee74
Merge pull request #17023 from Snuffleupagus/altText-padding
[Editor] Add padding to the altText-button to account for different locales
2023-09-24 17:46:55 +02:00
Jonas Jenwald
fc898e1b38 [Editor] Add padding to the altText-button to account for different locales
*For many non-English locales the translated strings will be longer, which is easy to forget about during development/review.*

Note how for some locales (e.g. Swedish) the altText-button end up looking horizontally "cramped", hence it seems reasonable to add a bit of inline padding to improve this.
2023-09-24 16:13:16 +02:00
Tim van der Meij
6e584adfc5
Use realistic typing delays for the scripting integration tests
In the scripting integration tests we use a few different typing
delays, mostly 100 or 200 milliseconds. According to for example
https://www.typingpal.com/en/documentation/school-edition/pedagogical-resources/typing-speed,
a fast typing speed is around 300 characters per minute, which is 5
characters per second and therefore a delay of 200 milliseconds between
each keystroke. Note that this is already above average, so in practice
the delay will be even larger. Therefore the 100 milliseconds variant
is unrealistically fast and therefore not suitable for the integration
tests which aim to simulate the average user behavior.

On top of that, the quick typing speeds are problematic for the tests
that involve validation alert dialogs appearing during typing. In those
tests a handler is registered to close the dialog once it pops up, but
it takes time for Puppeteer to notice the dialog, trigger the handler
and close it. If the typing delay, which is the delay between the key
down and key up events according to the Puppeteer source code at
https://github.com/puppeteer/puppeteer/blob/master/packages/puppeteer-core/src/cdp/Input.ts#L209-L215,
is too short, the key up event will be fired before the dialog is
closed. In that time the text box we're typing in is not focused, so
when the dialog is closed the `page.type()` call on the text box will
never resolve because the key up event never reached the text box.

This commit aims to fix the issues by converting all 100 millisecond
delays to 200 milliseconds. For instance the "must check input for US
zip format" failed pretty consistently locally before and hasn't failed
anymore with a 200 millisecond delay.
2023-09-24 15:47:21 +02:00
calixteman
48d75599d3
Merge pull request #17018 from calixteman/alt_text_test
[Editor] Add an integration test for the new alt-text flow
2023-09-24 14:34:58 +02:00
Calixte Denizet
de553456ce [Editor] Add an integration test for the new alt-text flow 2023-09-24 13:39:18 +02:00
Tim van der Meij
9b464047bc
Merge pull request #17021 from timvandermeij/fix-intermittent-autoprint
Fix integration test "Interaction in autoprint.pdf must check if printing is triggered when the document is open"
2023-09-24 13:37:18 +02:00
Tim van der Meij
b41bca7da9
Don't wait for scripting to be ready in the autoprint integration test
This integration test fails often because we wait for scripting to be
ready before we check the printed page, but most of the time the PDF
is already done printing before scripting is reported to be ready.

This happens because the print trigger is on the `Open` event, which is
one of the first events to be dispatched and, most notably, before
scripting is marked as ready; please see
https://github.com/mozilla/pdf.js/blob/master/web/pdf_scripting_manager.js#L176-L191.
Given that the PDF document is only one page, printing it is usually
finished between triggering the `Open` event and scripting reported
to be ready. If this happens the printed page is already destroyed
before we get to our actual test, which will then timeout because it
will never find the printed page in the DOM.

This commit fixes the problem by not awaiting scripting to be ready
because the fact that the printed page appears is already enough to know
that autoprint was triggered (after all, there is no other user
interaction involved here). While we're here we also switch to the
shorter `page.waitForSelector` function.
2023-09-24 12:48:58 +02:00
Jonas Jenwald
57f548c989
Merge pull request #17019 from calixteman/bug1854818
[Editor] The ::before containter containing the border of a selected editor mustn't catch mouse events (bug 1854818)
2023-09-24 12:42:50 +02:00