-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Simplify foreign type rendering. #56874
Conversation
Some changes occurred in HTML/CSS. |
(rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Reducing DOM size seems like a good idea. Please fix the tests too before we start the review. :) |
fd377b4
to
0384f58
Compare
Other than UC Android testing (I'm still working on getting a working emulator), I'm now happy with this. Tests pass, there's a bit more vertical whitespace, and I caught a bug with the z index of tooltips. |
The big test is wether it works on iOS considering it's the worst supported browser. |
Yup, works as well on iOS as the old. I'm giving up on UC Browser unless someone can toss me a guide on how to get it going in an emulator. I've tried loading it in many flavors of Andriod with no luck. The closest I got was Kit Kat, where it was able to install, but crash on launch. |
Argh, I'm sorry, I just saw "[src]" is wrapping incorrectly on the std/iter/struct.Chain.html page. Let me track that down... |
Those glitches are now fixed. |
Ok, code seems good. Just one thing though: do you mind waiting for #55798 to be merged first please? It's been around a long time and it'll affect the same code. Very sorry about that... :-/ |
No problem! |
Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for this! I've got just one comment of my own, and like @GuillaumeGomez, we should wait for #55798 to merge (it's currently being tested in the build queue, shouldn't take long now) to land first. Thanks for being so thorough with testing, too!
By chance, do you have access to a copy of Internet Explorer? I know we don't officially support it, but i'd like to see whether this breaks that too much.
src/librustdoc/html/render.rs
Outdated
} | ||
clean::AssociatedTypeItem(ref bounds, ref default) => { | ||
let id = cx.derive_id(format!("{}.{}", item_type, name)); | ||
let ns_id = cx.derive_id(format!("{}.{}", name, item_type.name_space())); | ||
write!(w, "<h4 id='{}' class=\"{}{}\">", id, item_type, extra_class)?; | ||
write!(w, "<span id='{}' class='invisible'><code>", ns_id)?; | ||
write!(w, "<code> id='{}'", ns_id)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to have the >
for the <code>
tag in the wrong spot?
@QuietMisdreavus Once my PR is merged, I'll check how this one goes on iOS too (I think safari might allow that...). |
☔ The latest upstream changes (presumably #55798) made this pull request unmergeable. Please resolve the merge conflicts. |
Update: finished the main part of the merge plus some follow-up bug hunting. The biggest change is that I found js was changing some display to block that should have been flex. Switching the js to change all display to flex had two minor knock-on effects: 1) Flex doesn't collapse margins, so I had to ease in a margin or two. 2) Added flex-basis: 100% in a few spots to get full-width drawing back. I made enough changes that I want to re-test on various browsers again. I'll have that done in ~24 hours. |
☔ The latest upstream changes (presumably #57079) made this pull request unmergeable. Please resolve the merge conflicts. |
Quick update: iOS-- and perhaps mobile Chrome-- are having troubles with my latest changes after the merge. I'm working through those issues. |
0bc7f10
to
f292e0d
Compare
Merged associated const changes, fixed some quirks, and cleaned up the commits (next time I'll keep my powder dry longer). Aside from the associated const merge, the other change here is the main.js update to change some display to "block" and some to "flex" once loading is complete. The better way to do this in general would be to remove a css class, but my first naive pass at that broke in noscript. I'll try to clean that up in a follow-up. I didn't want to drag this out longer. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Simplified foreign type rendering by switching from tables to flexbox. Also, removed some seemingly extraneous elements like “ghost” spans. Reduces element count on std::iter::Iterator by 30%.
f292e0d
to
34bd2b8
Compare
Seems really cool! I'll give it a try locally in the next day before r+ing it. Thanks a lot! |
Damn, didn't take a look at it yet. >< I'll try to do it tomorrow. |
Ok checked. The output is good, therefore we can move forward. Thanks! @bors: r+ |
📌 Commit 34bd2b8 has been approved by |
⌛ Testing commit 34bd2b8 with merge b1e6fa6bb8a48d6e41b463d7819da8848b7a1593... |
💔 Test failed - checks-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors retry |
…umeGomez Simplify foreign type rendering. Simplified foreign type rendering by switching from tables to flexbox. Also, removed some seemingly extraneous elements like “ghost” spans. Reduces element count on the `std::iter::Iterator` page by 30%. On my laptop it drops Iterator page load time from ~15s to ~10s. Frame times during scrolling are a hair lower too. Known visual changes (happy to tweak based on feedback): * The main `impl ...` headers are now getting the default, larger, h3 font size. This was an accident, but I liked how it turned out so I didn't fix it. * There's a hair less vertical spacing between the end of a where block and the start of the next fn. Now, all spacing is consistent. I think this looks a bit worse. I may tweak vertical spacing more here or in a follow-up that cleans up vertical spacing more broadly. * "[src]" links are all sized at 17px. A few were 19px in the original. I haven't yet done heavy cross-browser or cross-crate testing. I was hoping to get a quick thumbs up or thumbs down here at this first draft, then if this is on the right track I'll spend some time on that testing. TODO: - [x] Test on Chrome - [x] Test on Firefox - [ ] ~~Test on UC Android~~ - [x] Test on Edge - [x] Test on iOS safari - [x] Test on desktop safari - [x] Update automated tests - [x] Increase vertical margin - [x] Fix "Important traits for" hover overlap - [x] Wait for rust-lang#55798 to land & merge it
Rollup of 4 pull requests Successful merges: - #56874 (Simplify foreign type rendering.) - #57113 (Move diagnostics out from QueryJob and optimize for the case with no diagnostics) - #57366 (Point at match discriminant on type error in match arm pattern) - #57538 (librustc_mir: Fix ICE with slice patterns) Failed merges: - #57381 (Tweak output of type mismatch between "then" and `else` `if` arms) r? @ghost
Simplified foreign type rendering by switching from tables to flexbox. Also, removed some seemingly extraneous elements like “ghost” spans.
Reduces element count on the
std::iter::Iterator
page by 30%. On my laptop it drops Iterator page load time from ~15s to ~10s. Frame times during scrolling are a hair lower too.Known visual changes (happy to tweak based on feedback):
impl ...
headers are now getting the default, larger, h3 font size. This was an accident, but I liked how it turned out so I didn't fix it.I haven't yet done heavy cross-browser or cross-crate testing. I was hoping to get a quick thumbs up or thumbs down here at this first draft, then if this is on the right track I'll spend some time on that testing.
TODO:
Test on UC Android