forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#120526 - GuillaumeGomez:mobile-long-crate-n…
…ame, r=notriddle rustdoc: Correctly handle long crate names on mobile Fixes rust-lang#120471. It now renders like this: ![image](https://github.com/rust-lang/rust/assets/3050060/065b4b8b-ba55-4163-a928-8d7bf735c111) r? ``@notriddle``
- Loading branch information
Showing
4 changed files
with
26 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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|}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters