fonts: Fix loading local web font#41714
Merged
TimvdLippe merged 1 commit intoservo:mainfrom Jan 7, 2026
Merged
Conversation
|
🔨 Triggering try run (#20756079881) for Linux (WPT) |
|
Test results for linux-wpt from try job (#20756079881): Flaky unexpected result (34)
Stable unexpected results that are known to be intermittent (29)
|
|
✨ Try run (#20756079881) succeeded. |
mrobinson
reviewed
Jan 6, 2026
Member
mrobinson
left a comment
There was a problem hiding this comment.
Thank you for addressing this so quickly. I do have a question about this fix:
Comment on lines
+1
to
+14
| <!DOCTYPE html> | ||
| <link rel="help" href="https://github.com/servo/servo/issues/41713"> | ||
| <style> | ||
| @font-face { | ||
| font-family: "Amstelvar VF"; | ||
| src: url("https://mdn.github.io/shared-assets/fonts/variable-fonts/AmstelvarAlpha-VF.woff2") | ||
| } | ||
| html { | ||
| font-family: "Amstelvar VF"; | ||
| font-size: 4rem; | ||
| } | ||
| </style> | ||
|
|
||
| Hello |
Member
There was a problem hiding this comment.
I think you can just remove this test file completely:
- Tests should not rely on remote resources.
- I don't think it will trigger the bug as tests are run from a local web server and this issue is only about
file://URLs.
When you open a local file that attempts to load a web font, previously it would trigger an assertion on the origin of the request being unequal to the client. We would set both the origin of the request as well as the client explicitly for fonts. Instead, `request.populate_request_from_client` is supposed to initialize that. Therefore, remove the explicit origin and instead rely on the client origin. Fixes servo#41713 Signed-off-by: Tim van der Lippe <[email protected]>
1011ff7 to
7a8150f
Compare
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.
When you open a local file that attempts to load a web font, previously it would trigger an assertion on the origin of the request being unequal to the
client.
We would set both the origin of the request as well as the client explicitly for fonts. Instead,
request.populate_request_from_clientis supposed to initialize that.Therefore, remove the explicit origin and instead rely on the client origin.
Fixes #41713
Testing: This only affects file URLs which are not well covered by automated tests