diff options
| author | Michael Howell <michael@notriddle.com> | 2022-08-26 08:27:31 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2022-08-26 08:48:50 -0700 |
| commit | 25eb52ff6900a43b0ddc809692c6ceaf8b563b61 (patch) | |
| tree | 848925c67967f7d4dea828b0deb56ab93736c5c3 | |
| parent | 8a13871b69924b74cfa1d737f2894068b37ea7ea (diff) | |
| download | rust-25eb52ff6900a43b0ddc809692c6ceaf8b563b61.tar.gz rust-25eb52ff6900a43b0ddc809692c6ceaf8b563b61.zip | |
rustdoc: remove incorrect CSS selector `.impl-items table td`
Fixes #100994 This selector was added in c7312fbae4979c6d4fdfbd1f55a71cd47d82a480. The bug can be seen at <https://doc.rust-lang.org/1.27.0/alloc/slice/trait.SliceIndex.html#foreign-impls>. This rule was added to help with a `<table>` that was used for displaying the function signature [src] lockup. That lockup was changed in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to use flexbox instead, leaving this selector unused (at least, for its original purpose).
| -rw-r--r-- | src/librustdoc/html/static/css/rustdoc.css | 2 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/docblock-table.goml | 4 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/src/test_docs/lib.rs | 26 |
3 files changed, 31 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index f6a7875fddc..2b9c61b6524 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -777,7 +777,7 @@ pre, .rustdoc.source .example-wrap { .content .docblock >.impl-items table td { padding: 0; } -.content .docblock > .impl-items .table-display, .impl-items table td { +.content .docblock > .impl-items .table-display { border: none; } diff --git a/src/test/rustdoc-gui/docblock-table.goml b/src/test/rustdoc-gui/docblock-table.goml new file mode 100644 index 00000000000..7263156ab2b --- /dev/null +++ b/src/test/rustdoc-gui/docblock-table.goml @@ -0,0 +1,4 @@ +goto: file://|DOC_PATH|/test_docs/doc_block_table/struct.DocBlockTable.html#method.func + +compare-elements-css: (".impl-items .docblock table th", ".top-doc .docblock table th", ["border"]) +compare-elements-css: (".impl-items .docblock table td", ".top-doc .docblock table td", ["border"]) diff --git a/src/test/rustdoc-gui/src/test_docs/lib.rs b/src/test/rustdoc-gui/src/test_docs/lib.rs index 1b26aaecb5e..a02d5934cc2 100644 --- a/src/test/rustdoc-gui/src/test_docs/lib.rs +++ b/src/test/rustdoc-gui/src/test_docs/lib.rs @@ -293,3 +293,29 @@ pub mod details { /// </details> pub struct Details; } + +pub mod doc_block_table { + + pub trait DocBlockTableTrait { + fn func(); + } + + /// Struct doc. + /// + /// | header1 | header2 | + /// |--------------------------|--------------------------| + /// | Lorem Ipsum, Lorem Ipsum | Lorem Ipsum, Lorem Ipsum | + pub struct DocBlockTable {} + + impl DocBlockTableTrait for DocBlockTable { + /// Trait impl func doc for struct. + /// + /// | header1 | header2 | + /// |--------------------------|--------------------------| + /// | Lorem Ipsum, Lorem Ipsum | Lorem Ipsum, Lorem Ipsum | + fn func() { + println!(); + } + } + +} |
