Skip to content

refactor: delegate font source resolution to the parser - #1653

Open
ICOM725 wants to merge 1 commit into
melonjs:masterfrom
ICOM725:refactor/fontface-src-resolution
Open

refactor: delegate font source resolution to the parser#1653
ICOM725 wants to merge 1 commit into
melonjs:masterfrom
ICOM725:refactor/fontface-src-resolution

Conversation

@ICOM725

@ICOM725 ICOM725 commented Sep 7, 2026

Copy link
Copy Markdown

Description

Move CSS font source handling out of the generic loader and into the fontface parser. The loader delegates source normalization and base-URL exclusion to optional parser hooks; the fontface parser owns url() unwrapping and local() handling.

Keep the existing matching rules and immutable asset descriptors. Tests register the font rules under a different parser name and cover bare paths, quoted/unquoted URLs, local fonts, data URIs and retries of the same frozen manifest entry.

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Refactoring (no functional changes)

Checklist

  • I have read the Contributing Guide
  • My code follows the existing code style (pnpm lint passes)
  • I have tested my changes locally (pnpm test passes)
  • I have added tests that cover my changes (if applicable)
  • The build succeeds (pnpm build)

Targeted verification: six loader/font spec files pass (98 tests), with Playwright using installed Chrome instead of Chromium Headless Shell through an external config override. Four of the seven new parser-alias cases failed before the change. pnpm lint, pnpm build and git diff --check pass.

The full suite was not run for this worktree. Full runs on the same upstream baseline with the independent Trigger change encountered browser-import/iframe failures and a stalled WebGPU spec; those runs are not reported as passing here.

Related issues

Fixes #1648.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loader: fontface url() handling lives in the generic src-resolution path

1 participant