Skip to content

Start loading the viewer icons earlier in Firefox - #22457

Merged
timvandermeij merged 1 commit into
mozilla:masterfrom
calixteman:preload-viewer-icons
Nov 9, 2026
Merged

timvandermeij merged 1 commit into
mozilla:masterfrom
calixteman:preload-viewer-icons

Conversation

@calixteman

Copy link
Copy Markdown
Contributor

The CSS only fetches an icon once its element is rendered, so the toolbar is first painted without icons and the menus load theirs when first opened.

Preload the toolbar icons from viewer.html (without crossorigin, since CSS images from resource:// are fetched without CORS), and warm the image cache up with the icons of the hidden UI once the first page is rendered.

@github-actions

github-actions Bot commented Nov 5, 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 Nov 5, 2026
@codecov-commenter

codecov-commenter commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.61%. Comparing base (bb386fc) to head (ce31961).
⚠️ Report is 51 commits behind head on master.

Files with missing lines Patch % Lines
web/app.js 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #22457      +/-   ##
==========================================
- Coverage   90.54%   88.61%   -1.94%     
==========================================
  Files         276      276              
  Lines       68557    73573    +5016     
==========================================
+ Hits        62077    65198    +3121     
- Misses       6480     8375    +1895     
Flag Coverage Δ
integrationtest 69.67% <0.00%> (+0.05%) ⬆️
unittest 62.87% <ø> (+0.03%) ⬆️
unittestcli 60.45% <ø> (+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.

@codspeed

codspeed Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 8.13%

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

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ Lexer.getObj: paths (bug1743245.pdf) 26.5 ms 32.1 ms -17.37%
❌ OperatorList.addOp: paths and clips (bug1703683_page2_reduced.pdf) 6 ms 6.7 ms -11.18%
❌ EvaluatorPreprocessor.read: paths (bug1743245.pdf) 59.1 ms 65.8 ms -10.22%
❌ Lexer.getObj: text (issue12963.pdf) 18.4 ms 20.5 ms -10.2%
⚡ getUnicodeRangeFor (bug1473809.pdf) 25.2 ms 22.8 ms +10.6%

Tip

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


Comparing calixteman:preload-viewer-icons (ce31961) 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. ↩

Comment thread web/app.js Resolved
Comment thread web/app.js Resolved
The CSS only fetches an icon once its element is rendered, so the toolbar is
first painted without icons and the menus load theirs when first opened.

Preload the toolbar icons from viewer.html (without crossorigin, since CSS
images from resource:// are fetched without CORS), and warm the image cache
up with the icons of the hidden UI once the first page is rendered.
@calixteman
calixteman force-pushed the preload-viewer-icons branch from a8307da to ce31961 Compare November 8, 2026 21:25
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Nov 8, 2026
@timvandermeij
timvandermeij merged commit 50e7be9 into mozilla:master Nov 9, 2026
18 of 20 checks passed
@timvandermeij

Copy link
Copy Markdown
Collaborator

Looks good like this; thank you!

sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants