21376 Commits

Author SHA1 Message Date
Calixte Denizet
25990e4287 [Editor] Add a sidebar allowing the user to navigate between the comments in a pdf (bug 1985567)
This implements what has been specified but it's still not done: we have to handle editing a comment
or an annotation containing one.
2025-08-29 16:00:06 +02:00
Calixte Denizet
3e01ee9bb7 Reset editing mode when changing the pdf document 2025-08-28 22:38:05 +02:00
Tim van der Meij
13ba311e5a
Merge pull request #20211 from calixteman/fix_css_unit
[Editor] Fix unit (for consistency) and remove few useless px
2025-08-28 20:37:18 +02:00
Tim van der Meij
53c37547f0
Merge pull request #20209 from calixteman/fix_comment_icon
[Editor] Fix the dimensions of the comment icon
2025-08-28 20:33:31 +02:00
Calixte Denizet
0a4817fb71 [Editor] Fix unit (for consistency) and remove few useless px 2025-08-28 16:09:58 +02:00
Calixte Denizet
1876013e4e [Editor] Fix the dimensions of the comment icon 2025-08-27 16:01:29 +02:00
calixteman
e37a58f978
Merge pull request #20200 from calixteman/remove_useless_css2
[Editor] Remove useless CSS and fix styling for the comment button
2025-08-26 22:10:11 +02:00
Calixte Denizet
e44e470eb2 [Editor] Remove useless CSS and fix styling for the comment button 2025-08-26 22:06:49 +02:00
Tim van der Meij
d8c01bf70d
Merge pull request #20196 from calixteman/xy_getter
[Editor] Add a method to get an editor rect in the pdf page coordinates
2025-08-26 20:27:06 +02:00
Calixte Denizet
1fc039e14f [Editor] Add a method to get an editor rect in the pdf page coordinates 2025-08-26 19:40:41 +02:00
Tim van der Meij
bde01f0998
Merge pull request #20195 from timvandermeij/fix-chrome-windows
Skip the curvature ink editor integration test for Chrome on Windows
2025-08-25 21:35:13 +02:00
Tim van der Meij
11d5d6d0ce
Skip the curvature ink editor integration test for Chrome on Windows
This test permafails for that particular OS/browser combination.

Fixes 18d3dc18.
2025-08-25 20:09:32 +02:00
calixteman
5a10376e4d
Merge pull request #20191 from calixteman/link_gotoxy
Add a method goToXY in PDFLinkService in order to scroll the document at a given location
2025-08-25 20:08:03 +02:00
calixteman
261c1f9e05
Merge pull request #20194 from calixteman/update_comment_icon
[Editor] Change the icon for inline comments
2025-08-25 20:07:37 +02:00
Calixte Denizet
5ed2dfbf26 [Editor] Change the icon for inline comments 2025-08-25 20:04:56 +02:00
Calixte Denizet
1678782680 Add a method goToXY in PDFLinkService in order to scroll the document at a given location
This function is required for the commenting feature: the user will be able to click
on a comment in the sidebar and the document will be scrolled accordingly.
2025-08-25 19:57:53 +02:00
Tim van der Meij
ab41f5095c
Merge pull request #20190 from timvandermeij/text-layer-permafail
Improve the selection check in the "doesn't jump when moving selection" integration test
2025-08-25 19:40:27 +02:00
calixteman
7a65c58b5e
Merge pull request #20170 from calixteman/bug1980958
Don't iterate over all empty slots in the xref entries (bug 1980958)
2025-08-25 15:46:20 +02:00
Calixte Denizet
af144be3ba Don't iterate over all empty slots in the xref entries (bug 1980958) 2025-08-25 14:02:08 +02:00
calixteman
5d4f0659bc
Merge pull request #20182 from calixteman/add_comment_button
[Editor] Add a button to the annotation having a popup in order to edit it
2025-08-25 13:18:37 +02:00
calixteman
307ea5d25d
Merge pull request #20187 from calixteman/update_puppeteer_24.17.0
Update puppeteer to 24.17.0
2025-08-25 13:09:44 +02:00
Calixte Denizet
0af61f5bf4 Update puppeteer to 24.17.0 2025-08-25 09:33:53 +02:00
Calixte Denizet
bd8c438428 [Editor] Add a button to the annotation having a popup in order to edit it 2025-08-24 21:36:19 +02:00
Tim van der Meij
4cc93af364
Improve the selection check in the "doesn't jump when moving selection" integration test
Locally, on Arch Linux, this integration test permafails:

```
1) Text layer Text selection using selection carets doesn't jump when moving selection
  Message:
    second selection:
        Expected '(frequently executed) bytecode sequences, records
        them, and compiles them to fast native code. We call such a s' to roughly match /frequently .* We call such a se/s.
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (file:///home/timvandermeij/Documenten/Ontwikkeling/pdf.js/Code/test/integration/text_layer_spec.mjs:521:12)
  Message:
    third selection:
        Expected '(frequently executed) bytecode sequences, records
        them, and compiles them to fast native code. We call such a s' to roughly match /frequently .* We call such a se/s.
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (file:///home/timvandermeij/Documenten/Ontwikkeling/pdf.js/Code/test/integration/text_layer_spec.mjs:529:12
```

The exact selection can differ a bit per OS/browser. In this case the
last character was consistently not selected while on other platforms it
is, so this commit fixes the issue by relaxing the regex to not consider
the final character so that the test passes if the rest matches.
2025-08-24 20:46:20 +02:00
Tim van der Meij
649a03f817
Merge pull request #20189 from timvandermeij/null-signal
[Editor] Don't use a null signal for the comment button
2025-08-24 20:43:36 +02:00
Tim van der Meij
eec1bea1b4
[Editor] Don't use a null signal for the comment button
This removes the following error from the integration test logs:

```
JavaScript error: http://127.0.0.1:59283/build/generic/build/pdf.mjs, line 3879:
TypeError: EventTarget.addEventListener: 'signal' member of AddEventListenerOptions is not an object.
```

Fixes 636ff50.
Extends 63651885.
2025-08-24 20:01:10 +02:00
Tim van der Meij
535a042b01
Merge pull request #20188 from timvandermeij/chrome-webdriverbidi
Use WebDriver BiDi for Chrome
2025-08-24 19:59:31 +02:00
Tim van der Meij
18d3dc18e0
Use WebDriver BiDi for Chrome 2025-08-24 15:58:52 +02:00
calixteman
592d6c070a
Merge pull request #20179 from calixteman/add_rect_popup
[Editor] Add a Rect entry to a saved popup in order to avoid to have an invalid pdf
2025-08-24 12:01:31 +02:00
calixteman
78f63dd6db
Merge pull request #20180 from calixteman/mv_comment_button
[Editor] Move the comment button just before the delete one
2025-08-24 12:00:29 +02:00
calixteman
cfe08bd035
Merge pull request #20184 from calixteman/use_cached_annotations
Use the cached annotations when collecting them by types
2025-08-24 11:57:17 +02:00
Tim van der Meij
8be21711a4
Merge pull request #20183 from calixteman/resizer_top_editor
[Editor] Make sure the resizers are on top of the editor content
2025-08-23 21:27:35 +02:00
calixteman
4e089f210a
Merge pull request #20186 from calixteman/puppeteer_switch_nightly
Use Firefox nightly with puppeteer
2025-08-23 15:36:21 +02:00
Calixte Denizet
22c0e25eb5 Use Firefox nightly with puppeteer 2025-08-22 22:02:34 +02:00
calixteman
673f19bc2b
Merge pull request #19043 from nicolo-ribaudo/compute-bounding-boxes
Add logic to track rendering area of various PDF ops
2025-08-22 20:34:03 +02:00
Nicolò Ribaudo
6a22da9c2e
Add logic to track rendering area of various PDF ops
This commit is a first step towards #6419, and it can also help with
first compute which ops can affect what is visible in that part of
the page.

This commit adds logic to track operations with their respective
bounding boxes. Only operations that actually cause something to
be rendered have a bounding box and dependencies.

Consider the following example:
```
0. setFillRGBColor
1. beginText
2. showText "Hello"
3. endText
4. constructPath [...] -> eoFill
```
here we have three rendering operations: the showText op (2) and the
path (4). (2) depends on (0), (1) and (3), while (4) only depends on
(0). Both (2) and (4) have a bounding box.

This tracking happens when first rendering a PDF: we then use the
recorded information to optimize future partial renderings of a PDF, so
that we can skip operations that do not affected the PDF area on the
canvas.

All this logic only runs when the new `enableOptimizedPartialRendering`
preference, disabled by default, is enabled.

The bounding boxes and dependencies are also shown in the pdfBug
stepper. When hovering over a step now:
- it highlights the steps that they depend on
- it highlights on the PDF itself the bounding box
2025-08-22 18:26:59 +02:00
Calixte Denizet
ebc3411727 Use the cached annotations when collecting them by types 2025-08-21 18:04:00 +02:00
Calixte Denizet
0c6cf84274 [Editor] Make sure the resizers are on top of the editor content 2025-08-21 09:10:57 +02:00
Calixte Denizet
f8466c9ff8 [Editor] Add a Rect entry to a saved popup in order to avoid to have an invalid pdf 2025-08-20 17:56:50 +02:00
Calixte Denizet
f8ea63606c [Editor] Move the comment button just before the delete one 2025-08-20 17:18:38 +02:00
calixteman
e20ee99580
Merge pull request #20178 from calixteman/pinpoint_firefox
Use Firefox stable for the tests because bug 1983414
2025-08-20 17:04:08 +02:00
Calixte Denizet
2beb26ad14 Use Firefox stable for the tests because bug 1983414 2025-08-20 16:11:59 +02:00
calixteman
212547e865
Merge pull request #20169 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2025-08-19 10:41:27 +02:00
calixteman
65dd6b05a9
Merge pull request #20167 from calixteman/get_all_editable_annotations
[Editor] Add the ability to get all the editable annotations in a pdf document
2025-08-19 10:39:48 +02:00
Calixte Denizet
9e5ee1e5a7 [Editor] Add the ability to get all the editable annotations in a pdf document
We want to be able to show all the comments in a pdf even if the pages where they are
haven't been rendered.
And it'll help to fix the issue #18915.
2025-08-18 21:31:11 +02:00
Tim van der Meij
13de21841d
Update translations to the most recent versions 2025-08-17 16:32:29 +02:00
Tim van der Meij
d49fc494cd
Update dependencies to the most recent versions 2025-08-17 16:32:29 +02:00
Tim van der Meij
dd560ee453
Merge pull request #20171 from timvandermeij/firefox-test-prefs
Update Firefox preferences for testing
2025-08-17 16:31:16 +02:00
Tim van der Meij
844681a2fa
Disable AI/ML features using Firefox preferences for testing
We don't need AI/ML features in the tests, so this should reduce CPU
usage by not having the inference process running. Moreover, it prevents
the following lines from being logged in the test output:

```
JavaScript error: resource://gre/actors/MLEngineParent.sys.mjs, line 509: Error: Unable to get the ML engine from Remote Settings.
JavaScript error: resource://gre/actors/MLEngineParent.sys.mjs, line 1279: TypeError: can't access property "postMessage", this[#port] is null
```
2025-08-17 16:05:04 +02:00
Tim van der Meij
a05dc9c1c5
Remove obsolete Firefox preferences for testing
The following preferences don't have to be set manually anymore:

- `print.show_print_progress`
  - Why: removed
  - Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1770536
  - Commit: b522664310

- `gfx.offscreencanvas.enabled`
  - Why: removed
  - Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1914083
  - Commit: 7d2c688920

- `layout.css.round.enabled`
  - Why: removed
  - Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1874633
  - Commit: 97909653e7

- `dom.events.asyncClipboard.clipboardItem`
  - Why: enabled by default
  - Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1887845
  - Commit: de56ae88bf
2025-08-17 14:53:35 +02:00