Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,7 @@ rustdoc-toolbar {
flex-direction: row;
flex-wrap: nowrap;
min-height: 60px;
height: fit-content;
}

.docblock code, .item-table dd code,
Expand Down
28 changes: 28 additions & 0 deletions tests/rustdoc-gui/rustdoc-toolbar.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// This test ensures that even if the item name isn't on one line, the rustdoc toolbar buttons
// height won't change.
// Regression test for <https://github.com/rust-lang/rust/issues/160086>.

go-to: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"
set-window-size: (1000, 600)

store-value: (heading_selector, ".main-heading")
store-value: (heading_selector_title, |heading_selector| + " > h1")
store-value: (heading_selector_sub, |heading_selector| + " .sub-heading")

store-size: ("rustdoc-toolbar", {"height": toolbar_height})
store-position: ("rustdoc-toolbar", {"x": toolbar_x, "y": toolbar_y})
store-size: (|heading_selector_title|, {"height": heading_title_height})
store-size: (|heading_selector_sub|, {"height": heading_sub_height})

assert: |toolbar_height| == (|heading_title_height| + |heading_sub_height|)

// We now change the item name so it takes more than one line.
set-text: (|heading_selector| + " .struct", "Fosdkfjnsakjdnfkjsadnfkjadsnjfksandkjfndsakjfasndjfa")

store-size: (|heading_selector_title|, {"height": new_heading_title_height})

// The heading should now be taller.
assert: |new_heading_title_height| > |heading_title_height|
// However the toolbar size and position shouldn't have changed.
assert-size: ("rustdoc-toolbar", {"height": |toolbar_height|})
assert-position: ("rustdoc-toolbar", {"x": |toolbar_x|, "y": |toolbar_y|})
Loading