]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #93673 - jsha:linkify-sidebar-headings, r=GuillaumeGomez
authorMara Bos <m-ou.se@m-ou.se>
Mon, 7 Feb 2022 14:08:35 +0000 (14:08 +0000)
committerGitHub <noreply@github.com>
Mon, 7 Feb 2022 14:08:35 +0000 (14:08 +0000)
commit0b6c7fbbba8540cf33a257022324849580316510
tree15165eac8e21ca6d43118edb28d4f1519b5ba9a8
parentf611de074a9ff2dcbabc7e8e88aed65dda10378e
parente27ebb5dff38aad9fbaa3d957820a1bd3c8d3bbf
Rollup merge of #93673 - jsha:linkify-sidebar-headings, r=GuillaumeGomez

Linkify sidebar headings for sibling items

Also adjust CSS so this doesn't produce excess padding/margin.

Note: I tried and failed to write a test with browser-UI-test. First I tried to `assert-property: (".block.mod h3 a", {"href": "index.html#macros"})`. But the `href` that gets read out is the fully-quallified URL, starting with `file:///`. That URL will differ depending on what path the test is run from, so that doesn't work.

Next I tried clicking on the appropriate sidebar link, and verifying that the appropriate heading on the next page is highlighted with the right background color. However, that also didn't work: according to browser-UI-test, the targeted heading was plain white. However, running with no-headless, I could see that it actually was yellow. I suspect this is a bug in the older version of Chromium used with browser-UI-test's bundled puppeteer, since it doesn't reproduce on latest Chrome.

Fixes #92957

Demo: https://rustdoc.crud.net/jsha/linkify-sidebar-headings/std/string/trait.ToString.html

r? ``@GuillaumeGomez``
src/librustdoc/html/static/css/rustdoc.css