Skip to content

Don't throw when printing with pdfBug enabled#20898

Merged
calixteman merged 1 commit intomozilla:masterfrom
calixteman:issue20847
Mar 17, 2026
Merged

Don't throw when printing with pdfBug enabled#20898
calixteman merged 1 commit intomozilla:masterfrom
calixteman:issue20847

Conversation

@calixteman
Copy link
Copy Markdown
Contributor

It fixes #20847.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.56%. Comparing base (394727a) to head (b7d71eb).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #20898   +/-   ##
=======================================
  Coverage   62.56%   62.56%           
=======================================
  Files         173      173           
  Lines      121255   121258    +3     
=======================================
+ Hits        75869    75871    +2     
- Misses      45386    45387    +1     
Flag Coverage Δ
fonttest 7.66% <ø> (?)
unittestcli 62.54% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Snuffleupagus
Copy link
Copy Markdown
Collaborator

Would it work to just add !!canvas && checks when setting both of the following variables, to avoid having to check for it in lots of places (since that seems less maintainable)?

pdf.js/src/display/api.js

Lines 1542 to 1544 in 394727a

const shouldRecordOperations =
!this.recordedBBoxes && (recordOperations || recordForDebugger);
const shouldRecordImages = !this.imageCoordinates && recordImages;

Copy link
Copy Markdown
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me, thanks.

@calixteman calixteman merged commit 1f94023 into mozilla:master Mar 17, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Regression]: Printing broken in the Firefox PDF Viewer with debugging enabled

4 participants