4836 Commits

Author SHA1 Message Date
calixteman
eaf49c1057
Avoid to have a mail link with string having the format ddd@d.dddd
It fixes #20523.
2025-12-24 19:42:18 +01:00
Tim van der Meij
7f1f5ecf09
Merge pull request #20521 from calixteman/issue20520
Dont' throw when adding page labels in thumbnails
2025-12-23 14:49:57 +01:00
calixteman
01531dac06
Simplify regex escaping 2025-12-23 10:00:36 +01:00
Calixte Denizet
6d95eaad28
Dont' throw when adding page labels in thumbnails
It fixes #20520.
2025-12-22 23:15:20 +01:00
calixteman
923a778d26
Escape punctuation signs in search query
It fixes #20516.

The chars `*{}()[]\` are punctuation signs in regex, so they need to be escaped
when searching for them literally.
2025-12-22 17:41:53 +01:00
calixteman
2367196a00
Change the sidebar for a views manager
Update the styles and HTML to reflect the new views manager concept.
For now, nothing about split/merge functionality is implemented or visible.
The new styles for the outline, attachments, and layers will be added later.

The thumbnail view is now accessible with the keyboard.
2025-12-15 17:43:52 +01:00
Calixte Denizet
f42a120aac
Fix some css in the tree view
It's a follow-up of #20493.
And simplify a bit the js to have only one click listener in the tree instead of
having one on each toggler.
2025-12-15 16:19:10 +01:00
Tim van der Meij
6c746260a9
Merge pull request #20500 from calixteman/fix_menu_rtl
Fix the position of the checkmark when the menu is displayed in RTL
2025-12-13 14:26:33 +01:00
Tim van der Meij
8b4fae0a84
Merge pull request #20482 from Uzair-Ahmed-Shah/fix-issue-20420
Fix #20420: Prevent double decoding of file URL parameter
2025-12-13 14:22:47 +01:00
Calixte Denizet
9de04ef3de
Fix the position of the checkmark when the menu is displayed in RTL 2025-12-12 17:33:20 +01:00
Nicolò Ribaudo
7e0c9395fb
Simplify positioning of elements inside markedContent
By setting `display: contents` on `.markedContent` containers, they stop
affecting the layout of their children. This means that we can always
position text layer `<span>` elements using percentages relative to the
page dimensions, rather than having two separate code paths.

For some reason this breaks the workaround for text selection flickering
in Chrome/Safari, which can be fixed by setting `user-select: text` on
the `.endOfContent` div (only in Chrome/Safari, as it would break
selection in Firefox).
2025-12-12 11:37:45 +01:00
Tim van der Meij
4af193bbfc
Merge pull request #20491 from nicolo-ribaudo/move-text-scaling-logic-to-css
Move text layer scaling logic to CSS
2025-12-11 20:53:14 +01:00
Tim van der Meij
6075f6ee75
Merge pull request #20494 from calixteman/simplify_sidebar_resize
Use only one resize observer in the the sidebar
2025-12-09 20:39:09 +01:00
Nicolò Ribaudo
eb2b7c2c86
Move text layer scaling logic to CSS
This commit moves all the logic to scale up&down `<span>`s in the text
layer, introduced in #18283, to CSS.

The motivation for this change is that #18283 is still not enough for
all cases. That PR fixed the problem in Chrome&Firefox desktop, which
allow users to set an actual minimum font size in the browser settings.
However, other browsers (e.g. the Chrome-based WebView on Android) have
more complex logic and they scale up small text rather than simply
applying a minimum.

A workaround for that behavior is probably out of scope for PDF.js
itself as it only affects not officially supported platforms. However,
having access to the actual expected font height (through
`--font-height`) allows embedders of PDF.js to implement a workaround by
themselves.
2025-12-09 13:12:20 +01:00
Calixte Denizet
83fa8e9df1
Use only one resize observer in the the sidebar
If the max-width is 50vw, then resizing the viewport will change the sidebar width
and the callbacks need to be called in such a case.
2025-12-08 20:34:00 +01:00
Calixte Denizet
3e59e7535d
Move the css for tree object in its own file 2025-12-08 20:05:43 +01:00
Uzair-Ahmed-Shah
a25448502d Fix #20420: Prevent double decoding of file URL parameter 2025-12-08 22:37:52 +05:30
Calixte Denizet
4bf759404c
Add a new linting task in order to detect unused/unknown css variables in the Firefox build
The goal is to be able to catch the errors before making a release.
And fix some css issues (especially the missing css code for the newly added menu.css)
2025-12-08 09:44:33 +01:00
calixteman
36de2d976d
Merge pull request #20476 from calixteman/thumbnail_scroll
Use HTMLElement.scrollIntoView when showing a thumbnail
2025-12-05 09:59:11 +01:00
calixteman
8a42b82ecd
Merge pull request #20474 from calixteman/sidebar_resize_callbacks
Add some callbacks when resizing a sidebar
2025-12-05 08:54:24 +01:00
calixteman
30984435fe
Merge pull request #20483 from calixteman/menu
Add a menu class in order to be used in the new UI for the merge feature
2025-12-05 08:53:19 +01:00
calixteman
79c72f2c9a
Inject the text from the text layer in the MathML tags when they're in the struct tree (bug 1998046)
This way, the screen readers can read the math content properly.
The elements in the text layer will also have aria-hidden="true"
to avoid duplication.
2025-12-04 22:13:26 +01:00
Calixte Denizet
4c6cc0a042
Add a menu class in order to be used in the new UI for the merge feature 2025-12-04 22:12:10 +01:00
calixteman
8435e8f4bb
Merge pull request #20471 from calixteman/bug1998046_1
Aria-hide the text content part of a MathML formula (bug 1998046)
2025-12-04 22:09:34 +01:00
Calixte Denizet
c51ceb750b
Add some callbacks when resizing a sidebar
And use a ResizeObserver in order to avoid to have to compare the width with min/max which can be in
an other unit than px.
2025-12-04 21:40:46 +01:00
Calixte Denizet
f9b857463b
Use HTMLElement.scrollIntoView when showing a thumbnail 2025-12-03 15:51:34 +01:00
calixteman
8e2963ccad
Merge pull request #20226 from lab-core/pointer-type-initialization
[Editor] Pointer type initialization only when the user changes the mode
2025-12-02 20:55:39 +01:00
calixteman
87b3b5212e
Aria-hide the text content part of a MathML formula (bug 1998046)
It'll avoid to have the text content and the MathML content read by
screen readers.
2025-11-30 22:21:37 +01:00
Calixte Denizet
423379e42f
Slightly reduce the memory used by thumbnails
In using a blob instead of a base64 string it's possible to reduce the memory.
And simplify a bit the thumbnails themselves.
2025-11-28 21:52:40 +01:00
calixteman
ec5330f78c
Merge pull request #20465 from calixteman/update_char_to_nfkc
Fix the regex string used to find the chars to normalize with NFKC when searching
2025-11-28 16:59:23 +01:00
calixteman
925fc3d8f2
Merge pull request #20467 from calixteman/make_sidebar
Create a sidebar object
2025-11-28 16:27:44 +01:00
Calixte Denizet
45578aa8f5
Create a sidebar object
For now its use is limited to the comment sidebar but it'll be used for the new one
containing the thumbnails.
And make the sidebar more accessible with the keyboard or a screen reader.
2025-11-28 16:22:26 +01:00
Calixte Denizet
eee20cf138
Fix the regex string used to find the chars to normalize with NFKC when searching
ICU has been updated in Firefox (see https://bugzilla.mozilla.org/show_bug.cgi?id=2000225).
The char `0xA7F1` is now alphabetic and can be normalized as a "S".
2025-11-28 16:19:43 +01:00
Tim van der Meij
907cceb4ab
Merge pull request #20460 from calixteman/issue20452
[Editor] Allow to save an edited comment in using CTRL+Enter shortcut.
2025-11-27 21:37:07 +01:00
Tim van der Meij
40b52fa43a
Merge pull request #20458 from calixteman/fix_firstchild
Don't use firstChild/lastChild when getting elements (follow-up of #20447)
2025-11-27 21:34:56 +01:00
Calixte Denizet
b6fcb523c5
[Editor] Allow to save an edited comment in using CTRL+Enter shortcut. 2025-11-24 20:20:31 +01:00
calixteman
029cae2ad4 Don't use firstChild/lastChild when getting elements (follow-up of #20447) 2025-11-22 21:10:32 +01:00
Calixte Denizet
039b9e4df3 When searching for a group of punctuation signs, only add extraspaces around the group
It fixes #20225.

And only add the extra spaces where it's required depending on their position in the query string.
2025-11-21 18:59:37 +01:00
Calixte Denizet
b9368b576d Lint and format the HTML in using Prettier
The linter found some issues in viewer.html with </input> which isn't required
and a missing closing div in test/resources/reftest-analyzer.html.
The HTML can now be nicely formatted. In order to not break the build for
mozilla-central, the preprocessor has been fixed in order to take into account
the white spaces at the beginning of a comment line.
And finally, make .prettierrc (which is supposed to be either json or yaml)
itself lintable.
2025-11-18 17:22:50 +01:00
Calixte Denizet
50c48cf11b Add telemetry for tagged pdfs (bug 1997134) 2025-11-17 19:47:16 +01:00
legraina
396cff5652
Pointer type initialization only when the user changes the mode
Clear the pointer type of CurrentPointers outside of the DrawingEditor to always keep the same, until the user changes the mode.
One of the goal is to keep the same pointer type in case of a refresh of the page or if the user changes the pdf document.
2025-11-02 08:56:18 -05:00
Tim van der Meij
6e7a6eb52b
Merge pull request #20408 from calixteman/fix_mml_encoding
Don't set the MathML namespace for attributes in MathML tags (bug 1997343)
2025-11-01 14:58:15 +01:00
Tim van der Meij
c696648826
Merge pull request #20404 from mozilla/revert-20031-telemetry_signature_certificate
Revert "Add some telemetry in order to know what are the certificates used in pdfs (bug 1973573)"
2025-11-01 14:55:07 +01:00
Calixte Denizet
6db23139be Don't set the MathML namespace for attributes in MathML tags (bug 1997343)
And by default a XML file is UTF-8 encoded so correctly decode the embedded file.
2025-10-30 18:37:19 +01:00
calixteman
27bb5fb173
Merge pull request #20406 from gregtatum/text-extractor
Add text extractor as an external service
2025-10-30 17:23:18 +01:00
Greg Tatum
b7708da368 Address review feedback 2025-10-30 09:48:46 -05:00
Greg Tatum
26360c3e63 Add text extractor for an external service 2025-10-29 13:15:51 -05:00
calixteman
aeceee1df3
Revert "Add some telemetry in order to know what are the certificates used in pdfs (bug 1973573)" 2025-10-29 15:41:34 +01:00
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