4913 Commits

Author SHA1 Message Date
Tim van der Meij
f626a368a5
Merge pull request #20743 from calixteman/bug2010822
Tweak the background color of the sidebar (bug 2010822)
2026-02-26 22:01:50 +01:00
Tim van der Meij
52efe65f12
Merge pull request #20741 from calixteman/fix_resizer_position
Slightly move the resizer on the sidebar (bug 2019585)
2026-02-26 22:00:32 +01:00
Tim van der Meij
f05caaf5e9
Merge pull request #20731 from calixteman/remove_page_id
Remove useless page-id attribute in thumbnails
2026-02-26 21:58:36 +01:00
calixteman
881f9779e6
Don't check for surrogates when verifying the chars to normalize 2026-02-26 16:46:34 +01:00
Calixte Denizet
b263841584
Tweak the background color of the sidebar (bug 2010822)
And tweak its position as required by UX/UI.
2026-02-26 15:39:08 +01:00
Calixte Denizet
241e8c18b9
Slightly move the resizer on the sidebar (bug 2019585)
And add a white border to the resizer in order to make it visible whatever the background is.
2026-02-26 14:35:13 +01:00
Jonas Jenwald
b07d14c88c Don't expand/collapse the entire outline when shift-clicking on the triangles (PR 20508 follow-up) 2026-02-26 13:00:06 +01:00
Calixte Denizet
a48118db41 Remove useless page-id attribute in thumbnails
And make sure that the sidebar is fully open before starting the tests in
order to have an intermittent exception when finishing the test.
2026-02-25 15:15:41 +01:00
Jonas Jenwald
185fee680a Use Map.prototype.getOrInsertComputed() in the web/struct_tree_layer_builder.js file 2026-02-24 09:04:37 +01:00
Jonas Jenwald
0d4e587a5f Reduce allocations when using Map.prototype.getOrInsert() with Arrays
Change all these cases to use `Map.prototype.getOrInsertComputed()` instead, in combination with a helper function for creating the `Array`s (similar to the previous patch).
2026-02-24 09:03:32 +01:00
Jonas Jenwald
2e07715c9d Reduce function creation when using Map.prototype.getOrInsertComputed()
With the exception of the first invocation the callback function is unused, which means that a lot of pointless functions may be created.
To avoid this we introduce helper functions for simple cases, such as creating `Map`s and `Objects`s.
2026-02-24 08:58:28 +01:00
Calixte Denizet
63c340fa35
Add keyboard shortcuts for copying/cutting/deleting the pages (bug 2018139, bug 2010831) 2026-02-22 22:17:59 +01:00
calixteman
fb902c16e1
Correctly generate the NormalizeWithNFKC string in generic build
It fixes #20689.
2026-02-22 19:50:42 +01:00
Jonas Jenwald
e62a990ae2
Merge pull request #20704 from Snuffleupagus/getPageAdvance-getOrInsert
Use `Map.prototype.getOrInsert()` in the `_getPageAdvance` method
2026-02-22 10:32:44 +01:00
Jonas Jenwald
3940855511 Use Map.prototype.getOrInsert() in the _getPageAdvance method
Also, change the method to an actually private one.
2026-02-21 11:31:03 +01:00
Calixte Denizet
5f9a9f58ce
Only show the status bar in the views manager when it's in thumbnails mode (bug 2016656) 2026-02-20 22:33:34 +01:00
Tim van der Meij
6f0d8d561f
Merge pull request #20695 from calixteman/bug2018125
Update the page count in the UI when some changes are done (bug 2018125)
2026-02-20 21:40:16 +01:00
Tim van der Meij
b2cf54353c
Merge pull request #20693 from calixteman/bug2016321
Fix the style of the thumbnails in HCM (bug 2016491, bug 2016321, bug 2016323, bug 2016827)
2026-02-20 20:44:53 +01:00
Tim van der Meij
12ec25c9a7
Merge pull request #20694 from calixteman/bug2018134
Fix the menu dimensions when on of the item is too long (bug 2018134)
2026-02-20 20:41:43 +01:00
Tim van der Meij
f395042b8d
Merge pull request #20692 from Snuffleupagus/debugger-findIndex
Replace the `getStatIndex` helper, in `web/debugger.mjs`, with native functionality
2026-02-20 20:33:00 +01:00
Calixte Denizet
bd3f14f62d
Update the page count in the UI when some changes are done (bug 2018125) 2026-02-20 18:06:48 +01:00
Calixte Denizet
bff6f4cc01
Fix the style of the thumbnails in HCM (bug 2016491, bug 2016321, bug 2016323, bug 2016827) 2026-02-20 17:30:40 +01:00
Calixte Denizet
55448fd01c
Fix the menu dimensions when on of the item is too long (bug 2018134) 2026-02-20 17:19:31 +01:00
Jonas Jenwald
06e7f308fd Replace the getStatIndex helper, in web/debugger.mjs, with native functionality
This code is old enough that it predates the existence of `Array.prototype.findIndex()`, hence why a helper function was originally needed.
2026-02-20 14:09:20 +01:00
Calixte Denizet
0dcc96a09d
Fix the color of the arrow on buttons when hovering in HCM (bug 2016311) 2026-02-18 20:04:44 +01:00
Calixte Denizet
0149527a4b
Add the possibility to navigate with the keyboard to go from a checkbox to an other in the thumbnail view (bug 2016007) 2026-02-18 18:35:54 +01:00
Calixte Denizet
d755fba96a
Add support for deleting, cutting, copying and pasting pages (bug 2010830, 2010831) 2026-02-18 16:43:00 +01:00
calixteman
e331d458cb
Merge pull request #20679 from calixteman/bug2016142
Add an aria-label to the sidebar resizer (bug 2016142)
2026-02-18 16:33:53 +01:00
Calixte Denizet
5290534c53
Correctly handle tab/page down when on a menu (bug 2016212) 2026-02-18 10:17:39 +01:00
Calixte Denizet
65f1b9b95b
Add an aria-label to the checkboxes in the thumbnails view (bug 2016136) 2026-02-17 20:58:10 +01:00
Tim van der Meij
178261a813
Merge pull request #20463 from matt-atticus/fix-text-selection-under-search-highlight
fix: support text selection under search highlights
2026-02-17 20:03:42 +01:00
Tim van der Meij
5084e3d0ec
Merge pull request #20675 from calixteman/bug2015916
Fix the keyboard accessibility of the manage button in the thumbnails view (bug 2015916)
2026-02-17 20:03:19 +01:00
Calixte Denizet
f4a2fd60db
Fix the keyboard accessibility of the manage button in the thumbnails view (bug 2015916) 2026-02-17 19:00:20 +01:00
Calixte Denizet
167dc5a415
Add an aria-label to the sidebar resizer (bug 2016142) 2026-02-17 13:38:56 +01:00
Jonas Jenwald
6323afab46 Convert the PDFObjects class to use a Map internally
This patch also adds unconditional `Map.prototype.getOrInsertComputed()` usage, which should be fine since it's [supported in the latest browsers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/getOrInsertComputed#browser_compatibility) and it'll be polyfilled (via core-js) in the `legacy` builds.
2026-02-17 09:42:27 +01:00
Matthew Lawrence
f01e4d477e fix: prevent search highlights from interfering with drag-selection 2026-02-17 13:46:02 +11:00
Jonas Jenwald
170599f1e7 Enable the unicorn/prefer-class-fields ESLint plugin rule
This leads to slightly shorter code[1] when initializing classes, and in some cases we can even remove the constructors, which shouldn't hurt; see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-class-fields.md

It's probably possible to also change a lot of these class fields to private ones[2], however it's often difficult to tell at a glance if that's safe hence this patch only does this for the `PDFRenderingQueue`.

---

[1] This reduces the size of the `gulp mozcentral` output by 999 bytes, for a mostly mechanical code change.

[2] That sort of re-factoring should generally be done separately, on a class-by-class basis, to reduce the risk of regressions.
2026-02-14 12:33:34 +01:00
calixteman
45c7805daf
Fix types to make "gulp typestest" succeeding 2026-02-13 22:34:04 +01:00
Jonas Jenwald
d595b09d01 Enable a couple of additional eslint-plugin-unicorn rules
- `no-useless-collection-argument` which required no code changes, see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-collection-argument.md
 - `prefer-classlist-toggle` which required one change (done automatically with `gulp lint --fix`), see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-classlist-toggle.md
2026-02-13 11:25:58 +01:00
Jonas Jenwald
385c936318 [api-minor] Update the minimum supported Google Chrome version to 118
This patch updates the minimum supported browsers as follows:
 - Google Chrome 118, which was released on 2023-10-10; see https://chromereleases.googleblog.com/2023/10/stable-channel-update-for-desktop_10.html

We haven't made any changes to the supported Google Chrome version for a year, and this change allows us to remove "hacks" needed to support `float: inline-start/inline-end` in old browsers; see https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/float#browser_compatibility.

Note that nowadays we usually try, where feasible and possible, to support browsers that are about two years old. By limiting support to only "recent" browsers we reduce the risk of holding back improvements of the *built-in* Firefox PDF Viewer, and also (significantly) reduce the maintenance/support burden for the PDF.js contributors.

*Please note:* As always, the minimum supported browser version assumes that a `legacy`-build of the PDF.js library is being used; see https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support
2026-02-09 12:16:46 +01:00
calixteman
4b4ab10c54
Set a pages mapper per loaded document
It fixes #20629.
2026-02-08 21:09:27 +01:00
Calixte Denizet
280a02150e
In tagged pdfs, TH can be either a column header or a row header (bug 2014080) 2026-02-06 10:04:13 +01:00
calixteman
222a24c623
Merge pull request #20622 from calixteman/bug2014167
Let the toggle button in the alt-text dialog downloading (resp. delete) the model and enabling (resp. disabling) alt-text guessing (bug 2014167)
2026-02-04 14:13:05 +01:00
Calixte Denizet
ea993bfc1b
Let the toggle button in the alt-text dialog downloading (resp. delete) the model and enabling (resp. disabling) alt-text guessing (bug 2014167) 2026-02-03 20:27:06 +01:00
Calixte Denizet
c7bea3b342
Avoid to have to download the model when toggling the button in the alt-text image settings dialog (bug 2013899) 2026-02-03 19:26:33 +01:00
Jonas Jenwald
bfd17b2586
Merge pull request #20615 from Snuffleupagus/transport-onProgress
Report loading progress "automatically" when using the `PDFDataTransportStream` class, and remove the `PDFDataRangeTransport.prototype.onDataProgress` method
2026-02-01 22:36:43 +01:00
Tim van der Meij
3f21efc942
Merge pull request #20607 from Snuffleupagus/rm-web-interfaces
Replace the various interfaces in `web/interfaces.js` with proper classes
2026-02-01 20:31:13 +01:00
Jonas Jenwald
d25f13d1fd Report loading progress "automatically" when using the PDFDataTransportStream class, and remove the PDFDataRangeTransport.prototype.onDataProgress method
This is consistent with the other `BasePDFStream` implementations, and simplifies the API surface of the `PDFDataRangeTransport` class (note the changes in the viewer).
Given that the `onDataProgress` method was changed to a no-op this won't affect third-party users, assuming there even are any since this code was written specifically for the Firefox PDF Viewer.
2026-02-01 18:20:19 +01:00
Jonas Jenwald
023af46186 Replace the IRenderableView interface with an abstract RenderableView class
This should help reduce the maintenance burden of the code, since you no longer need to remember to update separate code when touching the different page/thumbnail classes.
2026-02-01 17:56:06 +01:00
Jonas Jenwald
839c257f87 Replace the IDownloadManager interface with an abstract BaseDownloadManager class
This should help reduce the maintenance burden of the code, since you no longer need to remember to update separate code when touching the different `DownloadManager` classes.
2026-02-01 17:56:03 +01:00