Skip to content

Move renderer worker support out of api.js (PR 21860 follow-up) - #22105

Merged
calixteman merged 1 commit into
mozilla:masterfrom
calixteman:renderer-worker-api-cleanup
Oct 8, 2026
Merged

calixteman merged 1 commit into
mozilla:masterfrom
calixteman:renderer-worker-api-cleanup

Conversation

@calixteman

Copy link
Copy Markdown
Contributor

Extract RendererWorker and WorkerRenderTask into renderer_worker_proxy.js. Share worker URL wrapping and canvas tracker creation.

Forward only page objects stored on the main thread, removing the renderer's cleaned-page tracking and restorePage message.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Reference tests

Results for 5e7bdbf (run, references from mozilla/pdf.js.refs@cfb07bcc7a).

Platform Status Tests Total runtime Errors Different FBF No reference Report
Linux ✅ 1382 11m 15s 0 0 0 0
Windows ⚠️ 1382 13m 33s 0 14 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-0 | 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.

sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 7, 2026
@codecov-commenter

codecov-commenter commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.47826% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.22%. Comparing base (89b500f) to head (5e7bdbf).

Files with missing lines Patch % Lines
src/display/renderer_worker_proxy.js 81.81% 28 Missing ⚠️
src/display/api.js 91.37% 5 Missing ⚠️
src/display/api_utils.js 72.72% 3 Missing ⚠️
src/display/object_handler.js 50.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #22105   +/-   ##
=======================================
  Coverage   90.21%   90.22%           
=======================================
  Files         275      276    +1     
  Lines       67838    67811   -27     
=======================================
- Hits        61202    61181   -21     
+ Misses       6636     6630    -6     
Flag Coverage Δ
browsertest 66.17% <75.21%> (+0.02%) ⬆️
fonttest 8.98% <ø> (ø)
integrationtest 69.29% <80.43%> (-0.74%) ⬇️
unittest 59.99% <78.26%> (+0.07%) ⬆️
unittestcli 58.26% <19.21%> (-0.05%) ⬇️

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 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.

Given the size/scope of this patch I don't have time to properly review it today, but hopefully tomorrow.

Comment thread src/display/api_utils.js
@calixteman

Copy link
Copy Markdown
Contributor Author

FYI, the font issue on windows isn't related to this patch but it's more likely an issue when loading a same font in Firefox.

@calixteman
calixteman force-pushed the renderer-worker-api-cleanup branch from eda5820 to 9f7bcf3 Compare October 7, 2026 20:36
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 7, 2026

@Snuffleupagus Snuffleupagus 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.

This feels much better structured; thank you!

r=me, with a couple of small suggestions/questions.

Comment thread src/display/api.js Outdated
Comment thread src/display/api.js Outdated
Comment thread src/display/renderer_worker_proxy.js Outdated
Extract RendererWorker and WorkerRenderTask into renderer_worker_proxy.js.
Share worker URL wrapping and canvas tracker creation.

Forward only page objects stored on the main thread, removing the renderer's
cleaned-page tracking and restorePage message.

Create the annotation canvases with the canvas factory, as main-thread
rendering does, so they're no longer dropped when rendering into an
OffscreenCanvas.
@calixteman
calixteman force-pushed the renderer-worker-api-cleanup branch from 9f7bcf3 to 5e7bdbf Compare October 8, 2026 14:28
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 8, 2026
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 8, 2026
@calixteman
calixteman merged commit 5d923c9 into mozilla:master Oct 8, 2026
26 checks passed
@calixteman
calixteman deleted the renderer-worker-api-cleanup branch October 8, 2026 19:09
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 8, 2026

This branch was successfully deployed

1 active deployment
sync_pdfs — 5e7bdbf9 Deployed Oct 8, 2026 by calixteman via request #321
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.

3 participants