Skip to content

Move the renderRichText function into a new utility file (PR 21860 follow-up) - #22100

Closed
Snuffleupagus wants to merge 1 commit into
mozilla:masterfrom
Snuffleupagus:renderRichText-move
Closed

Snuffleupagus wants to merge 1 commit into
mozilla:masterfrom
Snuffleupagus:renderRichText-move

Conversation

@Snuffleupagus

Copy link
Copy Markdown
Collaborator

The renderRichText function depends on the XfaLayer class, and given where that function currently lives it causes all of the XfaLayer code to be bundled into the built pdf.renderer.mjs file.
That's unfortunate since all of it is dead code in the renderer-worker, however we can avoid it by simply moving renderRichText into its own file.

Note: This reduces the size of the gulp mozcentral bundle by 10088 bytes, i.e. almost 10 kilo-bytes, which is way too much to ignore.

…follow-up)

The `renderRichText` function depends on the `XfaLayer` class, and given where that function currently lives it causes all of the `XfaLayer` code to be bundled into the *built* `pdf.renderer.mjs` file.
That's unfortunate since all of it is dead code in the renderer-worker, however we can avoid it by simply moving `renderRichText` into its own file.

*Note:* This reduces the size of the `gulp mozcentral` bundle by `10088` bytes, i.e. almost 10 kilo-bytes, which is way too much to ignore.
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Reference tests

Results for 6d0b230 (run, references from mozilla/pdf.js.refs@026380f231).

Platform Status Tests Total runtime Errors Different FBF No reference Report
Linux ✅ 1382 11m 33s 0 0 0 0
Windows ⚠️ 1382 14m 54s 0 1 0 0 view differences

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

Problems on Linux
TEST-UNEXPECTED-FAIL | test failed issue16114-partial | in firefox-1 | page1 round 1 | Optimized rendering differs from full rendering.
Problems on Windows
TEST-UNEXPECTED-FAIL | test failed issue16114-partial | in firefox-1 | page1 round 1 | Optimized rendering differs from full rendering.

@codecov-commenter

codecov-commenter commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.22%. Comparing base (d0295c9) to head (6d0b230).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #22100   +/-   ##
=======================================
  Coverage   90.22%   90.22%           
=======================================
  Files         275      276    +1     
  Lines       67837    67837           
=======================================
  Hits        61203    61203           
  Misses       6634     6634           
Flag Coverage Δ
browsertest 66.19% <100.00%> (+0.01%) ⬆️
fonttest 8.98% <ø> (ø)
integrationtest 70.02% <92.85%> (+0.01%) ⬆️
unittest 59.91% <100.00%> (-0.02%) ⬇️
unittestcli 58.30% <0.00%> (ø)

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.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Viewer preview

🗑️ Viewer previews removed.

sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 7, 2026
@Snuffleupagus
Snuffleupagus removed the request for review from calixteman October 7, 2026 10:34
@Snuffleupagus
Snuffleupagus marked this pull request as draft October 7, 2026 10:34
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 7, 2026
@Snuffleupagus Snuffleupagus removed the release-blocker Blocker for the upcoming release label Oct 7, 2026
@Snuffleupagus

Copy link
Copy Markdown
Collaborator Author

Closing this once, since there's more code that we could skip.

@Snuffleupagus
Snuffleupagus deleted the renderRichText-move branch October 7, 2026 10:43
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 7, 2026

This branch was successfully deployed

1 active deployment
sync_pdfs — 6d0b230e Deployed Oct 7, 2026 by Snuffleupagus via request #307
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.

2 participants