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 .impl-items { flex-basis } CSS, not in flex container #101349

Merged
merged 1 commit into from
Sep 4, 2022

Conversation

notriddle
Copy link
Contributor

Added in 34bd2b8

For this to actually do anything, according to MDN (and Firefox Dev Tools), it must be a "flex item", which only happens if its a direct child of a node with display: flex on it. It seems like it could not have worked at the time when this rule was added, because the only items in rustdoc.css with display: flex active were:

  • #help

    This should not contain anything like this.

  • .impl-items h4, h4.impl, h3.impl

    These are all headers, so they shouldn't contain .impl-items either.

  • .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant

    Associated constants and methods definitely shouldn't contain a list of impl items, and the .type class seems to refer to type aliases, which, when shown inside of an impl, only show a link to the aliased type.

Nowadays, display: flex is a lot more prolific, but .impl-items still seems to only be used in plain block parents:

  • If it's not a trait impl, then it's nested below a <div> with an id but no class, added in a5216cf. This will be display: block, probably. For example, vec deref
  • Inherent impls also get a <div> tag, for example vec impl, and they are also wrapped by their own non-flexbox <details> tag.
  • If it's a tait implementation, then it's also nested below a <details> container, like deref cstring.

Also, this would imply that trait items ought to take up as much space as possible, pushing everything else to the edge of the screen. If this is nested directly below the .rustdoc container, which has a row basis, that would be bad.

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Sep 2, 2022
@rustbot
Copy link
Collaborator

rustbot commented Sep 2, 2022

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

@rust-highfive
Copy link
Collaborator

r? @jsha

(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 2, 2022
@GuillaumeGomez
Copy link
Member

I confirmed there were no changes. Good catch!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 3, 2022

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

Rollup of 4 pull requests

Successful merges:

 - rust-lang#101335 (rustdoc: remove old CSS selector that causes weird spacing)
 - rust-lang#101347 (ffx component run should provide a collection)
 - rust-lang#101364 (Shrink suggestion span of argument mismatch error)
 - rust-lang#101365 (remove redundant clones)

Failed merges:

 - rust-lang#101349 (rustdoc: remove `.impl-items { flex-basis }` CSS, not in flex container)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Sep 3, 2022

☔ The latest upstream changes (presumably #101378) made this pull request unmergeable. Please resolve the merge conflicts.

@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 Sep 3, 2022
Added in 34bd2b8

For this to actually do anything, [according to MDN] (and Firefox Dev Tools),
it must be a "flex item", which only happens if its a direct child of a node
with `display: flex` on it. It seems like it could not have worked at the time
when this rule was added, because the only items in `rustdoc.css` with
`display: flex` active were:

* `#help`

  This should not contain anything like this.

* `.impl-items h4, h4.impl, h3.impl`

  These are all headers, so they shouldn't contain `.impl-items` either.

* `.content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant`

  Associated constants and methods definitely shouldn't contain a list of impl
  items, and the `.type` class seems to refer to type aliases, which, when
  shown inside of an impl, only show a link to the aliased type.

[according to MDN]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis

Nowadays, `display: flex` is a lot more prolific, but `.impl-items` still
seems to only be used in plain block parents:

* If it's not a trait impl, then it's nested below a `<div>` with an id but no
  class, added in a5216cf. This will be
  `display: block`, probably. For example, [vec deref]
* Inherent impls also get a `<div>` tag, for example [vec impl], and they are
  also wrapped by their own non-flexbox `<details>` tag.
* If it's a tait implementation, then it's also nested below a `<details>`
  container, like [deref cstring].

[vec impl]: https://doc.rust-lang.org/1.63.0/std/vec/struct.Vec.html#impl
[vec deref]: https://doc.rust-lang.org/1.63.0/std/vec/struct.Vec.html#deref-methods-%5BT%5D
[deref cstring]: https://doc.rust-lang.org/1.63.0/std/ops/trait.Deref.html#impl-Deref

Also, this would imply that trait items ought to take up as much space as
possible, pushing everything else to the edge of the screen. If this is nested
directly below the `.rustdoc` container, which has a row basis, that would
be bad.
@notriddle notriddle force-pushed the notriddle/flex-basis branch from 7ba5f43 to cee90dd Compare September 3, 2022 21:33
@notriddle
Copy link
Contributor Author

@bors r=GuillaumeGomez rollup

@bors
Copy link
Contributor

bors commented Sep 3, 2022

📌 Commit cee90dd 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 3, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 4, 2022
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#100302 (Suggest associated method on deref types when path syntax method fails)
 - rust-lang#100647 ( Make trait bound not satisfied specify kind)
 - rust-lang#101349 (rustdoc: remove `.impl-items { flex-basis }` CSS, not in flex container)
 - rust-lang#101369 (Fix `global_asm` macro pretty printing)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 037c979 into rust-lang:master Sep 4, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 4, 2022
@notriddle notriddle deleted the notriddle/flex-basis branch September 4, 2022 05:19
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