Skip to content
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: fix spacing of non-toggled impl blocks #93763

Merged
merged 1 commit into from
Feb 13, 2022

Conversation

jsha
Copy link
Contributor

@jsha jsha commented Feb 8, 2022

We recently removed the "up here" arrows on item-infos, and adjusted
vertical spacing so that even without the arrow, it would be visually
clear which item the item-info belonged to. The new CSS styles for
vertical spacing only applied to toggles, though. This missed
non-toggled impl blocks - for instance, those without any methods, like
https://doc.rust-lang.org/nightly/std/marker/trait.Send.html#implementors.
The result was lists of implementors that were spaced too closely. This
PR fixes the spacing by making it apply to non-toggled impl blocks as
well.

This also fixes an issue where item-infos were displayed too far below
their items. That was a result of display: table on .item-info .stab.
Changed that to display: inline-block.

Demo: https://rustdoc.crud.net/jsha/re-space-empty-impls/std/marker/trait.Send.html

Before:

After:

r? @GuillaumeGomez

@rust-highfive
Copy link
Collaborator

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez,@Folyd

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 8, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 8, 2022
@jsha jsha added the A-rustdoc-ui Area: Rustdoc UI (generated HTML) label Feb 8, 2022
@GuillaumeGomez
Copy link
Member

Please add a GUI test. :)

@rust-log-analyzer

This comment has been minimized.

@jsha jsha force-pushed the re-space-empty-impls branch 2 times, most recently from aa13ee3 to 7806454 Compare February 8, 2022 21:03
@GuillaumeGomez
Copy link
Member

Thanks!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Feb 9, 2022

📌 Commit 7806454 has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 9, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 9, 2022
…umeGomez

rustdoc: fix spacing of non-toggled impl blocks

We [recently removed the "up here" arrows on item-infos](rust-lang#92651), and adjusted
vertical spacing so that even without the arrow, it would be visually
clear which item the item-info belonged to. The new CSS styles for
vertical spacing only applied to toggles, though. This missed
non-toggled impl blocks - for instance, those without any methods, like
https://doc.rust-lang.org/nightly/std/marker/trait.Send.html#implementors.
The result was lists of implementors that were spaced too closely. This
PR fixes the spacing by making it apply to non-toggled impl blocks as
well.

This also fixes an issue where item-infos were displayed too far below
their items. That was a result of display: table on .item-info .stab.
Changed that to display: inline-block.

Demo: https://rustdoc.crud.net/jsha/re-space-empty-impls/std/marker/trait.Send.html

Before:

<img width=300 src="https://user-images.githubusercontent.com/220205/152954394-ec0b80e7-2573-4f06-9d7a-7b10b8ceac60.png">

After:

<img width=300 src="https://user-images.githubusercontent.com/220205/152954228-abac1d30-a76d-4ab1-89ec-ef7549fe8c9c.png">

r? `@GuillaumeGomez`
@matthiaskrgr
Copy link
Member

Looks like this failed in a rollup #93834 (comment)
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 9, 2022
We recently removed the "up here" arrows on item-infos, and adjusted
vertical spacing so that even without the arrow, it would be visually
clear which item the item-info belonged to. The new CSS styles for
vertical spacing only applied to toggles, though. This missed
non-toggled impl blocks - for instance, those without any methods, like
https://doc.rust-lang.org/nightly/std/marker/trait.Send.html#implementors.
The result was lists of implementors that were spaced too closely. This
PR fixes the spacing by making it apply to non-toggled impl blocks as
well.

This also fixes an issue where item-infos were displayed too far below
their items. That was a result of display: table on .item-info .stab.
Changed that to display: inline-block.
@jsha jsha force-pushed the re-space-empty-impls branch from 7806454 to 0b22d41 Compare February 10, 2022 07:34
@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Feb 10, 2022

That seems to be a bug in browser-ui-test. The rounding should be 340, not 339. Weird. I'll send a fix as soon as possible.

@jsha
Copy link
Contributor Author

jsha commented Feb 10, 2022

I updated the test for the fractional number. Should be good for now. But to be safe...

@bors r=GuillaumeGomez rollup=never

@bors
Copy link
Contributor

bors commented Feb 10, 2022

📌 Commit 0b22d41 has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 10, 2022
@bors
Copy link
Contributor

bors commented Feb 13, 2022

⌛ Testing commit 0b22d41 with merge c26fbf8...

@bors
Copy link
Contributor

bors commented Feb 13, 2022

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing c26fbf8 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 13, 2022
@bors bors merged commit c26fbf8 into rust-lang:master Feb 13, 2022
@rustbot rustbot added this to the 1.60.0 milestone Feb 13, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c26fbf8): comparison url.

Summary: This benchmark run did not return any relevant results.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants