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 docblock class from item-decl #102027

Merged
merged 2 commits into from
Sep 20, 2022

Conversation

notriddle
Copy link
Contributor

This class was originally added in 73b97c7 to support hiding and showing the item, because main.js went through all docblock elements in the DOM and added toggles to them.

onEach(document.getElementById('main').getElementsByClassName('docblock'), function(e) {
if (e.parentNode.id === "main") {
var otherMessage;
if (hasClass(e, "type-decl")) {
otherMessage = ' Show type declaration';
}
e.parentNode.insertBefore(createToggle(otherMessage), e);
if (otherMessage) {
collapseDocs(e.previousSibling.childNodes[0], "toggle");
}
}
});

The item-decl is no longer auto-hidden since c96f86d removed it.

item-decl used to be called type-decl: that name was changed in 8b7a2dd.

The docblock class is no longer used for implementing toggles, since rustdoc switched to using <details> elements.

Preview: https://notriddle.com/notriddle-rustdoc-test/docblock-item-decl/rustdoc/clean/types/enum.Type.html

This class was originally added in 73b97c7
to support hiding and showing the item, because `main.js` went through all
`docblock` elements in the DOM and added toggles to them.

https://github.com/rust-lang/rust/blob/73b97c7e7c9cfac4dfa4804654b1db6ab687b589/src/librustdoc/html/static/main.js#L1856-L1867

The `item-decl` is no longer auto-hidden since
c96f86d removed it.

`item-decl` used to be called `type-decl`: that name was changed in
8b7a2dd.

The `docblock` class is no longer used for implementing toggles, since
rustdoc switched to using `<details>` elements.
@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Sep 19, 2022
@rustbot
Copy link
Collaborator

rustbot commented Sep 19, 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 19, 2022
@rust-log-analyzer

This comment has been minimized.

@notriddle
Copy link
Contributor Author

r? @GuillaumeGomez

@@ -1,4 +1,4 @@
<div class="docblock item-decl"><pre class="rust struct"><code>pub struct Struct&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt;,&#160;</span>{
<div class="item-decl"><pre class="rust struct"><code>pub struct Struct&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt;<span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt;,</span>{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seem to have more than a simple class removal in all these files. Any idea why? I can't figure it out simply from the code changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect that the whitespace changes happened in #99904, but these tests didn't start failing because

not compare_tree(make_xml(actual_str), make_xml(expected_str), stderr)) \
normalizes the snapshot and result into a DOM tree before comparing them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. Then all good!

@GuillaumeGomez
Copy link
Member

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 20, 2022

📌 Commit 8e6cf7d 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 20, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Sep 20, 2022
…decl, r=GuillaumeGomez

rustdoc: remove `docblock` class from `item-decl`

This class was originally added in 73b97c7 to support hiding and showing the item, because `main.js` went through all `docblock` elements in the DOM and added toggles to them.

https://github.com/rust-lang/rust/blob/73b97c7e7c9cfac4dfa4804654b1db6ab687b589/src/librustdoc/html/static/main.js#L1856-L1867

The `item-decl` is no longer auto-hidden since c96f86d removed it.

`item-decl` used to be called `type-decl`: that name was changed in 8b7a2dd.

The `docblock` class is no longer used for implementing toggles, since rustdoc switched to using `<details>` elements.

Preview: https://notriddle.com/notriddle-rustdoc-test/docblock-item-decl/rustdoc/clean/types/enum.Type.html
spastorino added a commit to spastorino/rust that referenced this pull request Sep 20, 2022
…decl, r=GuillaumeGomez

rustdoc: remove `docblock` class from `item-decl`

This class was originally added in 73b97c7 to support hiding and showing the item, because `main.js` went through all `docblock` elements in the DOM and added toggles to them.

https://github.com/rust-lang/rust/blob/73b97c7e7c9cfac4dfa4804654b1db6ab687b589/src/librustdoc/html/static/main.js#L1856-L1867

The `item-decl` is no longer auto-hidden since c96f86d removed it.

`item-decl` used to be called `type-decl`: that name was changed in 8b7a2dd.

The `docblock` class is no longer used for implementing toggles, since rustdoc switched to using `<details>` elements.

Preview: https://notriddle.com/notriddle-rustdoc-test/docblock-item-decl/rustdoc/clean/types/enum.Type.html
notriddle added a commit to notriddle/rust that referenced this pull request Sep 20, 2022
…decl, r=GuillaumeGomez

rustdoc: remove `docblock` class from `item-decl`

This class was originally added in 73b97c7 to support hiding and showing the item, because `main.js` went through all `docblock` elements in the DOM and added toggles to them.

https://github.com/rust-lang/rust/blob/73b97c7e7c9cfac4dfa4804654b1db6ab687b589/src/librustdoc/html/static/main.js#L1856-L1867

The `item-decl` is no longer auto-hidden since c96f86d removed it.

`item-decl` used to be called `type-decl`: that name was changed in 8b7a2dd.

The `docblock` class is no longer used for implementing toggles, since rustdoc switched to using `<details>` elements.

Preview: https://notriddle.com/notriddle-rustdoc-test/docblock-item-decl/rustdoc/clean/types/enum.Type.html
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 20, 2022
Rollup of 12 pull requests

Successful merges:

 - rust-lang#100250 (Manually cleanup token stream when macro expansion aborts.)
 - rust-lang#101014 (Fix -Zmeta-stats ICE by giving `FileEncoder` file read permissions)
 - rust-lang#101958 (Improve error for when query is unsupported by crate)
 - rust-lang#101976 (MirPhase: clarify that linting is not a semantic change)
 - rust-lang#102001 (Use LLVM C-API to build atomic cmpxchg and fence)
 - rust-lang#102008 (Add GUI test for notable traits element position)
 - rust-lang#102013 (Simplify rpitit handling on lower_fn_decl)
 - rust-lang#102021 (some post-valtree cleanup)
 - rust-lang#102027 (rustdoc: remove `docblock` class from `item-decl`)
 - rust-lang#102034 (rustdoc: remove no-op CSS `h1-6 { border-bottom-color }`)
 - rust-lang#102038 (Make the `normalize-overflow` rustdoc test actually do something)
 - rust-lang#102053 (:arrow_up: rust-analyzer)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1b54ee3 into rust-lang:master Sep 20, 2022
@rustbot rustbot added this to the 1.66.0 milestone Sep 20, 2022
@notriddle notriddle deleted the notriddle/docblock-item-decl branch September 20, 2022 22:02
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.

7 participants