21350 Commits

Author SHA1 Message Date
Tim van der Meij
a68630eee4
Merge pull request #20278 from calixteman/fix_comment_popup_position
[Editor] Fix the position of the comment popup and its dialog
2025-09-15 23:23:10 +02:00
Calixte Denizet
764c2e639c [Editor] Fix the position of the comment popup and its dialog
Only fix the popup position if the user didn't change it.
And don't adjust the dialog position since it should have the same as the popup.
2025-09-15 21:26:36 +02:00
Calixte Denizet
5feb4674d6 [Annotation] Save the comment changes made in reading mode (bug 1987427) 2025-09-15 19:49:49 +02:00
calixteman
394fa2c184
Merge pull request #20250 from calixteman/new_popup_reading_mode
[Annotation] Use the new popup in reading mode (bug 1987426)
2025-09-15 18:00:14 +02:00
Calixte Denizet
38b86cb97a [Annotation] Use the new popup in reading mode (bug 1987426) 2025-09-15 16:58:22 +02:00
calixteman
3432c1933e
Merge pull request #20249 from calixteman/new_comment_popup_2
[Editor] Add a new popup for comments (bug 1987425)
2025-09-15 08:27:17 +02:00
calixteman
0982ff2911
Merge pull request #20272 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2025-09-15 08:25:35 +02:00
Calixte Denizet
b660b721f9 [Editor] Add a new popup for comments (bug 1987425)
And:
 - improve the editing dialog in removing menu;
 - position correctly the popup on the left/right depending on the direction value.
2025-09-15 08:24:26 +02:00
calixteman
adf9233f46
Merge pull request #20270 from calixteman/issue20232
Consider a ttf font with both Symbolic and Nonsymbolic flags set with a Differences array in the encoding dict as non-symbolic
2025-09-14 21:37:58 +02:00
Tim van der Meij
2f53e50074
Update translations to the most recent versions 2025-09-14 19:23:35 +02:00
Tim van der Meij
637599dc23
Upgrade eslint-plugin-unicorn to version 61.0.2
This is a major version bump, but the changelog at
https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v61.0.0
doesn't indicate any breaking changes that should impact us.
2025-09-14 19:23:34 +02:00
Tim van der Meij
a730cba414
Update dependencies to the most recent versions 2025-09-14 19:23:34 +02:00
Tim van der Meij
10bc635fc8
Merge pull request #20271 from timvandermeij/integration-tests-pending
Replace manual returns with `pending` in the integration tests
2025-09-14 19:17:41 +02:00
Calixte Denizet
b6d772d71d Consider a ttf font with both Symbolic and Nonsymbolic flags set with a Differences array in the encoding dict as non-symbolic
It fixes #20232.
2025-09-14 18:52:16 +02:00
Tim van der Meij
ffeaa9111a
Replace manual returns with pending in the integration tests
This allows Jasmine to track skipped tests and makes it easier to
discover them using e.g. `grep`.
2025-09-14 18:30:17 +02:00
Tim van der Meij
1cae8e2933
Merge pull request #20269 from calixteman/dichotomic_find_color
Use a dichotomy to find a color with a good contrast ratio
2025-09-14 18:15:52 +02:00
Tim van der Meij
e78c7d0cc2
Merge pull request #20256 from nicolo-ribaudo/bboxes-when-needed
Only record bboxes when needed
2025-09-14 16:22:46 +02:00
Calixte Denizet
634bef5fb4 Use a dichotomy to find a color with a good contrast ratio
It helps to reduce the number of iterations so it makes the algorithm
slightly faster in general.
2025-09-13 15:45:00 +02:00
calixteman
2138ec17cc
Merge pull request #20267 from nicolo-ribaudo/fix-jsdoc
Fix JSDoc description in src/display/api.js
2025-09-13 15:40:47 +02:00
Nicolò Ribaudo
5de14aa429
Only record bboxes when needed
Before this patch, when `enableOptimizedPartialRendering`
is enabled we would record the bounding boxes of the
various operations on the first render.

This patches change it to happen on the first render that we
know will also need a detail view, so that the performance
cost is not paid for the case when the detail view is not used.
2025-09-12 15:02:24 +02:00
Nicolò Ribaudo
42b4d97115
Fix JSDoc description in src/display/api.js 2025-09-12 15:01:41 +02:00
calixteman
beb5f5ca85
Merge pull request #20208 from nicolo-ribaudo/bboxes-typedarray
Store ops bboxes in a linear Uint8Array
2025-09-12 14:52:42 +02:00
calixteman
d77f89026f
Merge pull request #20240 from calixteman/fix_contrast
Make sure that a good constrast ratio is respected when darkening/lightening a color
2025-09-12 09:24:40 +02:00
calixteman
0e28b5c3c4
Merge pull request #20258 from calixteman/cleanup_before_editing_mode
[Editor] Cleanup the pages not being fully rendered before switching to editing mode
2025-09-11 23:03:08 +02:00
Tim van der Meij
e8cc25c0ae
Merge pull request #20259 from calixteman/no_throw_when_switching_editing_mode
[Editor] Don't throw when switching to editing mode before an annotation editor layer is rendered
2025-09-11 22:04:47 +02:00
Calixte Denizet
7f85c00ee6 Make sure that a good constrast ratio is respected when darkening/lightening a color 2025-09-11 21:29:28 +02:00
Tim van der Meij
557eb2c7e1
Merge pull request #20253 from calixteman/scroll_and_center
Add an option in scrollIntoView and goToXY in order to be able to center vertically or horizontally the point XY in the viewer container
2025-09-11 21:20:55 +02:00
Tim van der Meij
f049360689
Merge pull request #20255 from nicolo-ribaudo/low-res
Reduce background canvas resolution
2025-09-11 21:04:27 +02:00
Nicolò Ribaudo
4c7bbd0fef
Reduce background canvas resolution
The size of the canvas has significant impact on the rendering
performance. If we are going to render a high-res detail
view on top of the full-page canvas, we can further
reduce the full-page canvas resolution to improve
rendering time without affecting the resolution seen by
the user.

Users will se the lower resolution when quickly scrolling around the
page, but it will then be replaced with the high-res
detail view.
2025-09-10 16:52:57 +02:00
Calixte Denizet
593ceadc93 [Editor] Don't throw when switching to editing mode before an annotation editor layer is rendered
It can happen with a pdf having a large text layer.
Instead of waiting for the first rendered page to enable the buttons we wait for
a rendered annotation editor layer.
2025-09-10 11:04:47 +02:00
Calixte Denizet
0fc8986dc6 [Editor] Cleanup the pages not being fully rendered before switching to editing mode
In order to see the issue this patch is fixing:
 - open a pdf with some highlights and a comment on page 1, at page 7
 - open the comment sidebar
 - click on the comment on page 1

Opening at page 7 lets a not fully rendered page which means that when jumping to it
with the sidebar, we re-use what we've instead of redrawing it.
2025-09-10 10:23:29 +02:00
Calixte Denizet
e1bdc34b4a Add an option in scrollIntoView and goToXY in order to be able to center vertically or horizontally the point XY in the viewer container 2025-09-09 13:10:49 +02:00
Nicolò Ribaudo
e4ea2e0c79
Store ops bboxes in a linear Uint8Array
This PR changes the way we store bounding boxes so that they use less
memory and can be more easily shared across threads in the future.

Instead of storing the bounding box and list of dependencies for each
operation that renders _something_, we now only store the bounding box
of _every_ operation and no dependencies list. The bounding box of
each operation covers the bounding box of all the operations affected
by it that render something. For example, the bounding box of a
`setFont` operation will be the bounding box of all the `showText`
operations that use that font.

This affects the debugging experience in pdfBug, since now the bounding
box of an operation may be larger than what it renders itself. To help
with this, now when hovering on an operation we also highlight (in red)
all its dependents. We highlight with white stripes operations that do
not affect any part of the page (i.e. with an empty bbox).

To save memory, we now save bounding box x/y coordinates as uint8
rather than float64. This effectively gives us a 256x256 uniform grid
that covers the page, which is high enough resolution for the usecase.
2025-09-09 10:24:48 +02:00
calixteman
5b7f9ca8b9
Merge pull request #20247 from calixteman/wait_for_rendered_editors
[Editor] When clicking on a comment in the sidebar, wait for the annotation editor layer to be rendered
2025-09-09 09:26:45 +02:00
calixteman
d009c434f5
Merge pull request #20248 from calixteman/toolbar_button_position
[Editor] Make sure the comment button is at the right place when adding it in the toolbar
2025-09-08 23:06:02 +02:00
calixteman
b5113d9a74
Merge pull request #20239 from timvandermeij/integration-test-unskip-timezone
Unskip the `must check that date entered by the user is consistent` scripting integration test for Firefox
2025-09-08 22:35:18 +02:00
calixteman
17a27806c6
Merge pull request #20245 from calixteman/comment_richtext
[Editor] Add the dates and rich text if any to the editors in order to use them when displaying the popup
2025-09-08 22:23:03 +02:00
Tim van der Meij
3f0d39b024
Merge pull request #20244 from calixteman/fix_deleting_popup
[Editor] Fix saving a deleted popup
2025-09-08 21:23:47 +02:00
Tim van der Meij
512c30b1f6
Unskip the must check that date entered by the user is consistent scripting integration test for Firefox
Bug 1978027 has been fixed upstream 10 days ago, so this integration
test can be enabled for Firefox too now that it passed with recent
Nightly versions.
2025-09-08 20:48:24 +02:00
Tim van der Meij
8bd13f7f25
Merge pull request #20172 from timvandermeij/misc-test-improvements
Improve the integration test code
2025-09-08 20:44:29 +02:00
Tim van der Meij
5382c54803
Merge pull request #20243 from mozilla/dependabot/github_actions/actions/setup-node-5
Bump actions/setup-node from 4 to 5
2025-09-08 20:43:01 +02:00
Tim van der Meij
7e3417f862
Merge pull request #20242 from mozilla/dependabot/github_actions/actions/setup-python-6
Bump actions/setup-python from 5 to 6
2025-09-08 20:42:35 +02:00
Calixte Denizet
f5c913bc9e [Editor] Make sure the comment button is at the right place when adding it in the toolbar 2025-09-08 17:59:28 +02:00
Calixte Denizet
94d72e903f [Editor] Add the dates and rich text if any to the editors in order to use them when displaying the popup 2025-09-08 17:40:47 +02:00
Calixte Denizet
54351ee437 [Editor] When clicking on a comment in the sidebar, wait for the annotation editor layer to be rendered
and add a getter for the layer bounding rect.
2025-09-08 17:13:37 +02:00
Calixte Denizet
2d5794f79d [Editor] Fix saving a deleted popup 2025-09-08 15:36:41 +02:00
dependabot[bot]
f9be06a8c1
Bump actions/setup-node from 4 to 5
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 5.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 12:31:52 +00:00
dependabot[bot]
a5ef8ca828
Bump actions/setup-python from 5 to 6
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 12:26:36 +00:00
calixteman
d946de904c
Merge pull request #20238 from timvandermeij/fix-freetext-permafail
Fix the rendering of XFA rich text in popup annotations
2025-09-07 20:59:36 +02:00
Tim van der Meij
f1f8ee47ff
Fix the rendering of XFA rich text in popup annotations
Before the introduction of the `renderRichText` helper function we
exclusively used `this.#html` for XFA rich text and exclusively used
`this.#contentsObj` for plain text. However, after the refactoring we
tried to access `this.#contentsObj.dir` in both cases, which fails for
XFA rich text because `this.#contentsObj` is `null` in that case.

This commit fixes the issue by using optional chaining to make sure we
don't try to access non-existent `this.#contentsObj` properties, which
makes the `must update an existing annotation and show the right popup`
freetext integration pass again.

Fixes #20237.
Fixes 35c90984.
2025-09-07 18:35:17 +02:00