summary refs log tree commit diff
path: root/src/librustdoc/html/static
AgeCommit message (Collapse)AuthorLines
2021-07-26Rustdoc accessibility: use real headers for doc itemsbors-20/+59
Part of #87059 Partially reverts #84703 Heavily modified for beta backport needs.
2021-07-26Remove redundant CSSMichael Howell-1/+0
2021-07-26Rustdoc accessibility: make the sidebar headers actual headersMichael Howell-0/+5
Part of #87059 Preview it at: https://notriddle.com/notriddle-rustdoc-test/rustdoc-sidebar-header/std/index.html
2021-07-26Do not hide the sidebar on mobile, move it outside of the viewport insteadGuillaume Gomez-4/+6
2021-06-08Rollup merge of #86095 - GuillaumeGomez:search-description-codeblock, r=jshaYuki Okushi-1/+1
Search description codeblock The codeblocks are not displayed correctly: ![Screenshot from 2021-06-07 11-11-53](https://user-images.githubusercontent.com/3050060/120991915-5fb05680-c782-11eb-9b32-973a64b1f631.png) This PR interprets the HTML correctly (and still prevent invalid HTML because of how it inserts it): ![Screenshot from 2021-06-07 11-12-00](https://user-images.githubusercontent.com/3050060/120991919-6048ed00-c782-11eb-8ac5-c3aa6508bc8b.png) r? ```@jsha```
2021-06-08Rollup merge of #86078 - GuillaumeGomez:type-page-font-weight, r=jshaYuki Okushi-1/+1
Type page font weight Fixes https://github.com/rust-lang/rust/issues/86069. r? ```@jsha```
2021-06-07Fix integration of codeblocks in search result descriptionGuillaume Gomez-1/+1
2021-06-06Fix invalid weight for type pagesGuillaume Gomez-1/+1
2021-06-05Fix display for search resultsGuillaume Gomez-0/+2
2021-06-03Auto merge of #84834 - GuillaumeGomez:sidebar-unification, r=jshabors-53/+57
Sidebar unification This PR does a few things: * Put crates list at all levels (before, it was only on the "top" items) * Fix bug in module sidebar: the list of items was from the parent module. The other changes (on bootstrap mostly) were to allow to generate multiple crates in a same folder so that we can ensure that clicking on the crates in the sidebar works as expected. I added a rustdoc-gui test to ensure everything is where it should be. r? `@jyn514`
2021-06-02Replace h3 for notable traits with divGuillaume Gomez-15/+23
2021-06-02Remove data-level selectors from CSS.Jacob Hoffman-Andrews-71/+13
2021-06-01Remove invalid usage of aria-levelGuillaume Gomez-18/+18
2021-06-01Replace h3 and h4 containing invalid DOMGuillaume Gomez-34/+75
2021-05-31Fix details rustdoc toggle for blanket implIvan Tham-2/+1
In the meantime, allow all of the details to have the same top.
2021-05-31Improve display of the separation between page items and siblings in the sidebarGuillaume Gomez-1/+4
2021-05-31Only list crates on the crate pageGuillaume Gomez-1/+5
2021-05-31Remove unneeded file to load sidebar items at crate levelGuillaume Gomez-2/+0
2021-05-31* Put crates list at all levelsGuillaume Gomez-50/+49
* Fix bug in module sidebar: the list of items was from the parent module
2021-05-30Rollup merge of #85285 - GuillaumeGomez:eslint-check, r=jsha,Mark-SimulacrumGuillaume Gomez-0/+1
Add eslint checks to CI It also allowed me to fix some potential issues that went unnoticed. Having this process automated will hopefully prevent us to add more errors. :) cc `@Mark-Simulacrum` (for the add in the CI). r? `@jsha`
2021-05-30Fix eslint error in sidebar-items.jsGuillaume Gomez-0/+1
2021-05-29Auto merge of #85540 - GuillaumeGomez:better-result-dom-generation, r=jshabors-22/+55
Better result dom generation First commit is from https://github.com/rust-lang/rust/pull/85506. We realized in https://github.com/rust-lang/rust/pull/85506#issuecomment-844984162 thanks to `@dns2utf8` that in some cases, the generated search result DOM was invalid. This was not strict enough and the DOM was inserted as a big string, which wasn't great. r? `@jsha`
2021-05-26Rollup merge of #84048 - konan8205:master, r=jshaYuki Okushi-1/+102
Avoid CJK legacy fonts in Windows As metioned in #84035, the default serif CJK font in Windows is meh-looking. To avoid this, we should use sans-serif font or provide CJK glyph supported font in `rustdoc.css`.
2021-05-25Fix more search results CSS rulesGuillaume Gomez-6/+6
2021-05-25Generate DOM more securelyGuillaume Gomez-16/+49
2021-05-25Move extra search result information for keywords and primitives from CSS to DOMGuillaume Gomez-16/+12
2021-05-24Rollup merge of #85621 - jsha:serif-in-table, r=GuillaumeGomezGuillaume Gomez-0/+1
Restore sans-serif font for module items. This was broke in #84462 by modifying a style that applied both to searches and to module items (and other tables). Fixes #85616. Fixes https://github.com/rust-lang/rust/issues/85545. r? `@camelid`
2021-05-24Rollup merge of #85551 - GuillaumeGomez:fix-search-result-overflow, r=jshaGuillaume Gomez-7/+34
Fix search results display Fixes https://github.com/rust-lang/rust/issues/85544. cc `@dns2utf8` r? `@jsha`
2021-05-23Restore sans-serif font for module items.Jacob Hoffman-Andrews-0/+1
This was broke in #84462 by modifying a style that applied both to searches and to module items (and other tables).
2021-05-23Rollup merge of #85575 - jsha:fix-toggle-settings, r=GuillaumeGomezDylan DPC-4/+21
Fix auto-hide for implementations and implementors. This sets their toggles to be closed in the HTML (matching the default setting), and opens them if the setting indicates to do so. This distinguishes between implementations and implementors based on being descendants of certain named elements. Demo https://hoffman-andrews.com/rust/fix-toggle-settings/std/io/trait.Read.html#implementors and https://hoffman-andrews.com/rust/fix-toggle-settings/std/string/struct.String.html#trait-implementations Fixes #85411 r? `@GuillaumeGomez`
2021-05-22Fix auto-hide for implementations and implementors.Jacob Hoffman-Andrews-4/+21
This sets their toggles to be closed in the HTML (matching the default setting), and opens them if the setting indicates to do so. This distinguishes between implementations and implementors based on being descendants of certain named elements.
2021-05-22Set desc class on the div instead of the span to simplify CSSGuillaume Gomez-6/+6
2021-05-22Mobile description width: 100%Stefan Schindler-1/+1
2021-05-22Add padding to mobile layout and fix width issue on bothStefan Schindler-0/+2
2021-05-22Prepar to remove deep nestingStefan Schindler-6/+5
2021-05-22Implement staggered mobile layoutStefan Schindler-4/+17
2021-05-22Auto merge of #85568 - GuillaumeGomez:search-result-extra-info, r=jshabors-2/+2
Search result extra info The CSS rule was not updated when we updated the search result, this fixes it: Before: ![Screenshot from 2021-05-21 22-56-17](https://user-images.githubusercontent.com/3050060/119197314-d31a4e80-ba87-11eb-863a-bc0b3de3bfb2.png) After: ![Screenshot from 2021-05-21 22-54-53](https://user-images.githubusercontent.com/3050060/119197227-b54ce980-ba87-11eb-9f43-c10803ca1b90.png) r? `@jsha`
2021-05-21Fix display for primitive and keyword extra infoGuillaume Gomez-2/+2
2021-05-21Rollup merge of #85548 - GuillaumeGomez:remove-dead-js, r=jshaGuillaume Gomez-158/+0
Remove dead toggle JS code Explanations on how I got there: I randomly saw `adjustToggle` while browsing through code, checked where it was called, put a `debugger;` instruction in it and checked on all pages while playing with settings and toggles. The breakpoint was never triggered. I then looked at `collapseNonInherent` (its grand-parent). In there, the breakpoint was triggered so I look at what was being done and in fact... nothing. So I simply removed it all, re-ran the tests and play with the UI. Everything is working as expected. Better double check in case I forgot to check a case though, but if nothing has been left out, then it's a great cleanup once again. :) r? ``@jsha``
2021-05-21Rollup merge of #85506 - GuillaumeGomez:reset-focusedByTab, r=jshaGuillaume Gomez-4/+5
Reset "focusedByTab" field when doing another search Fixes https://github.com/rust-lang/rust/issues/85467. The problem was simply that we forget to reset the `focusedByTab` field, which was still referring to removed DOM elements. r? ``@jsha``
2021-05-21Fix search results displayGuillaume Gomez-3/+16
2021-05-21Remove dead toggle JS codeGuillaume Gomez-158/+0
2021-05-20Rollup merge of #85509 - GuillaumeGomez:search-null-title, r=jshaGuillaume Gomez-1/+1
Prevent tab title to "null" if the URL is a search one When we arrive on page with a search parameter in the URL, until the results are displayed, the page title is "null". It's because of this code: ```js if (params.search !== undefined) { var search = searchState.outputElement(); search.innerHTML = "<h3 style=\"text-align: center;\">" + searchState.loadingText + "</h3>"; searchState.showResults(search); loadSearch(); } ``` In `searchState.showResults`, we have this: ```js document.title = searchState.title; ``` But since it's `null`, we set it as title. This PR fixes it. r? `@jsha`
2021-05-20Prevent tab title to "null" if the URL is a search oneGuillaume Gomez-1/+1
2021-05-20Reset "focusedByTab" field when doing another searchGuillaume Gomez-4/+5
2021-05-20Rollup merge of #85470 - GuillaumeGomez:fix-css-rules, r=jshaRalf Jung-9/+6
Fix invalid CSS rules for a:hover When hovering some links: ![Screenshot from 2021-05-19 15-00-31](https://user-images.githubusercontent.com/3050060/118823585-5f2a4b80-b8b9-11eb-8043-bb7759a178c7.png) ![Screenshot from 2021-05-19 15-00-29](https://user-images.githubusercontent.com/3050060/118823566-5b96c480-b8b9-11eb-8c4e-08e490752fbf.png) It is a side-effect from #84462. r? ```@jsha```
2021-05-20Rollup merge of #85169 - jsha:hoist-classes, r=GuillaumeGomezRalf Jung-12/+4
Add method-toggle to <details> for methods The makes the code for handling "auto-hide" settings more consistent. Demo at https://hoffman-andrews.com/rust/hoist-classes/std/string/struct.String.html Fixes #84829
2021-05-19Fix invalid CSS rules for a:hoverGuillaume Gomez-9/+6
2021-05-18Rollup merge of #85438 - GuillaumeGomez:fix-escape-handling, r=jshaJack Huey-2/+2
Fix escape handling Currently, when we press Escape while on the search results, nothing is happening, this PR fixes it. More information: it's because in case the element doesn't exist, `hasClass` will return `null`, which coerces into `false` with the `!` comparison operator. But even if it returned `false`, it would still be an issue because if the element doesn't exist, it means it's hidden so in this case it's just as good, hence the additional check I added. r? ``@jsha``
2021-05-18Rollup merge of #85396 - jsha:top-doc-font-sizes, r=GuillaumeGomezJack Huey-3/+7
rustdoc: restore header sizes The `<details>` toggle work changed the relationship from #main to the top-doc docblock so it was no longer a parent relationship but a great-grandparent relationship. This updates the CSS rules that set the heading sizes so they still apply. Fixes #85389 r? ``@camelid``