about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2021-05-25Move extra search result information for keywords and primitives from CSS to DOMGuillaume Gomez-16/+12
2021-05-25Auto merge of #84985 - pietroalbini:bootstrap-1.54, r=Mark-Simulacrumbors-1/+0
Bump bootstrap compiler to beta 1.53.0 This PR bumps the bootstrap compiler to version 1.53.0 beta, as part of our usual release process (this was supposed to be Wednesday's step, but creating the beta release took longer than expected). The PR also includes the "Bootstrap: skip rustdoc fingerprint for building docs" commit, see the reasoning [on Zulip](https://zulip-archive.rust-lang.org/241545trelease/88450153betabootstrap.html). r? `@Mark-Simulacrum`
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-24remove cfg(bootstrap)Pietro Albini-1/+0
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-23Auto merge of #85602 - GuillaumeGomez:donthide-inherent-impls, r=jshabors-5/+14
Don't hide inherent implementations by default Fixes a regression introduced in #85575. r? `@jsha`
2021-05-23Auto merge of #85479 - Stupremee:render-Self_as-type-casts, r=CraftSpiderbors-13/+21
rustdoc: render `<Self as X>::Y` type casts properly Rustdoc didn't render any `<Self as X>` casts which causes invalid code inside the documentation. This is fixed by this PR by checking if the target type `X` is different from `Self`, and if so, it will render a typecast. Resolves #85454
2021-05-23Don't hide inherent implementations by defaultGuillaume Gomez-5/+14
2021-05-23Rollup merge of #85575 - jsha:fix-toggle-settings, r=GuillaumeGomezDylan DPC-5/+22
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-5/+22
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-22Auto merge of #85514 - GuillaumeGomez:upgrade-minifer-version, r=Mark-Simulacrumbors-1/+1
Upgrade minifier version to 0.0.41
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-20Upgrade minifier version to 0.0.41Guillaume Gomez-1/+1
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-15/+10
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-19rustdoc: render `<Self as X>::Y` type casts properlyJustus K-13/+21
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``
2021-05-18Add method-toggle to <details> for methods.Jacob Hoffman-Andrews-15/+10
The makes the code for handling "auto-hide" settings more consistent.
2021-05-18Rollup merge of #85407 - GuillaumeGomez:copy-path-display-improvement, r=jshaRalf Jung-13/+39
Improve display for "copy-path" button, making it more discreet As suggested by `@Nemo157` [here](https://github.com/rust-lang/rust/pull/85118#issuecomment-838887670): ![Screenshot from 2021-05-18 11-18-49](https://user-images.githubusercontent.com/3050060/118626882-899ddb00-b7cb-11eb-84c5-ef68dee5e351.png) ![Screenshot from 2021-05-18 11-15-06](https://user-images.githubusercontent.com/3050060/118626880-899ddb00-b7cb-11eb-95c1-2f3bacd22374.png) ![Screenshot from 2021-05-18 11-18-54](https://user-images.githubusercontent.com/3050060/118626885-8a367180-b7cb-11eb-870c-7acdf4259bef.png) ![Screenshot from 2021-05-18 11-15-00](https://user-images.githubusercontent.com/3050060/118626877-89054480-b7cb-11eb-9efc-9a0f153964ce.png) ![Screenshot from 2021-05-18 11-18-58](https://user-images.githubusercontent.com/3050060/118626888-8a367180-b7cb-11eb-91bb-47867cd0f2cc.png) ![Screenshot from 2021-05-18 11-19-00](https://user-images.githubusercontent.com/3050060/118626891-8acf0800-b7cb-11eb-9e3d-d2937b361524.png) r? `@jsha`
2021-05-18Rollup merge of #84462 - jsha:focus-search-results2, r=GuillaumeGomezRalf Jung-195/+178
rustdoc: use focus for search navigation Rather than keeping track of highlighted element inside the JS, take advantage of `.focus()` and the :focus CSS pseudo-class. This required wrapping each row of results in one big `<a>` tag (because anchors can be focused, but table rows cannot). That in turn required moving from a table layout to a div layout with float. This makes it so Ctrl+Enter opens links in new tabs, and using the arrow keys to navigate off the bottom of the page scrolls the rest of the page into view. It also simplifies the keyboard event handling. It eliminates the need for click handlers on the search results, and for tracking mouse movements. This changes the UI treatment of mouse hovering. A hovered element now gets a light grey background, but does not change the focus. It's possible to have two highlighted search results: one that is focused (via keyboard) and one that is hovered (via mouse). Pressing enter will activate the focused link; clicking will activate the hovered link. This matches up with how Firefox and Chrome handle suggestions in their URL bar, and avoids stray mouse movements changing the focus. Selecting tabs is now done with left/right arrows while any search result is focused. The visibility of results on each search tab is controlled with the "active" class, rather than by setting display: none directly. Note that the old code kept track of highlighted search element when tabbing back and forth. The new code doesn't. Demo at https://hoffman-andrews.com/rust/focus-search-results2/std/?search=fn Fixes #84384 Fixes #79962 Fixes #79872
2021-05-18Fix escape handling on search resultsGuillaume Gomez-2/+2
2021-05-18Rollup merge of #85280 - jsha:move-trait-toggles, r=GuillaumeGomezGuillaume Gomez-2/+7
Toggle-wrap items differently than top-doc. This makes sure things like trait methods get wrapped at the `<h3><code>` level rather than at the `.docblock` level. Also it ensures that only the actual top documentation gets the `.top-doc` class. Fixes #85167 Before: ![image](https://user-images.githubusercontent.com/220205/117743384-98790200-b1bb-11eb-8804-588530842514.png) https://doc.rust-lang.org/nightly/std/io/trait.Read.html#tymethod.read After: ![image](https://user-images.githubusercontent.com/220205/118410882-98a75080-b646-11eb-949d-ca688bab6923.png)
2021-05-18Improve display for "copy-path" button, making it more discreteGuillaume Gomez-13/+39
2021-05-17Fix rebase conflictsJoshua Nelson-1/+1
2021-05-17Address review commentsJoshua Nelson-1/+1
- Simplify boolean expression - Give an example of invalid syntax - Remove explanation of why code block is text
2021-05-17Rename INVALID_RUST_CODEBLOCK{,S}Joshua Nelson-5/+5
2021-05-17Add back missing help for ignore blocksJoshua Nelson-28/+26
This also gives a better error message when a span is missing.
2021-05-17New rustdoc lint to respect -Dwarnings correctlyAlexis Bourget-33/+72
This adds a new lint to `rustc` that is used in rustdoc when a code block is empty or cannot be parsed as valid Rust code. Previously this was unconditionally a warning. As such some documentation comments were (unknowingly) abusing this to pass despite the `-Dwarnings` used when compiling `rustc`, this should not be the case anymore.
2021-05-17Rollup merge of #85367 - GuillaumeGomez:fix-css-rule, r=jshaRalf Jung-4/+4
Fix invalid input:disabled CSS selector For some reason, we used "search-focus" instead of "search-input"... r? ``@jsha``
2021-05-16rustdoc: restore header sizesJacob Hoffman-Andrews-3/+7
2021-05-17Auto merge of #85178 - cjgillot:local-crate, r=oli-obkbors-11/+8
Remove CrateNum parameter for queries that only work on local crate The pervasive `CrateNum` parameter is a remnant of the multi-crate rustc idea. Using `()` as query key in those cases avoids having to worry about the validity of the query key.
2021-05-16Fix invalid input:disabled CSS selectorGuillaume Gomez-4/+4
2021-05-16Auto merge of #85304 - Stupremee:crates-in-sidebar-in-root, r=Nemo157bors-3/+14
rustdoc: Call `initSidebarItems` in root module of crate r? `@jsha` Resolves #85301
2021-05-15Call `initSidebarItems` in root module of crateJustus K-3/+14