File tree 2 files changed +15
-3
lines changed
src/librustdoc/html/render
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -600,9 +600,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
600
600
} ;
601
601
let all = shared. all . replace ( AllTypes :: new ( ) ) ;
602
602
let mut sidebar = Buffer :: html ( ) ;
603
- if shared. cache . crate_version . is_some ( ) {
604
- write ! ( sidebar, "<h2 class=\" location\" >Crate {}</h2>" , crate_name)
605
- } ;
603
+ write ! ( sidebar, "<h2 class=\" location\" ><a href=\" #\" >Crate {}</a></h2>" , crate_name) ;
606
604
607
605
let mut items = Buffer :: html ( ) ;
608
606
sidebar_module_like ( & mut items, all. item_sections ( ) ) ;
Original file line number Diff line number Diff line change @@ -149,3 +149,17 @@ assert-property: (".sidebar", {"clientWidth": "200"})
149
149
click: "#toggle-all-docs"
150
150
assert-text: ("#toggle-all-docs", "[−]")
151
151
assert-property: (".sidebar", {"clientWidth": "200"})
152
+
153
+ // Checks that all.html and index.html have their sidebar link in the same place.
154
+ goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
155
+ store-property: (index_sidebar_width, ".sidebar .location a", "clientWidth")
156
+ store-property: (index_sidebar_height, ".sidebar .location a", "clientHeight")
157
+ store-property: (index_sidebar_x, ".sidebar .location a", "offsetTop")
158
+ store-property: (index_sidebar_y, ".sidebar .location a", "offsetLeft")
159
+ goto: "file://" + |DOC_PATH| + "/test_docs/all.html"
160
+ assert-property: (".sidebar .location a", {
161
+ "clientWidth": |index_sidebar_width|,
162
+ "clientHeight": |index_sidebar_height|,
163
+ "offsetTop": |index_sidebar_x|,
164
+ "offsetLeft": |index_sidebar_y|,
165
+ })
You can’t perform that action at this time.
0 commit comments