Skip to content

Stop exporting the Font mimetype property - #22038

Merged
timvandermeij merged 1 commit into
mozilla:masterfrom
Snuffleupagus:rm-mimetype-export
Oct 2, 2026
Merged

timvandermeij merged 1 commit into
mozilla:masterfrom
Snuffleupagus:rm-mimetype-export

Conversation

@Snuffleupagus

@Snuffleupagus Snuffleupagus commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator
  • All embedded font data, regardless of how it's specified in the PDF, is always converted into OpenType in the worker-thread. This has been the case since "forever" in the PDF.js project, hence the value of Font.prototype.mimetype never varies (when actually set).

  • With the introduction of the CSS Font Loading API, in the font-loading code, the mimetype property is no longer used by default in the main-thread.

  • Given that Font.prototype.mimetype is either a string or null, the way that PR Serialize font data into an ArrayBuffer #20197 implemented the serialization/deserialization isn't actually correct since an explicit null value is being converted into a "null" string.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Reference tests

Results for 05566bd (run, references from mozilla/pdf.js.refs@fd080e6597).

Platform Status Tests Total runtime Errors Different FBF No reference Report
Linux ✅ 1380 10m 29s 0 0 0 0
Windows ✅ 1380 14m 6s 0 0 0 0

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

@codecov-commenter

codecov-commenter commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.36%. Comparing base (62de7c5) to head (05566bd).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #22038      +/-   ##
==========================================
+ Coverage   90.35%   90.36%   +0.01%     
==========================================
  Files         269      269              
  Lines       67208    67204       -4     
==========================================
+ Hits        60723    60732       +9     
+ Misses       6485     6472      -13     
Flag Coverage Δ
browsertest 66.16% <66.66%> (-0.04%) ⬇️
fonttest 8.96% <100.00%> (-0.01%) ⬇️
integrationtest 69.40% <33.33%> (+0.01%) ⬆️
unittest 59.51% <100.00%> (+0.01%) ⬆️
unittestcli 58.02% <100.00%> (+0.01%) ⬆️

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.

sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Sep 30, 2026
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Sep 30, 2026
 - All embedded font data, regardless of how it's specified in the PDF, is always converted into OpenType in the worker-thread. This has been the case since "forever" in the PDF.js project, hence the value of `Font.prototype.mimetype` never varies (when actually set).

 - With the introduction of the CSS Font Loading API, in the font-loading code, the `mimetype` property is no longer used *by default* in the main-thread.

 - Given that `Font.prototype.mimetype` is either a string or `null`, the way that PR 20197 implemented the serialization/deserialization isn't actually correct since an explicit `null` value is being converted into a `"null"` string.
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 1, 2026
@timvandermeij
timvandermeij merged commit 20b2e11 into mozilla:master Oct 2, 2026
22 checks passed
@timvandermeij

Copy link
Copy Markdown
Collaborator

Thank you for cleaning this up!

@timvandermeij
timvandermeij removed the request for review from calixteman October 2, 2026 13:13
@Snuffleupagus
Snuffleupagus deleted the rm-mimetype-export branch October 2, 2026 14:08

This branch was successfully deployed

1 active deployment
sync_pdfs — 05566bd1 Deployed Oct 1, 2026 by Snuffleupagus via request #204
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

font-conversion release-blocker Blocker for the upcoming release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants