summaryrefslogtreecommitdiff
path: root/tests/rustdoc-gui
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-03-08 21:24:50 +0100
committerGitHub <noreply@github.com>2023-03-08 21:24:50 +0100
commit6c91ce27c3639b3b4b4b4c038dc535c02dc9dfbd (patch)
treea445fbaac22905f22871fb97ce9cf01358f6e50d /tests/rustdoc-gui
parent7c306f6dcd600b1fcc74439c780e8ebef338d84c (diff)
parentaf664be4230d4052df32e7821a4a85ae9d13a474 (diff)
Rollup merge of #108686 - notriddle:notriddle/jank-all, r=jsha
rustdoc: include link on all.html location header This avoids a subtle layout shift when switching from the crate page to all items. ## Before | index.html | all.html | |------------|----------| | ![image](https://user-images.githubusercontent.com/1593513/222607866-4eac3f55-314c-4273-9664-503f2a79ad0a.png) | ![image](https://user-images.githubusercontent.com/1593513/222607895-2d6bac3b-f66a-47d4-b234-360f6f8e1ee3.png) | ## After | index.html | all.html | |------------|----------| | ![image](https://user-images.githubusercontent.com/1593513/222607866-4eac3f55-314c-4273-9664-503f2a79ad0a.png) | ![image](https://user-images.githubusercontent.com/1593513/222607997-e72c48a0-02c7-42a7-80c2-cd6bed48bd15.png) |
Diffstat (limited to 'tests/rustdoc-gui')
-rw-r--r--tests/rustdoc-gui/sidebar.goml14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/rustdoc-gui/sidebar.goml b/tests/rustdoc-gui/sidebar.goml
index a6d51709019..473ab8fc960 100644
--- a/tests/rustdoc-gui/sidebar.goml
+++ b/tests/rustdoc-gui/sidebar.goml
@@ -149,3 +149,17 @@ assert-property: (".sidebar", {"clientWidth": "200"})
click: "#toggle-all-docs"
assert-text: ("#toggle-all-docs", "[−]")
assert-property: (".sidebar", {"clientWidth": "200"})
+
+// Checks that all.html and index.html have their sidebar link in the same place.
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+store-property: (index_sidebar_width, ".sidebar .location a", "clientWidth")
+store-property: (index_sidebar_height, ".sidebar .location a", "clientHeight")
+store-property: (index_sidebar_x, ".sidebar .location a", "offsetTop")
+store-property: (index_sidebar_y, ".sidebar .location a", "offsetLeft")
+goto: "file://" + |DOC_PATH| + "/test_docs/all.html"
+assert-property: (".sidebar .location a", {
+ "clientWidth": |index_sidebar_width|,
+ "clientHeight": |index_sidebar_height|,
+ "offsetTop": |index_sidebar_x|,
+ "offsetLeft": |index_sidebar_y|,
+})