7295 Commits

Author SHA1 Message Date
calixteman
520363b350
Merge pull request #20384 from calixteman/bug1937438
Make MathML elements visible in the struct tree (bug 1937438)
2025-10-23 17:55:42 +02:00
Calixte Denizet
e5a62c8d06 Make MathML elements visible in the struct tree (bug 1937438)
It'll help to make math equations "visible" for screen readers.
MS Office has a specific way to add some MathML code to struc tree leaf
and this patch handles it.
2025-10-23 16:29:01 +02:00
calixteman
638861008f
Merge pull request #20388 from calixteman/bug1995705
[Editor] Avoid to have several Undo entries in the context menu (bug 1995705)
2025-10-23 09:01:19 +02:00
Calixte Denizet
19cbdba434 [Editor] Avoid to have several Undo entries in the context menu (bug 1995705) 2025-10-22 19:45:52 +02:00
calixteman
1a8689b9be
Merge pull request #20340 from Aditi-1400/serialize-pattern-ab
Serialize pattern data into ArrayBuffer
2025-10-22 11:05:22 +02:00
Calixte Denizet
9205305dbb Add a highlightSpan function in order to simplify a bit the integration tests 2025-10-19 19:37:41 +02:00
Calixte Denizet
199b3d04df Fix stream use when getting the text (follow-up of #20373) 2025-10-18 22:58:27 +02:00
calixteman
b0e8c39f31
Merge pull request #20373 from calixteman/get_original_stream
Use stream for whatever substrem in stream classes
2025-10-18 14:53:49 +02:00
Calixte Denizet
05f368056d Use stream for whatever substrem in stream classes
and add a method in order to get the original stream.
When writing an existing stream it'll help to have the original one instead of the filtered one.
2025-10-17 22:26:05 +02:00
Tim van der Meij
bd0bf03a68
Merge pull request #20375 from calixteman/fix_color_copy_paste
[Editor] Make sure the color picker has the right color when pasting an editor
2025-10-17 21:05:44 +02:00
Calixte Denizet
97fec3ab81 [Editor] Make sure the color picker has the right color when pasting an editor 2025-10-17 19:37:05 +02:00
Calixte Denizet
18a7a82c29 [Editor] FreeText annotations aren't supposed to have an attached popup so disable commenting for them (bug 1995028) 2025-10-17 18:33:15 +02:00
calixteman
928a758811
Merge pull request #20372 from calixteman/bug1994958
[Editor] Fix the tooltip of the comment button when in the editor toolbar (bug 1994958)
2025-10-17 16:20:30 +02:00
Calixte Denizet
54ffd860ec [Editor] Fix the tooltip of the comment button when in the editor toolbar (bug 1994958) 2025-10-17 15:47:55 +02:00
Tim van der Meij
1c1becf60b
Merge pull request #20369 from calixteman/bug1994738
[Editor] Correctly focus the annotation once the comment has been removed in the annotation layer (bug 1994738)
2025-10-16 20:43:55 +02:00
Calixte Denizet
fd3f7528b6 [Editor] Correctly focus the annotation once the comment has been removed in the annotation layer (bug 1994738) 2025-10-16 16:12:36 +02:00
Calixte Denizet
bb2a1126e6 Use a binary format for the glyph paths
We used a SVG string which can be pass to the Path2D ctor but it's a bit slower than
building the path step by step.
Having numerical data instead of a string will help the font data serialization.
2025-10-16 15:52:51 +02:00
Nicolò Ribaudo
d79651e797
Reset sameLineText dependencies data on setTextMatrix
The position of the text rendered by `showText` is affected
incrementally by the preceding `showText` operations "on the same line".
For this reason, we keep track of all of them (with their dependencies)
in `sameLineText`.

`sameLineText` can be reset whenever we explicitly position the text
somewhere else. We were previously only doing it for `moveText`, and
this patch updates the code to also do it on `setTextMatrix` (which
resets `this.current.x/y` in `CanvasGraphics` to 0).

The complexity of subsequent `sameLineText` operations dependency
tracking grows quadratically with the number of operations on the same
line, so this patch fixes the performance problem when there are whole
pages of text that only use `setTextMatrix` and not `moveText`.
2025-10-15 17:56:30 +02:00
Calixte Denizet
aab521327b Very slightly improve intersector performance
It just avoid useless computations.
2025-10-13 14:55:44 +02:00
Aditi
fa631806bf Serialize pattern data into ArrayBuffer
Follow up on https://github.com/mozilla/pdf.js/pull/20197,
This serializes pattern data into an ArrayBuffer which is
then transferred from the worker to the main thread.

It sets up the stage for us to eventually switch to a
SharedArrayBuffer in the future.
2025-10-11 01:58:07 +05:30
calixteman
30fdf16071
Merge pull request #20354 from Aditi-1400/use-enum
Use enums instead of string for mesh shading figure type
2025-10-10 18:49:50 +02:00
calixteman
0d8a300777
Merge pull request #20353 from calixteman/improve_intersector
[Annotation] Improve the performance of the code for getting glyphs which belongs to annotations bounding boxes (bug 1987914)
2025-10-10 13:31:03 +02:00
Calixte Denizet
c4d436764c [Annotation] Improve the performance of the code for getting glyphs which belongs to annotations bounding boxes (bug 1987914)
Instead of looking at every bbox, we use a grid (64x64) where each cell of the grid is associated with the bboxes
touching it.
In order to get the potential bboxes containing a point, we just have to compute the number of the cell containing
it and in using the associated described above, we can quickly know if the point is contained.
With the pdf in the mentioned bug, it's ~20 times faster.
2025-10-10 13:28:18 +02:00
calixteman
c8d8f9fbb4
Merge pull request #20352 from calixteman/improve_struct_tree_parser
Improve performance of the struct tree build (bug 1987914)
2025-10-10 13:27:11 +02:00
Aditi
e8d08c941c Use enums instead of string for mesh shading figure type 2025-10-10 04:21:03 +05:30
Tim van der Meij
0fedfc9ceb
Merge pull request #20351 from calixteman/avoid_null
[Editor] Avoid to have a null button in the DOM when there's no comment manager
2025-10-09 20:57:20 +02:00
Calixte Denizet
f5a6dd4164 [Annotation] Use the annotations rect in order to fix the order in the DOM (bug 1987914)
It's just a partial fix for bug 1987914 but the time spent to add the annotations in the DOM
is divided by 5.
2025-10-09 17:43:49 +02:00
Calixte Denizet
9797dc0eb4 Improve performance of the struct tree build (bug 1987914)
For the pdf in bug 1987914, the overall time spent in `addTopLevelNode` is dropping from ~6s to ~70ms.
2025-10-09 16:08:56 +02:00
Calixte Denizet
16d0077387 [Editor] Avoid to have a null button in the DOM when there's no comment manager 2025-10-09 09:25:43 +02:00
Calixte Denizet
41dea1e38b [Editor] Make sure that annotation positions in the DOM respect the visual order (bug 1992770) 2025-10-08 15:11:09 +02:00
Calixte Denizet
5c28346abc [Editor] Make sure all editors are focusable with the keyboard (bug 1992868) 2025-10-07 21:15:26 +02:00
Calixte Denizet
be987f2fbf [Editor] Make sure that comment stuff is removed when an editor is deleted (bug 1992987) 2025-10-07 19:09:48 +02:00
Tim van der Meij
68ed5be9ac
[Editor] Remove obsolete arguments for setDims calls in the highlight code
The `width` and `height` arguments for `setDims` have been removed in
PR #20285, but for two calls in the highlight code they remained. This
commit removes them as they are no longer used in the method itself.

Fixes 0722faa9.
2025-10-05 13:52:09 +02:00
Calixte Denizet
19ff148163 Fix incremental saving with hybrid references
This patch removes some previous fixes which are now likely fixed by #17636.

Fixes #20302.
2025-10-04 18:31:55 +02:00
Calixte Denizet
4d15bfec0d Only apply word spacing when there is a 0x20 in the text chunk
Fixes #20319.
2025-10-03 22:18:02 +02:00
calixteman
3234912c86
Merge pull request #20224 from james-atticus/improve-serif-fallback-font-name-matching
Improve serif fallback font name matching
2025-10-01 19:58:13 +02:00
calixteman
042e821bec
Merge pull request #20320 from calixteman/bug1991584
[Annotation] Fix some timezone issues when getting a date from the date picker (bug 1991584)
2025-10-01 00:41:17 -11:00
calixteman
cd66ecf3d2
Merge pull request #20318 from calixteman/fix_editorStats
[Editor] Avoid an error when getting the editors telemetry data
2025-10-01 00:40:35 -11:00
Calixte Denizet
12066af578 [Editor] Add a fake annotation (in the annotation layer) associated with an editor in order to be able to show the comment button (bug 1989420) 2025-10-01 09:08:57 +02:00
Calixte Denizet
7b9cde1daf [Annotation] Fix some timezone issues when getting a date from the date picker (bug 1991584) 2025-09-30 11:07:31 +02:00
Calixte Denizet
678aec9890 [Editor] Avoid an error when getting the editors telemetry data 2025-09-29 16:41:15 +02:00
Calixte Denizet
02ddf277ab [Editor] Add some telemetry for the commenting feature (bug 1991172) 2025-09-26 21:04:09 +02:00
Calixte Denizet
7fc7b79cd0 [Annotation] In reading mode with new commment stuff enabled, use the comment popup for annotations without a popup but with some contents (bug 1991029) 2025-09-26 18:24:55 +02:00
Calixte Denizet
f547e834e1 [Editor] Give the focus to the comment button after editing in reading mode 2025-09-26 17:18:37 +02:00
calixteman
7051fd0215
Merge pull request #20307 from calixteman/bug1990872
[Editor] Make sure the selected editor is correctly focused after switching editing mode (bug 1990872)
2025-09-26 09:17:48 +02:00
Calixte Denizet
888df7c319 [Editor] Make sure the selected editor is correctly focused after switching editing mode (bug 1990872) 2025-09-25 22:42:32 +02:00
Calixte Denizet
442932f0b3 [Editor] Move the focus to the comment button once editing is done (bug 1990820) 2025-09-25 20:17:52 +02:00
Calixte Denizet
90e56b706e [Editor] Add a title to the comment buttons (bug 1990813) 2025-09-25 18:47:49 +02:00
Calixte Denizet
0b40bf1743 [Editor] Update the color and the position of the comment button in reading mode they've been modified 2025-09-24 09:45:37 +02:00
calixteman
48c10d8938
Merge pull request #20285 from calixteman/editor_remove_useless_dim_stuff
[Editor] Remove useless computations when setting the dimensions of an editor
2025-09-23 20:26:12 +02:00