about summary refs log tree commit diff
path: root/tests/rustdoc-gui
AgeCommit message (Collapse)AuthorLines
2023-04-17rustdoc: restructure type search engine to pick-and-use IDsMichael Howell-0/+54
This change makes it so, instead of mixing string distance with type unification, function signature search works by mapping names to IDs at the start, reporting to the user any cases where it had to make corrections, and then matches with IDs when going through the items. This only changes function searches. Name searches are left alone, and corrections are only done when there's a single item in the search query.
2023-04-12Auto merge of #110252 - matthiaskrgr:rollup-ovaixra, r=matthiaskrgrbors-2/+27
Rollup of 8 pull requests Successful merges: - #109810 (Replace rustdoc-ui/{c,z}-help tests with a stable run-make test ) - #110035 (fix: ensure bad `#[test]` invocs retain correct AST) - #110089 (sync::mpsc: synchronize receiver disconnect with initialization) - #110103 (Report overflows gracefully with new solver) - #110122 (Fix x check --stage 1 when download-ci-llvm=false) - #110133 (Do not use ImplDerivedObligationCause for inherent impl method error reporting) - #110135 (Revert "Don't recover lifetimes/labels containing emojis as character literals") - #110235 (Fix `--extend-css` option) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-12Rollup merge of #110205 - notriddle:notriddle/pixelated-border, r=GuillaumeGomezMatthias Krüger-7/+70
rustdoc: make settings radio and checks thicker, less contrast This is very dependent on subjectivity and what screen you use, but this change makes the radio buttons' outer circle less ugly. This is because I could see the pixels very clearly, thanks to the very thin line and high contrast. This change makes both less severe, giving your browser's antialiasing algorithm more to work with. Since it's thicker, lowering the contrast shouldn't impact visibility. ## Preview https://notriddle.com/rustdoc-demo-html-3/pixelated-border/settings.html ## Before ![image](https://user-images.githubusercontent.com/1593513/231274191-143acbea-c433-4fb1-b46d-e5e4fe328d60.png) ## After ![image](https://user-images.githubusercontent.com/1593513/231287415-c1e59fe8-8bf8-489d-b607-95ebb71e4ac5.png) <details><summary>Original "after" image with 2px border around checked box</summary> ![image](https://user-images.githubusercontent.com/1593513/231274253-8b5011c6-82fb-4396-84d0-47b6bdff2260.png) </details>
2023-04-12Add/update tests for `--extend-css` optionGuillaume Gomez-2/+27
2023-04-12rustdoc: use CSS `overscroll-behavior` instead of JavaScriptMichael Howell-41/+12
Fixes the desktop scrolling weirdness mentioned in https://github.com/rust-lang/rust/pull/98775#issuecomment-1182575603 As described in the MDN page for this property: * The current Firefox ESR is 102, and the first Firefox version to support this feature is 59. * The current Chrome version 112, and the first version to support this is 63. * Edge is described as having a minor bug in `none` mode, but we use `contain` mode anyway, so it doesn't matter. * Safari 16, released September 2022, is the last browser to add this feature, and is also the oldest version we officially support.
2023-04-12rustdoc: make settings radio and checks thicker, less contrastMichael Howell-7/+70
This is very dependent on subjectivity and what screen you use, but this change makes the radio buttons' outer circle less ugly. This is because I could see the pixels very clearly, thanks to the very thin line and high contrast. This change makes both less severe, giving your browser's antialiasing algorithm more to work with. Since it's thicker, lowering the contrast shouldn't impact visibility.
2023-04-11Update rustdoc GUI tests to new browser-ui-test versionGuillaume Gomez-308/+308
2023-04-08Rollup merge of #110037 - notriddle:notriddle/theme-default, r=GuillaumeGomezNilstrieb-0/+24
rustdoc: add test and bug fix for theme defaults Part of https://github.com/rust-lang/rust/issues/66181
2023-04-06rustdoc: add test and bug fix for theme defaultsMichael Howell-0/+24
2023-04-06Run collapsed GUI test in mobile mode as wellGuillaume Gomez-7/+26
2023-04-05Update GUI tests for logo display on very small screensGuillaume Gomez-1/+8
2023-04-04Add GUI test for scrollbar position on source code pageGuillaume Gomez-0/+8
2023-03-31Add tests to check that collapsed content is expanded when jumping to itGuillaume Gomez-0/+21
2023-03-27Rollup merge of #109633 - GuillaumeGomez:fix-go-to-only-setting, r=notriddleMatthias Krüger-0/+63
Fix "Directly go to item in search if there is only one result" setting Part of #66181. The setting was actually broken, so I fixed it when I added the GUI test. r? `@notriddle`
2023-03-26Add GUI test for "Directly go to item in search if there is only one result" ↵Guillaume Gomez-0/+63
setting
2023-03-26Rollup merge of #109595 - GuillaumeGomez:improve-gui-test-auto-hide-trait, ↵Matthias Krüger-13/+47
r=notriddle Improve "Auto-hide trait implementation documentation" GUI test Part of #66181. I'll start working on the `include` command for `browser-ui-test` so we can greatly reduce the duplicated code between setting tests. r? ``@notriddle``
2023-03-25Improve "Auto-hide trait implementation documentation" GUI testGuillaume Gomez-13/+47
2023-03-24Add GUI test for "Auto-hide item methods' documentation" settingGuillaume Gomez-0/+48
2023-03-20Add GUI test for "Auto-hide item contents for large items" settingGuillaume Gomez-0/+51
2023-03-09Rollup merge of #106915 - notriddle:notriddle/load-only-one-theme, ↵Matthias Krüger-5/+5
r=GuillaumeGomez,jsha Only load one CSS theme by default This is a tweaked version of #103971 that uses `document.write` to create the stylesheet link at startup, avoiding a FOUC during page navigation. It also rebases the PR, making it work with the new hashed filenames. Fixes #82614 Preview: http://notriddle.com/notriddle-rustdoc-demos/load-only-one-theme-v2/std/index.html
2023-03-08Rollup merge of #108686 - notriddle:notriddle/jank-all, r=jshaMatthias Krüger-0/+14
rustdoc: include link on all.html location header This avoids a subtle layout shift when switching from the crate page to all items. ## Before | index.html | all.html | |------------|----------| | ![image](https://user-images.githubusercontent.com/1593513/222607866-4eac3f55-314c-4273-9664-503f2a79ad0a.png) | ![image](https://user-images.githubusercontent.com/1593513/222607895-2d6bac3b-f66a-47d4-b234-360f6f8e1ee3.png) | ## After | index.html | all.html | |------------|----------| | ![image](https://user-images.githubusercontent.com/1593513/222607866-4eac3f55-314c-4273-9664-503f2a79ad0a.png) | ![image](https://user-images.githubusercontent.com/1593513/222607997-e72c48a0-02c7-42a7-80c2-cd6bed48bd15.png) |
2023-03-08Update browser-ui-test versionMichael Howell-5/+5
Use NEAR check to allow one pixel difference between scroll positions.
2023-03-04rustdoc: include link on all.html location headerMichael Howell-0/+14
This avoids a subtle layout shift when switching from the crate page to all items.
2023-03-02Add GUI test for rustdoc search errors backgroundGuillaume Gomez-0/+39
2023-02-23No need for the wait-for anymore to go around browser navigation bugGuillaume Gomez-2/+1
2023-02-19Rollup merge of #107783 - notriddle:notriddle/item-table-ul, r=GuillaumeGomezDylan DPC-41/+41
rustdoc: simplify DOM for `.item-table` This switches from using `<div>` to the more semantic `<ul>`, and using class names that rhyme with the classes the search results table uses.
2023-02-13Rollup merge of #107340 - notriddle:notriddle/simplify-doctest-tooltip, ↵Matthias Krüger-122/+100
r=GuillaumeGomez rustdoc: merge doctest tooltip with notable traits tooltip Fixes https://discord.com/channels/442252698964721669/443150878111694848/1066420140167680000 <details><summary>a user report where the tooltip arrow overlaps the text</summary> ![](https://cdn.discordapp.com/attachments/443150878111694848/1066420139530145812/this-example-is-not-tested-busted-rendering.png) </details> Fixes #91100 Preview: <https://notriddle.com/notriddle-rustdoc-demos/simplify-doctest-tooltip/std/vec/struct.Vec.html#indexing> Screenshot: ![image](https://user-images.githubusercontent.com/1593513/214975516-72667632-4609-49fa-8c37-e8d2ba1ba7dc.png)
2023-02-12rustdoc: use tighter line height in h1 and h2Michael Howell-11/+11
2023-02-07rustdoc: simplify DOM for `.item-table`Michael Howell-41/+41
This switches from using `<div>` to the more semantic `<ul>`, and using class names that rhyme with the classes the search results table uses.
2023-02-06Auto merge of #107141 - notriddle:notriddle/max-lev-distance-2023, ↵bors-2/+14
r=GuillaumeGomez rustdoc: compute maximum Levenshtein distance based on the query Preview: https://notriddle.com/notriddle-rustdoc-demos/search-lev-distance-2023/std/index.html?search=regex The heuristic is pretty close to the name resolver, maxLevDistance = `Math.floor(queryLen / 3)`. Fixes #103357 Fixes #82131 Similar to https://github.com/rust-lang/rust/pull/103710, but following the suggestion in https://github.com/rust-lang/rust/pull/103710#issuecomment-1296360267 to use `floor` instead of `ceil`, and unblocked now that https://github.com/rust-lang/rust/pull/105796 made it so that setting the max lev distance to `0` doesn't cause substring matches to be removed.
2023-01-30rustdoc: remove unnecessary wrapper div.item-decl from HTMLMichael Howell-20/+19
2023-01-28rustdoc: remove unused class `has-srclink`Michael Howell-5/+5
Stopped being used in CSS with 73d0f7c7b68784f1db0a1f53855c20d118a7e8b0
2023-01-27rustdoc: merge doctest tooltip with notable traits tooltipMichael Howell-122/+100
Fixes https://discord.com/channels/442252698964721669/443150878111694848/1066420140167680000 Fixes #91100
2023-01-27Rollup merge of #107336 - notriddle:notriddle/import-item-module-item, ↵Yuki Okushi-5/+5
r=GuillaumeGomez rustdoc: remove mostly-unused CSS classes `import-item` and `module-item`
2023-01-27Rollup merge of #107242 - notriddle:notriddle/title-ordering, r=GuillaumeGomezYuki Okushi-2/+2
rustdoc: make item links consistently use `title="{shortty} {path}"` The ordering in item tables was flipped in 3030cbea957adbd560bf2eaa34c1b8a56daee16a, making it inconsistent with the ordering in method signatures. Compare these (before this PR is merged): https://github.com/rust-lang/rust/blob/c8e6a9e8b6251bbc8276cb78cabe1998deecbed7/src/librustdoc/html/render/print_item.rs#L455-L459 https://github.com/rust-lang/rust/blob/c8e6a9e8b6251bbc8276cb78cabe1998deecbed7/src/librustdoc/html/format.rs#L903-L908
2023-01-26rustdoc: remove mostly-unused CSS classes import/module-itemMichael Howell-5/+5
2023-01-23rustdoc: simplify settings popover DOMMichael Howell-27/+27
* Changes the class names so that they all start with `setting-`. That should make it harder to accidentally use a setting class outside the settings popover, where loading the CSS might accidentally change the styles of something unrelated. * Get rid of an unnecessary wrapper DIV around the radio button line. * Simplify CSS selectors by making the DOM easier and more intuitive to target.
2023-01-23rustdoc: make item links consistently use `title="{shortty} {path}"`Michael Howell-2/+2
The ordering in item tables was flipped in 3030cbea957adbd560bf2eaa34c1b8a56daee16a, making it inconsistent with the ordering in method signatures. Compare these: https://github.com/rust-lang/rust/blob/c8e6a9e8b6251bbc8276cb78cabe1998deecbed7/src/librustdoc/html/render/print_item.rs#L455-L459 https://github.com/rust-lang/rust/blob/c8e6a9e8b6251bbc8276cb78cabe1998deecbed7/src/librustdoc/html/format.rs#L903-L908
2023-01-21Extend rustdoc GUI test for scraped examples top and bottom "borders"Guillaume Gomez-0/+36
2023-01-21rustdoc: update test case to deal with "coo" only accepting dist=1Michael Howell-2/+14
2023-01-18Rollup merge of #107045 - notriddle:notriddle/settings-css-setting-line, ↵Michael Goulet-0/+7
r=GuillaumeGomez rustdoc: remove redundant CSS rule `#settings .setting-line` Since the current version of settings.js always nests things below a div with ID `settings`, this rule always overrode the one above.
2023-01-18rustdoc: add test case for setting-line margin on settings.htmlMichael Howell-0/+7
2023-01-18rustdoc: fix "?" keyboard command when radio button is focusedMichael Howell-0/+10
This extends the special case with checkbox settings to also cover radios.
2023-01-18rustdoc: put focus on the help link when opening it from keyboardMichael Howell-0/+9
This prevents some strange blur-event-related bugs with the "?" command by ensuring that the focus remains in the same spot when the settings area closes.
2023-01-17rustdoc: add test cases for settings radio button layoutMichael Howell-0/+27
2023-01-17Rollup merge of #106869 - notriddle:notriddle/item-decl-pre-rust, ↵Matthias Krüger-9/+9
r=GuillaumeGomez rustdoc: remove redundant item kind class from `.item-decl > pre` This class originated in the very first commit of `rustdoc_ng`, and was used to add a color border around the item decl based on its kind. https://github.com/rust-lang/rust/blob/4fd061c426902b0904c65e64a3780b21f9ab3afb/src/rustdoc_ng/html/static/main.css#L102-L106 The item decl no longer has a border, and there aren't any kind-specific styles in modern rustdoc's rendering of this UI item. Most of this PR is updating test cases so that they use `item-decl` to find the `<pre>` tag instead of relying on the fact that the class name had `rust {kind}` in it while other `<pre>` tags only had class `rust`.
2023-01-15Rollup merge of #106888 - GuillaumeGomez:tidy-gui-test, r=notriddleMatthias Krüger-0/+2
Add tidy check to ensure that rustdoc GUI tests start with a small description The first commit comes from https://github.com/rust-lang/rust/pull/106865 to prevent CI to fail. This PR adds a tidy check to enforce having a small description at the top of the GUI test. Although the format is made to be as easy as possible to read, it's not always obvious what a test is actually checking. I think enforcing this will make it easier for us to come back on these tests if needed. r? `@notriddle`
2023-01-15Add small description to GUI testGuillaume Gomez-0/+2
2023-01-15Rollup merge of #106865 - GuillaumeGomez:add-gui-test-explanation, r=notriddleMatthias Krüger-0/+2
Add explanation comment for GUI test r? `@notriddle`
2023-01-14rustdoc: remove redundant item kind class from `.item-decl > pre`Michael Howell-9/+9
This class originated in the very first commit of `rustdoc_ng`, and was used to add a color border around the item decl based on its kind. https://github.com/rust-lang/rust/blob/4fd061c426902b0904c65e64a3780b21f9ab3afb/src/rustdoc_ng/html/static/main.css#L102-L106 The item decl no longer has a border, and there aren't any kind-specific styles in modern rustdoc's rendering of this UI item. Most of this commit is updating test cases so that they use `item-decl` to find the `<pre>` tag instead of relying on the fact that the class name had `rust {kind}` in it while other `<pre>` tags only had class `rust`.