Skip to content

Fix the measurement of b and i elements in XFA rich text - #22485

Merged
calixteman merged 1 commit into
mozilla:masterfrom
calixteman:xfa_b_i_measure
Nov 9, 2026
Merged

calixteman merged 1 commit into
mozilla:masterfrom
calixteman:xfa_b_i_measure

Conversation

@calixteman

Copy link
Copy Markdown
Contributor

TextMeasure has no pushFont method, so laying out any rich text containing a or an threw and no page was rendered.

It fixes #22023.

`TextMeasure` has no `pushFont` method, so laying out any rich text
containing a <b> or an <i> threw and no page was rendered.

It fixes mozilla#22023.
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Viewer preview

🗑️ Viewer previews removed.

@codecov-commenter

codecov-commenter commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.57%. Comparing base (6619bf0) to head (5a7a44d).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #22485      +/-   ##
==========================================
- Coverage   90.57%   90.57%   -0.01%     
==========================================
  Files         276      276              
  Lines       68666    68661       -5     
==========================================
- Hits        62195    62189       -6     
- Misses       6471     6472       +1     
Flag Coverage Δ
fonttest 9.09% <ø> (ø)
integrationtest 69.68% <0.00%> (-0.02%) ⬇️
unittest 63.08% <100.00%> (+0.20%) ⬆️
unittestcli 60.68% <100.00%> (+0.21%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@codspeed

codspeed Bot commented Nov 9, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 1.55%

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 86 untouched benchmarks
⏩ 174 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ OperatorList.addOp: paths and clips (bug1703683_page2_reduced.pdf) 6 ms 6.9 ms -13.69%
⚡ PDFPageProxy.render: luminosity soft mask (issue18956.pdf) 22.7 ms 20.2 ms +12.29%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing calixteman:xfa_b_i_measure (5a7a44d) with master (6619bf0)

Open in CodSpeed

Footnotes

  1. 174 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Reference tests

Results for 5a7a44d (run, references from mozilla/pdf.js.refs@039b06e737).

Platform Status Tests Total runtime Errors Different FBF No reference Report
Linux ⚠️ 1418 12m 12s 0 0 0 1
Windows ⚠️ 1418 17m 34s 0 1 0 1 view differences

The report is kept for 30 days and replaced by the next run.

@timvandermeij timvandermeij left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

r=me, with passing browser tests. Thank you for fixing this!

sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Nov 9, 2026
@calixteman
calixteman merged commit b600aec into mozilla:master Nov 9, 2026
30 of 32 checks passed
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Nov 9, 2026
@calixteman
calixteman deleted the xfa_b_i_measure branch November 9, 2026 21:02

This branch was previously deployed

1 inactive deployment
sync_pdfs — 5a7a44db Deployed Nov 9, 2026 by timvandermeij via request #781
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.

XFA: measure.pushFont is not a function — rich text containing <b> or <i> breaks layout

3 participants