Skip to content

Commit f586d79

Browse files
committed
Auto merge of #86271 - GuillaumeGomez:fix-font-weight, r=jsha
Fix font weight Fixes #86256. I realized that the only cases where we actually needed to have bold text was inside `impl-items`. cc `@camelid` r? `@jsha`
2 parents fb3ea63 + 466aec9 commit f586d79

File tree

5 files changed

+35
-5
lines changed

5 files changed

+35
-5
lines changed

src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ ENV PATH="/node-v14.4.0-linux-x64/bin:${PATH}"
7171
# https://github.com/puppeteer/puppeteer/issues/375
7272
#
7373
# We also specify the version in case we need to update it to go around cache limitations.
74-
RUN npm install -g [email protected].12 --unsafe-perm=true
74+
RUN npm install -g [email protected].14 --unsafe-perm=true
7575

7676
ENV RUST_CONFIGURE_ARGS \
7777
--build=x86_64-unknown-linux-gnu \

src/librustdoc/html/static/rustdoc.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ h1.fqn > .in-band > a:hover {
137137
h2, h3, h4 {
138138
border-bottom: 1px solid;
139139
}
140-
.impl, .method,
141-
.type:not(.container-rustdoc), .associatedconstant,
142-
.associatedtype {
140+
.impl, .impl-items .method,
141+
.impl-items .type, .impl-items .associatedconstant,
142+
.impl-items .associatedtype {
143143
flex-basis: 100%;
144144
font-weight: 600;
145145
margin-top: 16px;

src/test/rustdoc-gui/font-weight.goml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
goto: file://|DOC_PATH|/lib2/struct.Foo.html
2+
// This test checks that the font weight is correctly applied.
3+
assert: ("//*[@class='docblock type-decl']//a[text()='Alias']", {"font-weight": "400"})
4+
assert: ("//*[@class='structfield small-section-header']//a[text()='Alias']", {"font-weight": "400"})
5+
assert: ("#method\.a_method > code", {"font-weight": "600"})
6+
assert: ("#associatedtype\.X > code", {"font-weight": "600"})
7+
assert: ("#associatedconstant\.Y > code", {"font-weight": "600"})

src/test/rustdoc-gui/sidebar.goml

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ assert: (".sidebar > .location", "Crate lib2")
3131
assert: (".sidebar-elems > .crate > ul > li > a.current", "lib2")
3232
// We now go to the "foobar" function page.
3333
assert: (".sidebar-elems > .items > ul > li:nth-child(1)", "Modules")
34-
assert: (".sidebar-elems > .items > ul > li:nth-child(2)", "Functions")
34+
assert: (".sidebar-elems > .items > ul > li:nth-child(2)", "Structs")
35+
assert: (".sidebar-elems > .items > ul > li:nth-child(3)", "Traits")
36+
assert: (".sidebar-elems > .items > ul > li:nth-child(4)", "Functions")
37+
assert: (".sidebar-elems > .items > ul > li:nth-child(5)", "Type Definitions")
3538
assert: ("#functions + table td > a", "foobar")
3639
click: "#functions + table td > a"
3740

src/test/rustdoc-gui/src/lib2.rs

+20
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,23 @@ pub mod module {
99
}
1010

1111
pub fn foobar() {}
12+
13+
pub type Alias = u32;
14+
15+
pub struct Foo {
16+
pub x: Alias,
17+
}
18+
19+
impl Foo {
20+
pub fn a_method(&self) {}
21+
}
22+
23+
pub trait Trait {
24+
type X;
25+
const Y: u32;
26+
}
27+
28+
impl Trait for Foo {
29+
type X = u32;
30+
const Y: u32 = 0;
31+
}

0 commit comments

Comments
 (0)