Skip to content

Commit 65d1c7f

Browse files
authored
Rollup merge of rust-lang#102442 - notriddle:notriddle/header-weight, r=GuillaumeGomez
rustdoc: remove bad CSS font-weight on `.impl`, `.method`, etc This line was added in c494a06, because at the time, the headers had these classes on them. Now, the headers are children of the `<section>` with the class on it. This commit also adds a test case, to make sure the srclink font weight does not regress again.
2 parents 149691c + 3f21f07 commit 65d1c7f

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

src/librustdoc/html/static/css/rustdoc.css

-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ h4.code-header {
194194
.impl-items .associatedtype,
195195
.methods .associatedtype {
196196
flex-basis: 100%;
197-
font-weight: 600;
198197
position: relative;
199198
}
200199

src/test/rustdoc-gui/anchor-navigable.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
88
// We check that ".item-info" is bigger than its content.
99
move-cursor-to: ".impl"
10-
assert-property: (".impl > a.anchor", {"offsetWidth": "9"})
10+
assert-property: (".impl > a.anchor", {"offsetWidth": "8"})
1111
assert-css: (".impl > a.anchor", {"left": "-8px"})

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ goto: file://|DOC_PATH|/test_docs/type.SomeType.html
1313
assert-css: (".top-doc .docblock p", {"font-weight": "400"}, ALL)
1414

1515
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
16-
assert-css: (".impl-items .method", {"font-weight": "600"}, ALL)
16+
assert-css: (".impl-items .method > .code-header", {"font-weight": "600"}, ALL)
1717

1818
goto: file://|DOC_PATH|/lib2/trait.Trait.html
1919

@@ -41,4 +41,4 @@ assert-count: (".methods .associatedtype", 1)
4141
assert-css: (".methods .associatedtype", {"font-weight": "600"})
4242
assert-count: (".methods .constant", 1)
4343
assert-css: (".methods .constant", {"font-weight": "600"})
44-
assert-css: (".methods .method", {"font-weight": "600"})
44+
assert-css: (".methods .method > .code-header", {"font-weight": "600"})

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
55
show-text: true
66
// Check the impl headers.
7-
assert-css: (".impl.has-srclink .srclink", {"font-size": "16px"}, ALL)
8-
assert-css: (".impl.has-srclink .code-header", {"font-size": "18px"}, ALL)
7+
assert-css: (".impl.has-srclink .srclink", {"font-size": "16px", "font-weight": 400}, ALL)
8+
assert-css: (".impl.has-srclink .code-header", {"font-size": "18px", "font-weight": 600}, ALL)
99
// Check the impl items.
10-
assert-css: (".impl-items .has-srclink .srclink", {"font-size": "16px"}, ALL)
11-
assert-css: (".impl-items .has-srclink .code-header", {"font-size": "16px"}, ALL)
10+
assert-css: (".impl-items .has-srclink .srclink", {"font-size": "16px", "font-weight": 400}, ALL)
11+
assert-css: (".impl-items .has-srclink .code-header", {"font-size": "16px", "font-weight": 600}, ALL)

0 commit comments

Comments
 (0)