summary refs log tree commit diff
path: root/src/test/rustdoc-gui
AgeCommit message (Collapse)AuthorLines
2022-01-05Make rustdoc headings black, and markdown blueJacob Hoffman-Andrews-3/+12
2021-11-26Update test for anchors and headings positionGuillaume Gomez-1/+47
2021-11-25Improve testsGuillaume Gomez-1/+4
2021-11-24Auto merge of #91203 - GuillaumeGomez:rollup-kwtqvb1, r=GuillaumeGomezbors-10/+31
Rollup of 7 pull requests Successful merges: - #89542 (Partially stabilize `duration_consts_2`) - #90044 (Restrict aarch64 outline atomics to glibc for now.) - #90420 (Create rustdoc_internals feature gate) - #91075 (Reduce prominence of item-infos) - #91151 (Fix test in std::process on android) - #91179 (Fix more <a> color) - #91199 (rustdoc: Add test for mixing doc comments and attrs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-11-24Rollup merge of #91179 - GuillaumeGomez:a-color, r=jshaGuillaume Gomez-8/+29
Fix more <a> color Fixes #91175. Another bug I saw is: ![Screenshot from 2021-11-24 11-41-27](https://user-images.githubusercontent.com/3050060/143239845-f173cfeb-8f5c-4215-a5af-b71d4e1bcd84.png) I fixed it as well. r? ``@jsha``
2021-11-24Rollup merge of #91075 - jsha:chill-item-info, r=GuillaumeGomezGuillaume Gomez-1/+1
Reduce prominence of item-infos Fixes #59853 - Remove border. - Reduce size of emoji slightly. - Remove details disclosure for unstable reason. This was inconsistent with our other details disclosures, and the detail revealed was usually better explained by clicking on the issue link. Demo: https://rustdoc.crud.net/jsha/chill-item-info/std/mem/union.MaybeUninit.html#method.slice_assume_init_ref Compare vs: https://doc.rust-lang.org/nightly/std/mem/union.MaybeUninit.html#method.slice_assume_init_ref <img src="https://user-images.githubusercontent.com/220205/142717815-09828c9e-6ff4-445a-8ccc-31e028fd4985.png" width=700>
2021-11-24Rollup merge of #90420 - GuillaumeGomez:rustdoc-internals-feature, r=camelidGuillaume Gomez-1/+1
Create rustdoc_internals feature gate As suggested by ``@camelid`` [here](https://github.com/rust-lang/rust/pull/90398#issuecomment-955093851), since `doc_keyword` and `doc_primitive` aren't meant to be stabilized, we could put them behind a same feature flag. This is pretty much what it would look like (needs to update the tests too). The tracking issue is https://github.com/rust-lang/rust/issues/90418. What do you think ``@rust-lang/rustdoc`` ?
2021-11-24Create rustdoc_internals feature gateGuillaume Gomez-1/+1
2021-11-24Fix clicking on anchors inside summary tags.Jacob Hoffman-Andrews-0/+4
2021-11-24Update GUI tests for <a> colorGuillaume Gomez-8/+29
2021-11-24Auto merge of #91171 - jsha:fix-rustdoc-gui-test, r=GuillaumeGomezbors-1/+1
Fix toggle-click-deadspace rustdoc-gui test In #91103 I introduced a rustdoc-gui test for clicks on toggles. I introduced some documentation on a method in lib2/struct.Foo.html so there would be something to toggle, but accidentally left the test checking test_docs/struct.Foo.html. That caused the test to reliably fail. I'm not sure how that test got past GitHub Actions and bors, but it's manifesting in test failures at https://github.com/rust-lang/rust/pull/91062#issuecomment-977589705 and https://github.com/rust-lang/rust/pull/91170#issuecomment-977636159. This fixes by pointing at the right file. r? `@GuillaumeGomez`
2021-11-24Fix toggle-click-deadspace rustdoc-gui testJacob Hoffman-Andrews-1/+1
2021-11-23Rollup merge of #91103 - jsha:non-toggle-click-doesnt-toggle, ↵Matthias Krüger-0/+10
r=Manishearth,GuillaumeGomez Inhibit clicks on summary's children A byproduct of using `<details>` and `<summary>` to show/hide detailed documentation was that clicking any part of a method heading (or impl heading) would show or hide the documentation. This was not super noticeable because clicking a link inside the method heading would navigate to that link. But clicking any unlinked black text in a method heading would trigger the behavior. That behavior was somewhat unexpected, and means that if you try to click a type name in a method heading, but miss by a few pixels, you get a confusing surprise. This change inhibits that behavior by putting an event listener on most summaries that cancels the event unless the event target was the summary itself. In practice, that means it cancels the event unless the target was the "[+]" / "[-]", because the rest of the heading is wrapped inside a `<div>`, which is the target for anything that doesn't have a more specific target. r? ``@Manishearth``
2021-11-22Rollup merge of #91102 - jsha:theme-anchor, r=GuillaumeGomezMatthias Krüger-0/+17
Set color for <a> in a more straightforward way. Previously, we set the default color for <a> tags to black, and then had an override with a bunch of not() clauses to set anchors in docblocks to blue. Instead, we should set the default color for <a> to blue (or equivalent in other themes), and override it for places like the sidebar or search results, where we don't want them to be styled as links. Demo at https://rustdoc.crud.net/jsha/theme-anchor/std/string/struct.String.html. This should result in no visible changes. r? `@GuillaumeGomez`
2021-11-22Add GUI test for clicking on non-toggle summaryJacob Hoffman-Andrews-0/+10
2021-11-22Set color for <a> in a more straightforward wayJacob Hoffman-Andrews-0/+17
Previously, we set the default color for <a> tags to black, and then had an override with a bunch of not() clauses to set anchors in docblocks to blue. Instead, we should set the default color for <a> to blue (or equivalent in other themes), and override it for places like the sidebar or search results, where we don't want them to be styled as links.
2021-11-20Reduce prominence of item-infosJacob Hoffman-Andrews-1/+1
- Remove border. - Reduce size of emoji slightly. - Remove details disclosure for unstable reason. This was inconsistent with our other details disclosures, and the detail revealed was usually better explained by clicking on the issue link.
2021-11-20Rollup merge of #90089 - jsha:enum-fields-headings, r=camelid,GuillaumeGomezMatthias Krüger-20/+20
Improve display of enum variants Use h3 and h4 for the variant name and the "Fields" subheading. Remove the "of T" part of the "Fields" subheading. Remove border-bottom from "Fields" subheading. Move docblock below "Fields" listing. Fixes #90061 Demo: https://jacob.hoffman-andrews.com/rust/xmlparser-updated/xmlparser/enum.Token.html#variants https://jacob.hoffman-andrews.com/rust/fix-enum-variants/std/io/enum.ErrorKind.html#variants https://jacob.hoffman-andrews.com/rust/fix-enum-variants/std/result/enum.Result.html#variants r? ``@camelid``
2021-11-04Fix missing bottom border for headings in sidebarGuillaume Gomez-14/+17
2021-10-31Hide search bar in noscript.cssJacob Hoffman-Andrews-0/+6
Also, remove the highlighting of the search bar in disabled state. This reduces flicker when loading a page.
2021-10-30Improve display of enum variantsJacob Hoffman-Andrews-20/+20
Use h3 and h4 for the variant name and the "Fields" subheading. Remove the "of T" part of the "Fields" subheading. Remove border-bottom from "Fields" subheading. Move docblock below "Fields" listing.
2021-10-30Remove underlines from non-top docblocks.Jacob Hoffman-Andrews-2/+56
We still had a number of places where underlined section headings would show up, like under Implementations.
2021-10-27Auto merge of #90186 - jsha:fix-header-sizes, r=GuillaumeGomezbors-1/+227
Fix documentation header sizes And add a rustdoc-gui test confirming various header sizes. Split off from #90156. This fixes a regression in #89506 where the heading level of titles within Markdown was too high (h2) for docblocks under structs, unions, and enum impls. r? `@camelid` Demo: https://jacob.hoffman-andrews.com/rust/fix-header-sizes/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E Stable: https://doc.rust-lang.org/stable/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E Beta: https://doc.rust-lang.org/beta/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E
2021-10-27Rollup merge of #90232 - konan8205:master, r=GuillaumeGomezMatthias Krüger-14/+14
rustdoc: Use TTF based font instead of OTF for CJK glyphs to improve readability Due to Windows' implementation of font rendering, OpenType fonts can be distorted. So the existing font, Noto Sans KR, is not very readable on Windows. This PR improves readability of Korean glyphs on Windows. ## Before ![원1](https://user-images.githubusercontent.com/11029378/138592394-16b15787-532d-4421-a5eb-ed85675290fa.png) ## After ![원2](https://user-images.githubusercontent.com/11029378/138592409-f3a440ee-f0fc-40e4-9561-42c479439c9f.png) The fonts included in this PR are licensed under the SIL Open Font License and generated with these commands: ```sh pyftsubset NanumBarunGothic.ttf \ --unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \ --output-file=NanumBarunGothic.ttf.woff --flavor=woff ``` ```sh pyftsubset NanumBarunGothic.ttf \ --unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \ --output-file=NanumBarunGothic.ttf.woff2 --flavor=woff2 ``` r? ``@GuillaumeGomez``
2021-10-26rustdoc: use ttf based font for cjk glyphsShinwoo Park-14/+14
2021-10-25Fix documentation header sizesJacob Hoffman-Andrews-1/+227
And add a rustdoc-gui test confirming various header sizes.
2021-10-25Fix scrollbars appearing on information tooltip on mac when they shouldn'tGuillaume Gomez-0/+8
2021-10-23Outdent method headings so they stand outJacob Hoffman-Andrews-0/+11
The makes the heading / documentation distinction clearer.
2021-10-21Rollup merge of #90097 - ↵Yuki Okushi-6/+19
GuillaumeGomez:duplicated-sidebar-entry-reexported-macro, r=notriddle Add test for duplicated sidebar entries for reexported macro Fixes #90015. r? ````@notriddle````
2021-10-21Rollup merge of #90048 - GuillaumeGomez:line-number-setting, r=jshaYuki Okushi-0/+23
Add test for line-number setting The first commit updates the version of the package to be able to have multi-line commands (which looks much nicer for this test). r? ````@jsha````
2021-10-20Add test for duplicated sidebar entries for reexported macroGuillaume Gomez-6/+19
2021-10-20Add test for line-number settingGuillaume Gomez-0/+23
2021-10-18Add test to ensure that the docblock elements left margin is as expectedGuillaume Gomez-0/+6
2021-10-18Add GUI overflow tests for constant and typedefGuillaume Gomez-1/+35
2021-10-18* Remove left margin on items declaration at the top of their documentation pageGuillaume Gomez-6/+6
* Rename "type-decl" into "item-decl" to reflect the change of usage
2021-10-10Add test for <code> in doc blocks on mobileGuillaume Gomez-0/+12
2021-10-03Add a test to detect overlapping entries in overview tablesStefan Schindler-0/+26
Detects https://github.com/rust-lang/rust/issues/88545
2021-09-13Rollup merge of #88896 - GuillaumeGomez:flakyness, r=camelidGuillaume Gomez-0/+1
Reduce possibility of flaky tests As asked in https://github.com/rust-lang/rust/pull/88885. r? ``@camelid``
2021-09-13 * Enable generate-link-to-def feature on a rustdoc GUI testGuillaume Gomez-0/+43
* Add test for jump-to-def links background color
2021-09-12Reduce possibility of flaky testsGuillaume Gomez-0/+1
2021-09-08Add tests to ensure that <table> don't break doc blocks width anymoreGuillaume Gomez-0/+17
2021-09-01Auto merge of #88490 - GuillaumeGomez:associated-types-implementors-display, ↵bors-11/+21
r=camelid,Manishearth Display associated types of implementors Fixes #86631. Contrary to before, it doesn't display methods. I also had to "resurrect" the `auto-hide-trait-implementations` setting. :3 Only question at this point: should I move the `render_impl` boolean arguments into one struct? We're starting to have quite a lot of them... cc `@cynecx` r? `@camelid`
2021-09-01Remove implementors settingGuillaume Gomez-10/+1
2021-09-01Add tests for implementors associated types displayGuillaume Gomez-11/+30
2021-09-01Rollup merge of #88410 - camelid:fix-assoc-bold, r=GuillaumeGomezMara Bos-0/+15
Remove bolding on associated constants Associated types don't get bolded, so it looks off to have one kind bolded and one not.
2021-08-31Remove bolding on associated constantsNoah Lev-0/+15
Associated types don't get bolded, so it looks off to have one kind bolded and one not.
2021-08-28Add test for code blocks colorGuillaume Gomez-13/+30
2021-08-28Fix code blocks color in ayu themeGuillaume Gomez-0/+2
2021-08-19Rollup merge of #88093 - Kobzol:rustdoc-wrap-code-in-code-tag, r=GuillaumeGomezGuillaume Gomez-1/+21
[rustdoc] Wrap code blocks in <code> tag This PR modifies Rustdoc output so that fenced code snippets, items and whole file source codes are wrapped in `<pre><code>` instead of just `<pre>`. This should improve the semantic meaning of the generated content. I'm not sure what to do about `render_attributes_in_pre` and `render_attributes_in_code`. These functions were clearly expected to be used for things inside `<pre>` or `<code>`, and since I added `<code>` in this PR, some of them will be used in a different context than before. However, it seems to me that even before they were not consistent. For example, `item_constant` used `render_attributes_in_code` for its attributes, however there was no `<code>` used for constants before this PR... Should I create some `rustdoc-gui` tests? For example to check that all `<pre>` tags have a `<code>` child? Fixes: https://github.com/rust-lang/rust/issues/88020
2021-08-19[rustdoc] Wrap code blocks in <code> tagJakub Beránek-1/+21