File tree Expand file tree Collapse file tree 11 files changed +33
-3
lines changed
librustdoc/html/static/js Expand file tree Collapse file tree 11 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -563,7 +563,7 @@ function loadCss(cssUrl) {
563563 onEachLazy ( code . getElementsByTagName ( "a" ) , elem => {
564564 const href = elem . getAttribute ( "href" ) ;
565565
566- if ( href && href . indexOf ( "http" ) !== 0 ) {
566+ if ( href && ! / ^ (?: [ a - z + ] + : ) ? \/ \/ / . test ( href ) ) {
567567 elem . setAttribute ( "href" , window . rootPath + href ) ;
568568 }
569569 } ) ;
Original file line number Diff line number Diff line change @@ -33,3 +33,9 @@ goto: "file://" + |DOC_PATH| + "/lib2/trait.TraitToReexport.html"
3333assert-count: ("#implementors-list .impl", 1)
3434goto: "file://" + |DOC_PATH| + "/implementors/trait.TraitToReexport.html"
3535assert-count: ("#implementors-list .impl", 1)
36+
37+ // Now check that the link is properly rewritten for a crate called `http`.
38+ // An older version of rustdoc had a buggy check for absolute links.
39+ goto: "file://" + |DOC_PATH| + "/http/trait.HttpTrait.html"
40+ assert-count: ("#implementors-list .impl", 1)
41+ assert-attribute: ("#implementors-list .impl a.trait", {"href": "../http/trait.HttpTrait.html"})
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ click: "#crate-search"
1515press-key: "ArrowDown"
1616press-key: "ArrowDown"
1717press-key: "ArrowDown"
18+ press-key: "ArrowDown"
1819press-key: "Enter"
1920// Waiting for the search results to appear...
2021wait-for: "#search-tabs"
@@ -39,6 +40,7 @@ click: "#crate-search"
3940press-key: "ArrowUp"
4041press-key: "ArrowUp"
4142press-key: "ArrowUp"
43+ press-key: "ArrowUp"
4244press-key: "Enter"
4345// Waiting for the search results to appear...
4446wait-for: "#search-tabs"
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ assert: "//*[@class='dir-entry' and @open]/*[text()='sub_mod']"
7373// Only "another_folder" should be "open" in "lib2".
7474assert: "//*[@class='dir-entry' and not(@open)]/*[text()='another_mod']"
7575// All other trees should be collapsed.
76- assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@open)]", 7 )
76+ assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@open)]", 8 )
7777
7878// We now switch to mobile mode.
7979size: (600, 600)
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ assert: ".source-sidebar-expanded"
102102
103103// We check that the first entry of the sidebar is collapsed
104104assert-property: ("#source-sidebar details:first-of-type", {"open": "false"})
105- assert-text: ("#source-sidebar details:first-of-type > summary", "huge_logo ")
105+ assert-text: ("#source-sidebar details:first-of-type > summary", "http ")
106106// We now click on it.
107107click: "#source-sidebar details:first-of-type > summary"
108108assert-property: ("#source-sidebar details:first-of-type", {"open": "true"})
Original file line number Diff line number Diff line change 22# It is not intended for manual editing.
33version = 3
44
5+ [[package ]]
6+ name = " http"
7+ version = " 0.1.0"
8+
59[[package ]]
610name = " implementors"
711version = " 0.1.0"
12+ dependencies = [
13+ " http" ,
14+ ]
815
916[[package ]]
1017name = " lib2"
1118version = " 0.1.0"
1219dependencies = [
20+ " http" ,
1321 " implementors" ,
1422]
Original file line number Diff line number Diff line change @@ -8,3 +8,4 @@ path = "lib.rs"
88
99[dependencies ]
1010implementors = { path = " ./implementors" }
11+ http = { path = " ./http" }
Original file line number Diff line number Diff line change 1+ [package ]
2+ name = " http"
3+ version = " 0.1.0"
4+ edition = " 2018"
5+
6+ [lib ]
7+ path = " lib.rs"
Original file line number Diff line number Diff line change 1+ pub trait HttpTrait { }
Original file line number Diff line number Diff line change @@ -5,3 +5,6 @@ edition = "2018"
55
66[lib ]
77path = " lib.rs"
8+
9+ [dependencies ]
10+ http = { path = " ../http/" }
You can’t perform that action at this time.
0 commit comments