-
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: Restore --default-theme, etc, by restoring varname escaping #87288
Conversation
Some changes occurred in HTML/CSS/JS. |
r? @CraftSpider (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
Thanks for this fix! Could you add a test to prevent this regression to happen again please? If it cannot be checked in |
@GuillaumeGomez I think it would need to be in src/test/run-make because it needs a compiletime flag. But that seems painful since I don't know how you'd test the JavaScript from the command line. Do you think it makes sense to add support for cli args to rustdoc-gui? |
We already support to pass some arguments in |
I thought about adding a test for this. It seems quite difficult. In my game system Otter I need to do this kind of testing and I have an arrangement involving firefox, geckodriver, bubblewrap, webdriver/thirtyfour, etc. etc. etc. I have found this very complex (and it is also very slow, although this may matter less for This particular regression would only have been detected by a test which assembled an HTML DOM from the rustdoc-generated HTML, and then ran the Javascript, and then looked at the resulting effective CSS to see what the style was. I.e. it demands an HTML DOM implementation, which is basically a browser. I'm not aware of anything significantly short of a browser for this, but perhaps someone can suggest something. |
Like said previously, take a look at |
I went and looked. Good lord! You've already got a thing. Wow. OK, I will see what I can do. It might not happen right away. Would it be OK with you to land the fix without the test? |
??? |
This comment has been minimized.
This comment has been minimized.
We had a lot of regressions because we didn't add tests, so I'd really prefer to have the test included with the fix (makes it easier when going through PRs as well). |
:-(. I think this test is rather more work than the fix. I would also like to point out that I am fixing a thing that someone else broke (doing a thing I approve of, but, still...) and now a thing I actually use day to day is broken. |
FTAOD I definitely see the value in the test. It's in my interests to do the test so no-one breaks this again! |
I can write it for you if you prefer? But I'll need a "scenario" and what to check to ensure everything is working as expected. |
@GuillaumeGomez I don't think it makes sense to block the fix on the test. It's enough to open an |
That would be awesome!
So I think the test would look something like this:
|
I have double checked my test cases and the way to run it has to be either Or using |
Squashed and force pushed in the hope that the retry won't hit that submodule problem. |
This comment has been minimized.
This comment has been minimized.
Generally I agree but such issues tend to take very long to get tests, which is why I'm not super eager to merge without tests. The beta is "far away" so I prefer to write the test directly in the PR (even if I'm the one writing the test, doesn't matter). |
I could swear I had run rustfmt all this already. Apparently I botched that. Fixed now. |
It happens to me all the time as well. Welcome to the club I guess? |
Ok, seems like the CI is happy now. I'll add the CI test tomorrow. |
This comment has been minimized.
This comment has been minimized.
In rust-lang#86157 cd0f931 Use Tera templates for rustdoc. dropped the following transformation from the keys of the default settings element's `data-` attribute names: .map(|(k, v)| format!(r#" data-{}="{}""#, k.replace('-', "_"), Escape(v))) The `Escape` part is indeed no longer needed, because Tera does that for us. But the massaging of `-` to `_` is needed, for the (bizarre) reasons explained in the new comments. I have tested that the default theme function works again for me. I have also verified that passing --default-theme="zork&" escapes the value in the HTML. Closes rust-lang#87263. CC: Jacob Hoffman-Andrews <github@hoffman-andrews.com> Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
fafe5c7
to
b1839e4
Compare
…rgo config not being applied
b1839e4
to
f246faa
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
96471ee
to
03b80a6
Compare
This comment has been minimized.
This comment has been minimized.
03b80a6
to
7ea79e9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
4e7b1c0
to
df6bdd7
Compare
Ok, I found the issue: when I added the cargo config, it wasn't added because it's part of |
Ah finally! @bors: r+ |
📌 Commit df6bdd7 has been approved by |
…laumeGomez Rollup of 6 pull requests Successful merges: - rust-lang#87270 (Don't display <table> in item summary) - rust-lang#87281 (Normalize generic_ty before checking if bound is met) - rust-lang#87288 (rustdoc: Restore --default-theme, etc, by restoring varname escaping) - rust-lang#87307 (Allow combining -Cprofile-generate and -Cpanic=unwind when targeting MSVC.) - rust-lang#87343 (Regression fix to avoid further beta backports: Remove unsound TrustedRandomAccess implementations) - rust-lang#87357 (Update my name/email in .mailmap) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Thanks, especially for writing the test! |
In #86157
dropped the following transformation from the keys of the default settings element's
data-
attribute names:The
Escape
part is indeed no longer needed, because Tera does that for us. But the massaging of-
to_
is needed, for the (bizarre) reasons explained in the new comments.I have tested that the default theme function works again for me. I have also verified that passing (in shell syntax)
escapes the value in the HTML.
Closes #87263