Skip to content

Fix font weight #86271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ENV PATH="/node-v14.4.0-linux-x64/bin:${PATH}"
# https://github.com/puppeteer/puppeteer/issues/375
#
# We also specify the version in case we need to update it to go around cache limitations.
RUN npm install -g [email protected].12 --unsafe-perm=true
RUN npm install -g [email protected].14 --unsafe-perm=true

ENV RUST_CONFIGURE_ARGS \
--build=x86_64-unknown-linux-gnu \
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ h1.fqn > .in-band > a:hover {
h2, h3, h4 {
border-bottom: 1px solid;
}
.impl, .method,
.type:not(.container-rustdoc), .associatedconstant,
.associatedtype {
.impl, .impl-items .method,
.impl-items .type, .impl-items .associatedconstant,
.impl-items .associatedtype {
flex-basis: 100%;
font-weight: 600;
margin-top: 16px;
Expand Down
7 changes: 7 additions & 0 deletions src/test/rustdoc-gui/font-weight.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
goto: file://|DOC_PATH|/lib2/struct.Foo.html
// This test checks that the font weight is correctly applied.
assert: ("//*[@class='docblock type-decl']//a[text()='Alias']", {"font-weight": "400"})
assert: ("//*[@class='structfield small-section-header']//a[text()='Alias']", {"font-weight": "400"})
assert: ("#method\.a_method > code", {"font-weight": "600"})
assert: ("#associatedtype\.X > code", {"font-weight": "600"})
assert: ("#associatedconstant\.Y > code", {"font-weight": "600"})
5 changes: 4 additions & 1 deletion src/test/rustdoc-gui/sidebar.goml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ assert: (".sidebar > .location", "Crate lib2")
assert: (".sidebar-elems > .crate > ul > li > a.current", "lib2")
// We now go to the "foobar" function page.
assert: (".sidebar-elems > .items > ul > li:nth-child(1)", "Modules")
assert: (".sidebar-elems > .items > ul > li:nth-child(2)", "Functions")
assert: (".sidebar-elems > .items > ul > li:nth-child(2)", "Structs")
assert: (".sidebar-elems > .items > ul > li:nth-child(3)", "Traits")
assert: (".sidebar-elems > .items > ul > li:nth-child(4)", "Functions")
assert: (".sidebar-elems > .items > ul > li:nth-child(5)", "Type Definitions")
assert: ("#functions + table td > a", "foobar")
click: "#functions + table td > a"

Expand Down
20 changes: 20 additions & 0 deletions src/test/rustdoc-gui/src/lib2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,23 @@ pub mod module {
}

pub fn foobar() {}

pub type Alias = u32;

pub struct Foo {
pub x: Alias,
}

impl Foo {
pub fn a_method(&self) {}
}

pub trait Trait {
type X;
const Y: u32;
}

impl Trait for Foo {
type X = u32;
const Y: u32 = 0;
}