Skip to content

Combine the getPathJs and hasBuiltPath methods in the CompiledFont class#21599

Merged
timvandermeij merged 1 commit into
mozilla:masterfrom
Snuffleupagus:CompiledFont-rm-hasBuiltPath
Jul 19, 2026
Merged

Combine the getPathJs and hasBuiltPath methods in the CompiledFont class#21599
timvandermeij merged 1 commit into
mozilla:masterfrom
Snuffleupagus:CompiledFont-rm-hasBuiltPath

Conversation

@Snuffleupagus

Copy link
Copy Markdown
Collaborator

This avoids duplicating the charCode/glyphId lookup, and (slightly) shortens the code. In particular:

  • Given that the path-data is returned as a TypedArray, it's easy enough to instead return null to indicate that the glyph was previously compiled.

  • The charCode-cache can be changed into a Set, since we only need to track the "seen" charCodes and not their relation to the glyphIds.

  • The compileFontPathInfo call is moved into CompiledFont class, since that simplifies the src/core/evaluator.js code a tiny bit.

…nt` class

This avoids duplicating the charCode/glyphId lookup, and (slightly) shortens the code. In particular:
 - Given that the path-data is returned as a TypedArray, it's easy enough to instead return `null` to indicate that the glyph was previously compiled.

 - The charCode-cache can be changed into a Set, since we only need to track the "seen" charCodes and not their relation to the glyphIds.

 - The `compileFontPathInfo` call is moved into `CompiledFont` class, since that simplifies the `src/core/evaluator.js` code a tiny bit.
@codecov-commenter

codecov-commenter commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.78%. Comparing base (eddd70a) to head (02027ba).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21599      +/-   ##
==========================================
- Coverage   89.85%   89.78%   -0.08%     
==========================================
  Files         263      263              
  Lines       66757    66757              
==========================================
- Hits        59983    59935      -48     
- Misses       6774     6822      +48     
Flag Coverage Δ
browsertest 66.55% <100.00%> (+0.01%) ⬆️
fonttest 9.05% <0.00%> (ø)
integrationtest 69.17% <0.00%> (-0.10%) ⬇️
unittest 57.47% <77.77%> (-0.03%) ⬇️
unittestcli 56.45% <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.

@Snuffleupagus

Copy link
Copy Markdown
Collaborator Author

/botio browsertest

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/158be0e6cf202df/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/19b32afc06f1c35/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/19b32afc06f1c35/output.txt

Total script time: 19.17 mins

  • Regression tests: FAILED
  errors: 6

Image differences available at: http://54.241.84.105:8877/19b32afc06f1c35/reftest-analyzer.html#web=eq.log

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/158be0e6cf202df/output.txt

Total script time: 25.54 mins

  • Regression tests: Passed

@timvandermeij
timvandermeij merged commit 5266f13 into mozilla:master Jul 19, 2026
20 of 21 checks passed
@timvandermeij

Copy link
Copy Markdown
Collaborator

Looks simpler indeed; thanks!

@Snuffleupagus
Snuffleupagus deleted the CompiledFont-rm-hasBuiltPath branch July 19, 2026 16:45
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.

4 participants