-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optional too optional, apparently #72557
Conversation
FWIW |
It looks like it does work in Firefox as well, https://docs.rs/femme/2.1.0/femme/ at least loads 4 of the 7 fonts (presumably only the ones that are used) and they are used on the second viewing of the page (as long as devtools is closed, with devtools open it seems to timeout loading the fonts for some reason and uses the fallback). |
Oh hm. It feels really wonky while I browse https://doc.rust-lang.org/nightly/std/ but if devtools affects it somehow, then maybe my viewing information was "corrupted" in a way. That or my browser just decided I had a REALLY awful connection, and it worked As Intended. OK, formally noting I don't feel confident this entire patch is an essential change, I was just surprised by some of the initial results. |
Ok, interesting, clicking on the |
I just tested locally too, didn't expect much changes on externally hosted pages... So what do you want to do here @workingjubilee ? |
Hm. So, thank you Nemo. With that information, I now believe rustdoc can do better than this PR. However, having given it that bit of thought, I still (once more?) believe this PR is correct because |
☔ The latest upstream changes (presumably #72639) made this pull request unmergeable. Please resolve the merge conflicts. |
tl;dr: I made a few more changes that should correctly minimize any style impact while still collecting low-hanging performance gains. It can be driven much further, but not with just this change. Since this got blocked due to the merge conflict, and given that I mentioned "rustdoc can do better, probably", I did a bit more research and turned up more detail in conversations like these: It seems while the font WD has been around for Some Time Now and is mostly implemented, Reviewing the style cascade, however, testing with more configurations, and reading the finalized Font Level 3 specs, browsers implement a "fallback to nearest font, else synthesize style" behavior if a font is missing for a given weight. So, I think |
Local testing did not reveal that "optional" is incredibly eagerly skipped if it involves network transit, so successive page loads didn't actually load the fonts. "fallback" behaved as-predicted (success on next page load). Some styles set to "swap" to guarantee better readability. "Oops."
Font-display options allow a CSS author to opt in to faster loading, in exchange for less control over the display. Font-families will fall back to a "nearby" (in weight/style) font. It is important that some of the base fonts, like Source Serif Pro, load correctly. Swap should be preferred for them.
Ping from triage: |
@JohnCSimon Yes, sorry, did I miss something? |
@workingjubilee If something is taking a while, feel free to contact the triage WG in the future :) This happened to land on my day of triaging and I've changed the label accordingly. |
@GuillaumeGomez I think this is waiting on your review. |
I'm still not sure this is a good idea to do this actually... |
...Okay. |
Local testing did not reveal that "optional" is incredibly eagerly skipped
if it involves network transit, so successive page loads didn't actually
load the fonts. "fallback" behaved as-predicted (success on next page
load). Some styles set to "swap" to guarantee better readability.
In a word: "Oops."
Partially backs off the change in #72092