Skip to content

Loading web fonts is broken from local files #41713

@mrobinson

Description

@mrobinson

It seems that loading web fonts is broken from local files. When I run the following test case via ./mach run -r test.html I receive an assertion failure:

<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
assertion failed: request.origin == client.origin (thread tokio-runtime-5, at components/net/fetch/methods.rs:181)
   0: <servoshell::backtrace::Print as core::fmt::Debug>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: servoshell::backtrace::print
   4: servoshell::panic_hook::panic_hook
   5: std::panicking::panic_with_hook
   6: std::panicking::panic_handler::{{closure}}
   7: std::sys::backtrace::__rust_end_short_backtrace
   8: __rustc::rust_begin_unwind
   9: core::panicking::panic_fmt
  10: core::panicking::panic
  11: net::fetch::methods::fetch::{{closure}}
  12: <core::pin::Pin<P> as core::future::future::Future>::poll
  13: tokio::runtime::task::core::Core<T,S>::poll
  14: tokio::runtime::task::harness::Harness<T,S>::poll
  15: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
  16: tokio::runtime::scheduler::multi_thread::worker::Context::run
  17: tokio::runtime::context::scoped::Scoped<T>::set
  18: tokio::runtime::context::runtime::enter_runtime
  19: tokio::runtime::scheduler::multi_thread::worker::run
  20: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
  21: tokio::runtime::task::core::Core<T,S>::poll
  22: tokio::runtime::task::harness::Harness<T,S>::poll
  23: tokio::runtime::blocking::pool::Inner::run
  24: std::sys::backtrace::__rust_begin_short_backtrace
  25: core::ops::function::FnOnce::call_once{{vtable.shim}}
  26: std::sys::thread::unix::Thread::new::thread_start
  27: __pthread_cond_wait
[2026-01-06T15:47:42Z ERROR servoshell::panic_hook] assertion failed: request.origin == client.origin

Commenting out the assertion on line 181 of method.rs causes the font to load properly without issue. Is it possible that the assertion is wrong?

cc @TimvdLippe

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions