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

Rollup of 6 pull requests #121254

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d907a6b
rustdoc: Correctly handle long crate names on mobile
GuillaumeGomez Jan 31, 2024
5d29f5a
Add regression test for #120471 to ensure that long crate name are ha…
GuillaumeGomez Jan 31, 2024
d51e703
As Windows 10 requires certain features like CMPXCHG16B and a few oth…
CKingX Feb 9, 2024
d6766e2
Update x86_64_pc_windows_msvc.rs
CKingX Feb 9, 2024
fcb06f7
Update x86_64_pc_windows_msvc.rs
CKingX Feb 9, 2024
abeac8f
Update x86_64_uwp_windows_gnu.rs
CKingX Feb 9, 2024
1c6dda7
Possibly removed merge policy
CKingX Feb 9, 2024
376c7b9
Added sahf feature to windows targets
CKingX Feb 13, 2024
131cc37
Initiate the inner usage of cfg_match (Library)
c410-f3r Feb 16, 2024
9b3fcf9
Detect when method call on argument could be removed to fulfill faile…
estebank Feb 14, 2024
3a917cd
make "invalid fragment specifier" translatable
tshepang Feb 14, 2024
e3859d2
add test to guard against inaccurate diagnostic
tshepang Feb 17, 2024
408eeae
Improve wording of static_mut_ref
obeis Feb 17, 2024
2a438a6
Rollup merge of #116342 - c410-f3r:t3st3ss, r=Mark-Simulacrum
CKingX Feb 18, 2024
12af8a9
Rollup merge of #120526 - GuillaumeGomez:mobile-long-crate-name, r=no…
CKingX Feb 18, 2024
8aea4c3
Rollup merge of #120820 - CKingX:cpu-base-minimum, r=petrochenkov
CKingX Feb 18, 2024
c465cfa
Rollup merge of #121034 - obeis:improve-static-mut-ref, r=RalfJung
CKingX Feb 18, 2024
3aff0b0
Rollup merge of #121067 - tshepang:make-expand-translatable, r=fmease
CKingX Feb 18, 2024
72997ad
Rollup merge of #121100 - estebank:issue-71252, r=compiler-errors
CKingX Feb 18, 2024
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
7 changes: 1 addition & 6 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1941,13 +1941,8 @@ in src-script.js and main.js
pixels to avoid overflowing the topbar when the user sets a bigger
font size. */
font-size: 24px;
}

.mobile-topbar h2 a {
display: block;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.mobile-topbar .logo-container > img {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function setMobileTopbar() {
const mobileTitle = document.createElement("h2");
mobileTitle.className = "location";
if (hasClass(document.querySelector(".rustdoc"), "crate")) {
mobileTitle.innerText = `Crate ${window.currentCrate}`;
mobileTitle.innerHTML = `Crate <a href="#">${window.currentCrate}</a>`;
} else if (locationTitle) {
mobileTitle.innerHTML = locationTitle.innerHTML;
}
Expand Down
22 changes: 22 additions & 0 deletions tests/rustdoc-gui/mobile-crate-name.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Checks that if the crate name is too long on mobile, it will not grow and overflow its parent
// (thanks to text overflow ellipsis).

go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// First we change the title to make it big.
set-window-size: (350, 800)
// We ensure that the "format" of the title is the same as the one we'll use.
assert-text: (".mobile-topbar .location a", "test_docs")
// We store the height we know is correct.
store-property: (".mobile-topbar .location", {"offsetHeight": height})
// We change the crate name to something longer.
set-text: (".mobile-topbar .location a", "cargo_packager_resource_resolver")
// And we check that the size remained the same.
assert-property: (".mobile-topbar .location", {"offsetHeight": |height|})

// Now we check if it works for the non-crate pages as well.
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
// We store the height we know is correct.
store-property: (".mobile-topbar .location", {"offsetHeight": height})
set-text: (".mobile-topbar .location a", "Something_incredibly_long_because")
// And we check that the size remained the same.
assert-property: (".mobile-topbar .location", {"offsetHeight": |height|})
4 changes: 2 additions & 2 deletions tests/rustdoc-gui/type-declation-overflow.goml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ assert-property: ("pre.item-decl", {"scrollWidth": "950"})
set-window-size: (600, 600)
go-to: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"
// It shouldn't have an overflow in the topbar either.
store-property: (".mobile-topbar h2", {"scrollWidth": scrollWidth})
assert-property: (".mobile-topbar h2", {"clientWidth": |scrollWidth|})
store-property: (".mobile-topbar", {"scrollWidth": scrollWidth})
assert-property: (".mobile-topbar", {"clientWidth": |scrollWidth|})
assert-css: (".mobile-topbar h2", {"overflow-x": "hidden"})

// Check wrapping for top main-heading h1 and out-of-band.
Expand Down