5025 Commits

Author SHA1 Message Date
calixteman
466c6263ad
Merge pull request #20974 from calixteman/bug2025674
Don't walk the children of a node having some attached MathML (bug 2025674)
2026-03-26 21:33:13 +01:00
Tim van der Meij
377f6d8b73
Merge pull request #20984 from calixteman/debugger_dont_update_canvas_view
Update the canvas detail view only when drawing is done
2026-03-26 20:41:22 +01:00
Tim van der Meij
a924af2e0b
Merge pull request #20990 from calixteman/bug2026564
Hide the new badge while a page is selected (bug 2026564)
2026-03-26 20:35:56 +01:00
Calixte Denizet
b1d93d0e51 Hide the new badge while a page is selected (bug 2026564) 2026-03-26 19:23:04 +01:00
Calixte Denizet
c2ba6b0e33 Update the canvas detail view only when drawing is done
And remove the canvas from the view once it's destroyed.
2026-03-26 15:51:46 +01:00
Calixte Denizet
265de5d453
Debugger: in the tree view, display the white spaces as they're
And in the debug view, display the ltr chars in the same order as they are in showText argument.
2026-03-25 19:46:16 +01:00
calixteman
eff11e88bb
Don't walk the children of a node having some attached MathML (bug 2025674)
And now Chrome has a MathML Sanitizer implementation (146), the tests related to MathML are updated to reflect that.
2026-03-25 10:21:34 +01:00
Jonas Jenwald
777251da85
Merge pull request #20968 from Snuffleupagus/getNetworkStream
Move the `NetworkStream` choice from `src/display/api.js` and into a separate file
2026-03-25 08:33:08 +01:00
Calixte Denizet
f608d5682c Enable hardware acceleration by default 2026-03-24 23:41:05 +01:00
Jonas Jenwald
a0102abe76 Move the NetworkStream choice from src/display/api.js and into a separate file
This code already isn't used (or even bundled) in the Firefox PDF Viewer, and it also slightly reduces the number of import maps that need to be maintained.
2026-03-24 17:08:04 +01:00
Calixte Denizet
12a4fc6893
Remove the selection after the pages have been extracted (bug 2025247) 2026-03-23 10:27:44 +01:00
calixteman
2643125a12
Merge pull request #20951 from calixteman/bug2021392
Correctly scroll the search result in the viewport with rotated pdfs (bug 2021392)
2026-03-22 21:36:46 +01:00
calixteman
243659380a
Correctly scroll the search result in the viewport with rotated pdfs (bug 2021392) 2026-03-22 21:08:49 +01:00
Jonas Jenwald
3a372fde94 [api-minor] Replace the CMapReaderFactory, StandardFontDataFactory, and WasmFactory API options with a single factory/option
Currently we have no less than three different, but very similar, factories for reading built-in CMap files, standard font files, and wasm files on the main-thread.[1]
These factories were added at different points in time, since I cannot imagine that we'd add essentially three copies of the same code otherwise.

Nowadays these factories are often not even used[2], since worker-thread fetching is used whenever possible to improve performance. In particular, they will *only* be used when either:
 - The PDF.js library runs in Node.js environments.
 - The user manually sets `useWorkerFetch = false` when calling `getDocument`.
 - The user provides custom `CMapReaderFactory`, `StandardFontDataFactory`, and/or `WasmFactory` instances when calling `getDocument`.

By replacing these factories with *a single* new `BinaryDataFactory` factory/option the number of `getDocument` options are thus reduced, which cannot hurt.
This also reduces the total bundle-size of the Firefox PDF Viewer a little bit, and it slightly reduces the number of import maps that need to be maintained.

*Please note:* For users that provide custom `CMapReaderFactory`, `StandardFontDataFactory`, and `WasmFactory` instances when calling `getDocument` this will be a breaking change, however it's unlikely that (many) such users exist.
(The *internal* format data-format of `CMapReaderFactory` was changed in PR 18951, and there hasn't been a single question/complaint about it in well over a year.)

---

[1] Any new functionality could easily lead to more such factories being added in the future, which wouldn't be great.

[2] Note that the Firefox PDF Viewer no longer use these factories, since it "forcibly" sets `useWorkerFetch = true` during building.
2026-03-22 15:49:06 +01:00
calixteman
918a319de6
Merge pull request #20885 from calixteman/gouraud_gpu
Implement Gouraud-based shading using WebGPU.
2026-03-21 15:18:56 +01:00
calixteman
86441e9eb8
Implement Gouraud-based shading using WebGPU.
The WebGPU feature hasn't been released yet but it's interesting to see how
we can use it in order to speed up the rendering of some objects.
This patch allows to render mesh patterns using WebGPU.

I didn't see any significant performance improvement on my machine (mac M2)
but it may be different on other platforms.
2026-03-21 14:34:32 +01:00
Tim van der Meij
d66629376e
Merge pull request #20934 from Snuffleupagus/fix-TextLayerBuilder-abortSignal
Ensure that `TextLayerBuilder` works correctly without the `abortSignal` parameter (PR 20928 follow-up)
2026-03-21 13:48:02 +01:00
Jonas Jenwald
4c0504460f [Debugger] Allow debugging page-rendering from the /Ref, in addition to the pageNumber
Currently it's only possible to trigger page-render debugging through the page number, but when looking at the /Pages tree it's often not immediately obvious what the page number actually is.
However, the /Ref of the page is directly available and it's thus handy to be able to use that one instead to enable page-render debugging.
2026-03-21 12:06:30 +01:00
Jonas Jenwald
ba796a3441 Ensure that TextLayerBuilder works correctly without the abortSignal parameter (PR 20928 follow-up)
After the changes in PR 20928 the code no longer works correctly unless the `abortSignal` parameter is provided, which completely breaks text-selection in e.g. the standalone viewer-components with errors such as:
```
 #renderTextLayer: TypeError: EventTarget.addEventListener: 'signal' member of AddEventListenerOptions is not an object.
    #bindMouse http://localhost:8888/web/text_layer_builder.js:173
    render http://localhost:8888/web/text_layer_builder.js:128
    #renderTextLayer http://localhost:8888/web/pdf_page_view.js:532
    resultPromise http://localhost:8888/web/pdf_page_view.js:1184
    promise callback*draw http://localhost:8888/web/pdf_page_view.js:1174
    renderView http://localhost:8888/web/pdf_rendering_queue.js:219
    forceRendering http://localhost:8888/web/pdf_viewer.js:2081
    promise callback*forceRendering http://localhost:8888/web/pdf_viewer.js:2080
    renderHighestPriority http://localhost:8888/web/pdf_rendering_queue.js:84
    update http://localhost:8888/web/pdf_viewer.js:1895
    onScaleChanging http://localhost:8888/web/app.js:2755
    dispatch http://localhost:8888/web/event_utils.js:115
    #setScaleUpdatePages http://localhost:8888/web/pdf_viewer.js:1555
    #setScale http://localhost:8888/web/pdf_viewer.js:1640
    set currentScaleValue http://localhost:8888/web/pdf_viewer.js:592
    setInitialView http://localhost:8888/web/app.js:1969
    load http://localhost:8888/web/app.js:1570
    promise callback*load/< http://localhost:8888/web/app.js:1518
    promise callback*load http://localhost:8888/web/app.js:1507
    open http://localhost:8888/web/app.js:1255
    promise callback*open http://localhost:8888/web/app.js:1253
    run http://localhost:8888/web/app.js:895
    webViewerLoad http://localhost:8888/web/viewer.js:366
    <anonymous> http://localhost:8888/web/viewer.js:377
pdf_page_view.js:547:15
```
2026-03-20 23:22:11 +01:00
calixteman
e577141154
Merge pull request #20906 from calixteman/debugger_text
Add the possibility to debug only text rendering by filtering the op list.
2026-03-20 22:39:18 +01:00
calixteman
cf3b3fa900 Add the possibility to debug only text rendering by filtering the op list.
And a specific view for inspecting font information and the text layer on top of the canvas.
2026-03-20 22:28:34 +01:00
calixteman
977e4f2c4a
Merge pull request #20928 from calixteman/pass_global_signal_text_layer
Pass the global signal the text layer builder in order to remove all the listeners defined here
2026-03-20 18:36:25 +01:00
calixteman
5a240f7802
Merge pull request #20932 from calixteman/bug2023150
Trigger the current find after a page has been moved (bug 2023150)
2026-03-20 18:07:24 +01:00
Calixte Denizet
e1f02be670
Pass the global signal the text layer builder in order to remove all the listeners defined here
The goal of this patch is to remove the noice we've in the logs:
```
 0:09.36 INFO Console message: [JavaScript Warning: "Script terminated by timeout at:
reset@resource://pdf.js/web/viewer.mjs:11773:7
EventListener.handleEvent*#enableGlobalSelectionListener@resource://pdf.js/web/viewer.mjs:11787:12
render@resource://pdf.js/web/viewer.mjs:11716:20
async*#renderTextLayer@resource://pdf.js/web/viewer.mjs:12108:28
draw/resultPromise<@resource://pdf.js/web/viewer.mjs:12575:53
promise callback*draw@resource://pdf.js/web/viewer.mjs:12570:8
renderView@resource://pdf.js/web/viewer.mjs:7872:14
forceRendering/<@resource://pdf.js/web/viewer.mjs:13963:29
" {file: "resource://pdf.js/web/viewer.mjs" line: 11773}]
```
2026-03-20 18:06:39 +01:00
calixteman
5bdeb79b09
Merge pull request #20926 from calixteman/bug2022516
Correctly focus the pasted page (bug 2022516)
2026-03-20 17:47:02 +01:00
calixteman
2c5812006a
Merge pull request #20929 from calixteman/bug2022481
Add the basic telemetry for Organize feature (bug 2022481)
2026-03-20 17:44:19 +01:00
calixteman
16aee06aac
Merge pull request #20925 from calixteman/reorganize_save_annotations
Add the possibility to save added annotations when reorganizing a pdf (bug 2023086)
2026-03-20 16:32:10 +01:00
Calixte Denizet
118228480b Trigger the current find after a page has been moved (bug 2023150) 2026-03-20 16:22:53 +01:00
Calixte Denizet
008181a43e
Add the basic telemetry for Organize feature (bug 2022481) 2026-03-20 14:33:55 +01:00
Calixte Denizet
4aee2e8f2c Correctly focus the pasted page (bug 2022516) 2026-03-20 11:39:57 +01:00
Calixte Denizet
04272de41d
Add the possibility to save added annotations when reorganizing a pdf (bug 2023086) 2026-03-20 10:55:47 +01:00
Calixte Denizet
1db3774540 Make sure the menuitems are readable when hovering them (bug 2023138)
Simplify a bit the html for the menu: remove the li elements.
Make sure the the menuitems are exposed when disabled.
2026-03-20 10:01:45 +01:00
calixteman
a98449510c
Merge pull request #20913 from calixteman/new_badge
Add a new badge close to the Manage button in the sidebar.
2026-03-18 21:38:47 +01:00
calixteman
e65d643af5
Merge pull request #20907 from calixteman/fix_bad_bugs
Fix various bug around copy/paste/delete/undo (bug 2022586, bug 2022824, bug 2022884, bug 2023171, bug 2023176)
2026-03-18 21:38:15 +01:00
Calixte Denizet
85d88e59f3
Add a new badge close to the Manage button in the sidebar. 2026-03-18 21:05:00 +01:00
Calixte Denizet
75cb69eef2
Fix various bug around copy/paste/delete/undo (bug 2022586, bug 2022824, bug 2022884, bug 2023171, bug 2023176)
Those bugs are more or less related so it's why they're all fixed together in the same patch.
2026-03-18 13:57:20 +01:00
Calixte Denizet
bab17136ed Fix the outline of the deselect button in the sidebar (bug 2024156)
I noticed a typo in class name (hiddden for hidden) and I found few others I fixed.
2026-03-18 12:53:48 +01:00
calixteman
979d9c3091
Merge pull request #20895 from calixteman/issue20893
Fix the position of 'Attachments' in the sidebar
2026-03-18 11:24:22 +01:00
Calixte Denizet
96d1465aab Allow to collapse/expand all the outlines in double clicking somewhere on the header bar (bug 2019550) 2026-03-18 10:26:04 +01:00
Calixte Denizet
44f4627600 Fix the position of 'Attachments' in the sidebar
It fixes #20893.
2026-03-18 10:09:23 +01:00
Calixte Denizet
5493585b54
Try to fix few intermittents bug in reorganize_pages_spec integration tests 2026-03-16 22:00:42 +01:00
Tim van der Meij
0a2c030c8b
Merge pull request #20888 from calixteman/debugger_skip_ops
Add the possibility to skip some ops in the debug view
2026-03-16 20:36:48 +01:00
Tim van der Meij
481a0cbe62
Merge pull request #20889 from calixteman/debugger_search_btns
(Debugger) Replace checkboxes in the search bar by toggle buttons
2026-03-16 20:35:17 +01:00
calixteman
fc286aac4e
(Debugger) Don't draw the checkerboard on the canvas but add it behind 2026-03-15 23:20:18 +01:00
calixteman
c7837580b9
(Debugger) Replace checkboxes in the search bar by toggle buttons 2026-03-15 22:46:13 +01:00
calixteman
e85c30e08a
Add the possibility to skip some ops in the debug view
The user has to click in the space before an op to add a breakpoint
and click again in order to skip it.
2026-03-15 22:25:45 +01:00
Tim van der Meij
c2acab55d9
Merge pull request #20765 from calixteman/update_eslint
Update eslint to version 10
2026-03-15 20:26:09 +01:00
calixteman
d5ac981d62
Update eslint to version 10
Unfortunately, eslint-plugin-import depends on eslint 9. This plugin doesn't seem to be
actively maintained (lot of open issues and PRs).
Fortunately there's a fork of the plugin that doesn't support eslint 10 yet but is actively maintained.
So this PR changes the eslint version to 10 and replaces eslint-plugin-import with eslint-plugin-import-x.
2026-03-15 19:36:54 +01:00
Jonas Jenwald
e05df11e98 Increase the maximum viewer scale to 2500 percent
After PR 19128 huge zoom levels should no longer be an issue, so let's increase the maximum viewer scale a bit.
2026-03-15 15:45:34 +01:00
calixteman
a3a205d69b
Merge pull request #20871 from calixteman/refactor_debugger
Split the new debugger into multiple files
2026-03-15 14:29:13 +01:00