-
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
rustdoc: do not preload fonts when browsing locally #122410
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @notriddle (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
No complaints, other than keeping the issue open because this is, unfortunately, an incomplete solution. It doesn't help unless the Develop menu is turned on. @bors r+ rollup |
Oh, I didn't even notice - I thought that referred to the developer console being open. Do you have a more general workaround in mind? I can figure it out otherwise |
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#121820 (pattern analysis: Store field indices in `DeconstructedPat` to avoid virtual wildcards) - rust-lang#121908 (match lowering: don't collect test alternatives ahead of time) - rust-lang#122203 (Add `intrinsic_name` to get plain intrinsic name) - rust-lang#122226 (coverage: Remove or migrate all unstable values of `-Cinstrument-coverage`) - rust-lang#122255 (Use `min_exhaustive_patterns` in core & std) - rust-lang#122360 ( Don't Create `ParamCandidate` When Obligation Contains Errors ) - rust-lang#122383 (Enable PR tracking review assignment for rust-lang/rust) - rust-lang#122386 (Move `Once` implementations to `sys`) - rust-lang#122400 (Fix ICE in diagnostics for parenthesized type arguments) - rust-lang#122410 (rustdoc: do not preload fonts when browsing locally) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#122410 - rjeli:rustdoc-no-local-font-preload, r=notriddle rustdoc: do not preload fonts when browsing locally First PR, please let me know if I'm doing anything wrong. As noted in rust-lang#98769, currently `cargo doc --open` on macOS/Safari (17.2.1) doesn't load fonts due to a CORS issue. (webkit issue [here](https://bugs.webkit.org/show_bug.cgi?id=249887)). This patch moves the font preloads inside a js if statement as suggested in the GitHub issue. I tried something more elegant with iterating over a tera array of fonts, but ran into issues, so here's the dumb fix. Only thing to note is that the font path is interpolated into a template string, so HTML escaping works fine, but it will break if there's a backtick or `${` in the font path. Not sure if this is a big deal.
I was thinking of integrating a small HTTP server into Rustdoc1. That would definitely solve this problem, along with a few other problems like localStorage partitioning. This solution is controversial, which is why I didn't block this PR it. Footnotes
|
First PR, please let me know if I'm doing anything wrong.
As noted in #98769, currently
cargo doc --open
on macOS/Safari (17.2.1) doesn't load fonts due to a CORS issue. (webkit issue here). This patch moves the font preloads inside a js if statement as suggested in the GitHub issue.I tried something more elegant with iterating over a tera array of fonts, but ran into issues, so here's the dumb fix. Only thing to note is that the font path is interpolated into a template string, so HTML escaping works fine, but it will break if there's a backtick or
${
in the font path. Not sure if this is a big deal.