From a8318e420d19c364b1eec33956a86164941f6df4 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 13 Jun 2021 21:49:10 +0200 Subject: [PATCH 1/3] Fix font-weight --- src/librustdoc/html/static/rustdoc.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index d8684641a3045..7535145caa5c8 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -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; From d87ec7ae19c05f8bf1d6dec95edee518b5883257 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 13 Jun 2021 21:49:30 +0200 Subject: [PATCH 2/3] Update browser-ui-test version --- src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile index 605d988dad712..e2c064ee75d23 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile +++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile @@ -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 browser-ui-test@0.2.12 --unsafe-perm=true +RUN npm install -g browser-ui-test@0.2.14 --unsafe-perm=true ENV RUST_CONFIGURE_ARGS \ --build=x86_64-unknown-linux-gnu \ From 466aec9957a57687d607dba4859c7178767b9b6a Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 13 Jun 2021 21:50:11 +0200 Subject: [PATCH 3/3] Add test to ensure font-weight is applied correctly --- src/test/rustdoc-gui/font-weight.goml | 7 +++++++ src/test/rustdoc-gui/sidebar.goml | 5 ++++- src/test/rustdoc-gui/src/lib2.rs | 20 ++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/test/rustdoc-gui/font-weight.goml diff --git a/src/test/rustdoc-gui/font-weight.goml b/src/test/rustdoc-gui/font-weight.goml new file mode 100644 index 0000000000000..d8ad6c2e3f5be --- /dev/null +++ b/src/test/rustdoc-gui/font-weight.goml @@ -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"}) diff --git a/src/test/rustdoc-gui/sidebar.goml b/src/test/rustdoc-gui/sidebar.goml index 7703677154ef9..e0e6d19cace36 100644 --- a/src/test/rustdoc-gui/sidebar.goml +++ b/src/test/rustdoc-gui/sidebar.goml @@ -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" diff --git a/src/test/rustdoc-gui/src/lib2.rs b/src/test/rustdoc-gui/src/lib2.rs index 73384cbf90633..6fa1b36b29bb9 100644 --- a/src/test/rustdoc-gui/src/lib2.rs +++ b/src/test/rustdoc-gui/src/lib2.rs @@ -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; +}