@font-face does not try later src entries after fetch or decode failure
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start in packages/blitz-dom/src/net.rs by reading preferred_font_source and FontFaceHandler to trace how font sources are selected and how byte and error completions are handled. Reproduce with the recording NetProvider described in the issue, first completing first.otf with invalid bytes and then with a fetch error. Done means second.otf is requested after either failure, while a valid first font does not trigger that fallback request.
Written by the indexing model from the issue text.
Description
Reproduced on unpatched Blitz main 81b48968474614b28364a452af6d4d0ecedcf6a1 (2026-11-16), Windows x64, with the upstream Cargo.lock and nightly-2026-11-14. Our downstream integration is pinned to 0.3.0-beta.4, but the observations below are from a separate checkout of main.
An @font-face source whose format is supported is selected, but if fetching or parsing that source fails, the later sources are never requested.
Reproduction
<style>
@font-face {
font-family: Probe;
src: url("first.otf") format("opentype"),
url("second.otf") format("opentype");
}
body { font-family: Probe; }
</style>
Hello
Using a recording NetProvider that queues the actual NetHandler objects:
- Parse the document with a base URL and resolve it.
- Complete
first.otfeither withhandler.bytes(url, Bytes::from_static(b"invalid font bytes")), or withhandler.error(url, "deliberate test failure".into()). - Resolve again and inspect the recorded requests.
second.otfis listed as the fallback source, but it is never requested in either case.
Observed request list in both cases:
["https://example.invalid/first.otf"]
Expected: try second.otf after the first source fails. A valid OTF as the first response is a control case and should not require the second request. This follows the ordered source selection in CSS Fonts, src descriptor.
In current packages/blitz-dom/src/net.rs, preferred_font_source selects one URL, while FontFaceHandler has no remaining-source list. This differs from #1412 (skipping unsupported formats before fetching) and #1520 (finding nested font-face rules); I checked the current diff of #1520 and did not find failure-driven source retry there.
Local implementation sketch
I am not very familiar with Rust, so these snippets are provided only as reference sketches from our local integration, not as an upstream-ready fix.
Our beta.4 patch keeps the remaining eligible sources in order and carries the provider and abort signal with the handler. The relevant part of its bytes path is:
if self.data.abort_signal.as_ref().is_some_and(|signal| signal.aborted()) {
return;
}
let result = self.data.parse(bytes);
if !matches!(result, Ok(Resource::Font(..))) {
if let Some((url, format)) = self.data.remaining.pop_front() {
self.data.format = format;
let provider = self.data.network_provider.clone();
let request = font_request(url, self.data.abort_signal.as_ref());
provider.fetch(self.doc_id, request, self);
return;
}
}
self.respond(resolved_url, result)
Here remaining is a VecDeque<(Url, FontFaceSourceFormatKeyword)>; font_request is our local request helper. This is an excerpt, not a standalone patch. Our local parser also checks that font registration yields a usable face, rather than accepting a container signature alone.
The downstream provider funnels some failures through the byte-completion path. On current main, the explicit NetHandler::error path would also need to reach the same retry policy. The snippet alone does not implement that, and cancellation/source exhaustion need to preserve the upstream lifecycle. I am reporting the failed fallback rather than proposing the downstream provider contract for upstream.
- Dominant language
- Rust
- Stars
- 4.5k
- Forks
- 281
- Avg merge
- 6h 6m
- Merged PRs (30d)
- 184
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DioxusLabs/blitz
-
<input type="number"> misses text-entry leaf sizing in layoutPossibly taken @GoCoder7 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
DioxusLabs/blitz#1675 ·
Maintainers usually reply within 1 day
-
Copy, cut and paste shortcuts don't work with Caps Lock or ShiftPossibly taken @nicoburns claimed this 8 days ago. OpenA-Events C-Bug
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
DioxusLabs/blitz#1507 ·
Maintainers usually reply within 1 day
-
Copy and cut work in password inputsPossibly taken @nicoburns claimed this 8 days ago. OpenA-Events A-Forms C-Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DioxusLabs/blitz#1501 ·
Maintainers usually reply within 1 day
-
Panic on live viewport resize when unstyled elements exist in display: none subtreePossibly taken @GoCoder7 claimed this 9 days ago. OpenA-Layout A-Style C-Bug I-Crash
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DioxusLabs/blitz#1488 ·
Maintainers usually reply within 1 day
-
Right-button drag starts a text-selection drag and suppresses `contextmenu`Possibly taken @staging-devin-ai-integration claimed this 24 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
DioxusLabs/blitz#1184 ·
Maintainers usually reply within 1 day
All issues in DioxusLabs/blitz
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mongodb/kingfisher#588 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug rust
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
franciscoBSalgueiro/en-croissant#1111 ·
Maintainers usually reply within 2 days
-
[bug] Toolchain versions from `.prototools` are not inherited when moon runs from a subdirectoryOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day