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 redundant CSS .out-of-band > span.since { position } #101769

Merged
merged 1 commit into from
Sep 14, 2022

Conversation

notriddle
Copy link
Contributor

At the time this CSS was added, it was just span.since, because the version info could be rendered in two different ways:

  1. <div class='since'> was used for associated items like methods. It was absolutely positioned, and the selector in rustdoc.css that targetted it was just .since.

    .since {
    font-weight: normal;
    font-size: initial;
    color: grey;
    position: absolute;
    right: 0;
    top: 0;
    }

  2. <span class='since'> was introduced in a5a2f2b for page-global version info, so that it could be laid out alongside the [-]/[+] button. This CSS rule was added to override the absolute position introduced in (1).

    span.since {
    position: initial;
    font-size: 20px;
    margin-right: 5px;
    }

The selector was changed in 8fc6e42 so that everything could use a <span> tag, but the dichotomy of the absolutely-positioned version info for associated items and the static positioned item version info remained.

The absolutely positioned .since was changed to one nested below a <div class="rightside"> container in 5de1391, so the version information is now always statically-positioned, and, as described in the commit message, "their DOM representation is consistent."

At the time this CSS was added, it was just `span.since`, because the
version info could be rendered in two different ways:

 1. `<div class='since'>` was used for associated items like methods. It
    was absolutely positioned, and the selector in rustdoc.css that
    targetted it was just `.since`.

    https://github.com/rust-lang/rust/blob/a5a2f2b951ea982a666eaf52b1874d8f1b17290b/src/librustdoc/html/static/rustdoc.css#L522-L529

 2. `<span class='since'>` was introduced in
    a5a2f2b for page-global version info,
    so that it could be laid out alongside the `[-]`/`[+]` button. This CSS
    rule was added to override the absolute position introduced in (1).

    https://github.com/rust-lang/rust/blob/a5a2f2b951ea982a666eaf52b1874d8f1b17290b/src/librustdoc/html/static/rustdoc.css#L637-L641

The selector was changed in 8fc6e42 so
that everything could use a `<span>` tag, but the dichotomy of the
absolutely-positioned version info for associated items and the static
positioned item version info remained.

The absolutely positioned `.since` was changed to one nested below a
`<div class="rightside">` container in
5de1391, so the version information is now
always statically-positioned, and, as described in the commit message,
"their DOM representation is consistent."
@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Sep 13, 2022
@rustbot
Copy link
Collaborator

rustbot commented Sep 13, 2022

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

@rust-highfive
Copy link
Collaborator

r? @GuillaumeGomez

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

Thanks! r=me once CI pass

@Dylan-DPC
Copy link
Member

@bors r=GuillaumeGomez rollup

@bors
Copy link
Contributor

bors commented Sep 14, 2022

📌 Commit e3debdf 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 14, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 14, 2022
Rollup of 6 pull requests

Successful merges:

 - rust-lang#101433 (Emit a note that static bounds from HRTBs are a bug)
 - rust-lang#101684 (smol grammar changes to README.md)
 - rust-lang#101769 (rustdoc: remove redundant CSS `.out-of-band > span.since { position }`)
 - rust-lang#101772 (Also replace the placeholder for the stable_features lint)
 - rust-lang#101773 (rustdoc: remove outdated CSS `.content table` etc)
 - rust-lang#101779 (Update test output for drop tracking)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit dce4715 into rust-lang:master Sep 14, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 14, 2022
@notriddle notriddle deleted the notriddle/out-of-band-span-since branch September 14, 2022 18:05
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