This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +27
-9
lines changed Expand file tree Collapse file tree 5 files changed +27
-9
lines changed Original file line number Diff line number Diff line change @@ -1305,7 +1305,7 @@ fn render_impl(
1305
1305
if let Some ( use_absolute) = use_absolute {
1306
1306
write ! (
1307
1307
w,
1308
- "<details class=\" rustdoc-toggle implementors-toggle\" >\
1308
+ "<details class=\" rustdoc-toggle implementors-toggle\" open >\
1309
1309
<summary>\
1310
1310
<h3 id=\" {}\" class=\" impl\" {}>\
1311
1311
<code class=\" in-band\" >",
@@ -1334,7 +1334,7 @@ fn render_impl(
1334
1334
} else {
1335
1335
write ! (
1336
1336
w,
1337
- "<details class=\" rustdoc-toggle implementors-toggle\" >\
1337
+ "<details class=\" rustdoc-toggle implementors-toggle\" open >\
1338
1338
<summary>\
1339
1339
<h3 id=\" {}\" class=\" impl\" {}>\
1340
1340
<code class=\" in-band\" >{}</code>",
Original file line number Diff line number Diff line change @@ -480,6 +480,8 @@ function hideThemeButtonState() {
480
480
}
481
481
// Open all ancestor <details> to make this element visible.
482
482
openParentDetails ( h3 . parentNode ) ;
483
+ } else {
484
+ openParentDetails ( elem . parentNode ) ;
483
485
}
484
486
}
485
487
}
@@ -1412,9 +1414,9 @@ function hideThemeButtonState() {
1412
1414
// errors in mobile browsers).
1413
1415
if ( e . tagName === "H2" || e . tagName === "H3" ) {
1414
1416
var nextTagName = e . nextElementSibling . tagName ;
1415
- if ( nextTagName == "H2" || nextTagName == "H3" ) {
1417
+ if ( nextTagName === "H2" || nextTagName = == "H3" ) {
1416
1418
e . nextElementSibling . style . display = "flex" ;
1417
- } else {
1419
+ } else if ( nextTagName !== "DETAILS" ) {
1418
1420
e . nextElementSibling . style . display = "block" ;
1419
1421
}
1420
1422
}
Original file line number Diff line number Diff line change
1
+ // This test ensures that the element corresponding to the hash is displayed.
2
+ goto: file://|DOC_PATH|/struct.Foo.html#method.borrow
3
+ // In the blanket implementations list, "Borrow" is the second one, hence the ":nth(2)".
4
+ assert: ("#blanket-implementations-list > details:nth-child(2)", "open", "")
5
+ // Please note the "\" below is needed because otherwise ".borrow" would be interpreted as
6
+ // a class selector.
7
+ assert: ("#method\.borrow", {"display": "flex"})
8
+ // We first check that the impl block is open by default.
9
+ assert: ("#implementations + details", "open", "")
10
+ // We collapse it.
11
+ click: "#implementations + details > summary"
12
+ // We check that it was collapsed as expected.
13
+ assert-false: ("#implementations + details", "open", "")
14
+ // To ensure that we will click on the currently hidden method.
15
+ assert: (".sidebar-links > a", "must_use")
16
+ click: ".sidebar-links > a"
17
+ // We check that the impl block was opened as expected so that we can see the method.
18
+ assert: ("#implementations + details", "open", "")
Original file line number Diff line number Diff line change
1
+ // This test ensures that the impl blocks are open by default.
2
+ goto: file://|DOC_PATH|/struct.Foo.html
3
+ assert: ("#main > details.implementors-toggle", "open", "")
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments