Skip to content

Commit

Permalink
Rollup merge of #87251 - GuillaumeGomez:item-info-width, r=notriddle
Browse files Browse the repository at this point in the history
Fix "item info" width

Fixes #87202.

It now looks again like this:

![Screenshot from 2021-07-18 12-33-27](https://user-images.githubusercontent.com/3050060/126064005-013acabc-7f17-4436-8dfc-cb6b9bc24413.png)

cc `@jyn514`

r? `@notriddle`
  • Loading branch information
GuillaumeGomez authored Jul 19, 2021
2 parents 6df9df7 + 57f7501 commit 8cf995f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,9 @@ body.blur > :not(#help) {
padding: 0 20px 20px 17px;;
}

.item-info .stab {
display: table;
}
.stab {
border-width: 1px;
border-style: solid;
Expand Down
7 changes: 7 additions & 0 deletions src/test/rustdoc-gui/item-info-width.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This test ensures that the item information don't take 100% of the width if unnecessary.
goto: file://|DOC_PATH|/lib2/struct.Foo.html
// We set a fixed size so there is no chance of "random" resize.
size: (1100, 800)
// We check that ".item-info" is bigger than its content.
assert-css: (".item-info", {"width": "807px"})
assert-css: (".item-info .stab", {"width": "343px"})
3 changes: 3 additions & 0 deletions src/test/rustdoc-gui/src/lib2/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// ignore-tidy-linelength

#![feature(doc_cfg)]

pub mod module {
pub mod sub_module {
pub mod sub_sub_module {
Expand All @@ -14,6 +16,7 @@ pub fn foobar() {}

pub type Alias = u32;

#[doc(cfg(feature = "foo-method"))]
pub struct Foo {
pub x: Alias,
}
Expand Down

0 comments on commit 8cf995f

Please sign in to comment.