refactor: delegate font source resolution to the parser - #1653
Open
ICOM725 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 andlocal()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
Checklist
pnpm lintpasses)pnpm testpasses)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 buildandgit diff --checkpass.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.