Uh oh!
There was an error while loading. Please reload this page.
rustdoc: Restore --default-theme, etc, by restoring varname escaping - #87288
Conversation
rust-highfive
commented
Jul 19, 2021
Some changes occurred in HTML/CSS/JS. |
rust-highfive
commented
Jul 19, 2021
r? @CraftSpider (rust-highfive has picked a reviewer for you, use r? to override) |
ijackson
commented
Jul 19, 2021
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
GuillaumeGomez
commented
Jul 19, 2021
Thanks for this fix! Could you add a test to prevent this regression to happen again please? If it cannot be checked in |
jyn514
commented
Jul 19, 2021
@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? |
GuillaumeGomez
commented
Jul 20, 2021
We already support to pass some arguments in |
ijackson
commented
Jul 20, 2021
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. |
GuillaumeGomez
commented
Jul 20, 2021
Like said previously, take a look at |
ijackson
commented
Jul 20, 2021
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? |
ijackson
commented
Jul 20, 2021
??? |
This comment has been minimized.
This comment has been minimized.
GuillaumeGomez
commented
Jul 20, 2021
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). |
ijackson
commented
Jul 20, 2021
:-(. 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. |
ijackson
commented
Jul 20, 2021
FTAOD I definitely see the value in the test. It's in my interests to do the test so no-one breaks this again! |
GuillaumeGomez
commented
Jul 20, 2021
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. |
jyn514
commented
Jul 20, 2021
@GuillaumeGomez I don't think it makes sense to block the fix on the test. It's enough to open an |
ijackson
commented
Jul 20, 2021
That would be awesome!
So I think the test would look something like this:
|
ijackson
commented
Jul 20, 2021
I have double checked my test cases and the way to run it has to be either Or using |
ijackson
commented
Jul 20, 2021
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.
GuillaumeGomez
commented
Jul 20, 2021
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). |
ijackson
commented
Jul 20, 2021
I could swear I had run rustfmt all this already. Apparently I botched that. Fixed now. |
GuillaumeGomez
commented
Jul 20, 2021
It happens to me all the time as well. Welcome to the club I guess? |
GuillaumeGomez
commented
Jul 20, 2021
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#86157cd0f931 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. Closesrust-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
b1839e4Compare…rgo config not being applied
b1839e4 to
f246faaCompare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
96471ee to
03b80a6Compare
This comment has been minimized.
This comment has been minimized.
03b80a6 to
7ea79e9Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
4e7b1c0 to
df6bdd7CompareGuillaumeGomez
commented
Jul 22, 2021
Ok, I found the issue: when I added the cargo config, it wasn't added because it's part of |
GuillaumeGomez
commented
Jul 22, 2021
Ah finally! @bors: r+ |
bors
commented
Jul 22, 2021
📌 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
ijackson
commented
Jul 22, 2021
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
Escapepart 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