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`
This commit is contained in:
bors 2021-06-13 20:13:32 +00:00
commit f586d79d18
5 changed files with 35 additions and 5 deletions

View file

@ -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"})

View file

@ -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"

View file

@ -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;
}