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: remove unused CSS .content .methods > div #101538

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

notriddle
Copy link
Contributor

This selector has its roots in these commits:

  • current version:

    .content .methods > div:not(.notable-traits):not(.method) from 9077d54

  • intermediate version:

    .content .methods > div:not(.important-traits) from d86621f

  • original version:

    .content .methods > div { margin-left: 40px; } from 0a46933

Based on the call stack, where class='methods' calls trait_item and trait_item calls document, this div selector was probably intended to target docblock and stability tags.

In the current version of the code, neither of these can possibly be nested directly below the class='methods' wrapper, because the current version of the trait_item function always wraps them in a <details> tag if they exist. The only div tag that can possibly be nested directly below it now is the one with class method, which is explicitly excluded.

This selector has its roots in these commits:

  * current version:

    `.content .methods > div:not(.notable-traits):not(.method)` from
    9077d54

  * intermediate version:

    `.content .methods > div:not(.important-traits)` from
    d86621f

  * original version:

    `.content .methods > div { margin-left: 40px; }` from
    0a46933

Based on the call stack, where [`class='methods'`] calls `trait_item` and
[`trait_item`] calls [`document`], this div selector was probably intended to
target docblock and stability tags.

In the current version of the code, neither of these can possibly be nested
directly below the `class='methods'` wrapper, because the [current version of
the `trait_item` function] always wraps them in a `<details>` tag if they
exist. The only div tag that can possibly be nested directly below it now is
the one with class `method`, which is explicitly excluded.

[`class='methods'`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1811-L1842

[`trait_item`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1807

[`document`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1515-L1523

[current version of the `trait_item` function]: https://github.com/rust-lang/rust/blob/e7c7aa7288559f8e5ea7ce3543ff946b09783628/src/librustdoc/html/render/print_item.rs#L710
@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Sep 7, 2022
@rustbot
Copy link
Collaborator

rustbot commented Sep 7, 2022

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

@rust-highfive
Copy link
Collaborator

r? @CraftSpider

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 7, 2022
@GuillaumeGomez
Copy link
Member

Nice catch! r=me once CI pass

@notriddle
Copy link
Contributor Author

@bors r=GuillaumeGomez rollup

@bors
Copy link
Contributor

bors commented Sep 7, 2022

📌 Commit 10fc2ff has been approved by GuillaumeGomez

It is now in the queue for this repository.

@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 Sep 7, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 7, 2022
…iaskrgr

Rollup of 14 pull requests

Successful merges:

 - rust-lang#101343 (Add -api-level to pm command)
 - rust-lang#101416 (stdio: Document no support for writing to non-blocking stdio/stderr)
 - rust-lang#101435 (Remove unnecessary `EMIT_MIR_FOR_EACH_BITWIDTH`)
 - rust-lang#101493 (Pass ImplTraitContext as &mut to avoid the need of ImplTraitContext::reborrow)
 - rust-lang#101502 (Do not suggest a semicolon for a macro without `!`)
 - rust-lang#101503 (Add debug calls)
 - rust-lang#101506 (rustdoc: remove unused CSS `#main-content > .since`)
 - rust-lang#101507 (rustdoc: remove unused CSS `#main-content > table td`)
 - rust-lang#101521 (Rustdoc-Json: More accurate struct type.)
 - rust-lang#101525 (Fix typo in pass_manager.rs)
 - rust-lang#101534 (rustdoc: remove unused mobile CSS `.rustdoc { flex-direction }`)
 - rust-lang#101535 (Fix error printing mistake in tidy)
 - rust-lang#101536 (Add documentation for Attr::is_doc_comment)
 - rust-lang#101538 (rustdoc: remove unused CSS `.content .methods > div`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit eae48c3 into rust-lang:master Sep 7, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 7, 2022
@notriddle notriddle deleted the notriddle/content-methods-div branch September 8, 2022 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants