summary refs log tree commit diff
path: root/tests/rustdoc-gui
AgeCommit message (Collapse)AuthorLines
2024-07-19Rollup merge of #127932 - notriddle:notriddle/current, r=GuillaumeGomezMatthias Krüger-0/+4
rustdoc: fix `current` class on sidebar modnav | Before | After | | -- | -- | | ![image](https://github.com/user-attachments/assets/35866be8-5a58-41eb-9169-b2bb403fe7cd) | ![image](https://github.com/user-attachments/assets/89b087ea-82bf-49f5-9c87-20162880eb32)
2024-07-18rustdoc: fix `current` class on sidebar modnavMichael Howell-0/+4
2024-07-18Add test for size of items in the items listGuillaume Gomez-1/+6
2024-07-16rustdoc: add test cases for mile wide barMichael Howell-0/+16
2024-07-15rustdoc: make sidebar highlight cover whole click targetMichael Howell-2/+2
2024-07-01rustdoc: click target for sidebar items flush leftMichael Howell-1/+2
2024-06-29Don't call `switch-theme` functionGuillaume Gomez-2/+3
2024-06-29Add back `help-page.goml` rustdoc GUI testGuillaume Gomez-0/+69
2024-06-27Update browser-ui-test version to `0.18.0`Guillaume Gomez-2/+6
2024-06-14Remove failing GUI test to stop blocking CI until it is fixedGuillaume Gomez-69/+0
2024-05-07Rollup merge of #124738 - notriddle:notriddle/search-form-js, r=GuillaumeGomezMatthias Krüger-2/+2
rustdoc: dedup search form HTML This change constructs the search form HTML using JavaScript, instead of plain HTML. It uses a custom element because - the [parser]'s insert algorithm runs the connected callback synchronously, so we won't get layout jank - it requires very little HTML, so it's a real win in size [parser]: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token This shrinks the standard library by about 60MiB, by my test. There should be no visible changes. Just use less disk space.
2024-05-05Add GUI regression test for setting's cog colorGuillaume Gomez-1/+31
2024-05-05Fix bad color for setting cog in ayu themeGuillaume Gomez-0/+1
2024-05-05rustdoc: dedup search form HTMLMichael Howell-2/+2
This change constructs the search form HTML using JavaScript, instead of plain HTML. It uses a custom element because - the [parser]'s insert algorithm runs the connected callback synchronously, so we won't get layout jank - it requires very little HTML, so it's a real win in size [parser]: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token This shrinks the standard library by about 60MiB, by my test.
2024-04-23Rollup merge of #124197 - GuillaumeGomez:move-duplicated-code, r=notriddleMatthias Krüger-119/+89
Move duplicated code in functions in `tests/rustdoc-gui/notable-trait.goml` It also allowed me to add some new common test like: ``` assert-position: ( "//*[`@class='tooltip` popover']", {"x": |popover_x|} ) ``` r? `@notriddle`
2024-04-20Move duplicated code in functions in `tests/rustdoc-gui/notable-trait.goml`Guillaume Gomez-119/+89
2024-04-17Add GUI test for copy path buttonGuillaume Gomez-0/+15
2024-04-09rustdoc: update test casesMichael Howell-4/+4
2024-04-08Make theme switching closer to realityGuillaume Gomez-20/+34
2024-04-06Move `check-container-color`'s code into `check-search-color` functionGuillaume Gomez-31/+19
2024-04-06Move duplicated code into `check-search-color` functionGuillaume Gomez-218/+98
2024-04-06Move more common code into a function in ↵Guillaume Gomez-30/+44
`tests/rustdoc-gui/search-result-color.goml`
2024-04-06Move `search-result-color.goml` common parts into a functionGuillaume Gomez-69/+52
2024-04-05Use `include` command to reduce code duplicationGuillaume Gomez-150/+112
2024-04-04Add regression test to ensure that even if JS is enabled but not working, a ↵Guillaume Gomez-0/+9
theme will still get applied
2024-04-03Add GUI test to ensure there is always a theme applied if JS is disabledGuillaume Gomez-0/+5
2024-04-02Remove redundant code commentsGuillaume Gomez-72/+72
2024-04-01Update to new browser-ui-test versionGuillaume Gomez-248/+266
2024-03-27chore: fix some commentsxiaoxiangxianzi-1/+1
Signed-off-by: xiaoxiangxianzi <zhaoyizheng@outlook.com>
2024-02-22[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives许杰友 Jieyou Xu (Joe)-4/+4
2024-01-31Add regression test for #120471 to ensure that long crate name are handled ↵Guillaume Gomez-2/+24
as expected on mobile
2024-01-22Rollup merge of #119746 - notriddle:notriddle/resize-close-modals, r=fmeaseMatthias Krüger-0/+20
rustdoc: hide modals when resizing the sidebar Follow-up for https://github.com/rust-lang/rust/pull/119477#discussion_r1439085011 CC `@lukas-code`
2024-01-19Rollup merge of #117662 - GuillaumeGomez:links-in-headings, r=notriddleMatthias Krüger-5/+37
[rustdoc] Allows links in headings Reopening of https://github.com/rust-lang/rust/pull/94360. # Explanations Rustdoc currently doesn't follow the markdown spec on headings: we don't allow links in them. So instead of having headings linking to themselves, this PR generates an anchor on the left side like this: ![image](https://github.com/rust-lang/rust/assets/3050060/a118a7e9-5ef8-4d07-914f-46defc3245c3) <details> <summary>previous version</summary> ![image](https://github.com/rust-lang/rust/assets/3050060/c34fa844-9cd4-47dc-bb51-b37f5f66afee) </details> Having the anchor always displayed allows for mobile devices users to be able to have a link to the anchor. The different color used for the anchor itself is the same as links so people notice when looking at it that they can click on it. You can test it [here](https://rustdoc.crud.net/imperio/links-in-headings/std/index.html). cc `@camelid` r? `@notriddle`
2024-01-08rustdoc: hide modals when resizing the sidebarMichael Howell-0/+20
Follow-up for https://github.com/rust-lang/rust/pull/119477#discussion_r1439085011
2023-12-31rustdoc ui: adjust tooltip z-index to be above sidebarLukas Markeffsky-0/+12
2023-12-31Auto merge of #119066 - notriddle:notriddle/sidebar-source-redesign, ↵bors-92/+60
r=GuillaumeGomez rustdoc: clean up source sidebar hide button This is a redesign of the feature, with parts pulled from https://github.com/rust-lang/rust/pull/119049 but with a button that looks more like a button and matches the one used on other sidebar pages. Preview: * http://notriddle.com/rustdoc-html-demo-8/source-sidebar-resize/src/std/lib.rs.html * http://notriddle.com/rustdoc-html-demo-8/source-sidebar-resize/std/index.html | | Before | After | |--|--|--| | Closed | ![image](https://github.com/rust-lang/rust/assets/1593513/092bed75-79c3-412f-8e7b-557f30dfb1e3) | ![image](https://github.com/rust-lang/rust/assets/1593513/b68e1ee9-9aef-484d-a5b1-2fd29c9d72ea) | Open | ![image](https://github.com/rust-lang/rust/assets/1593513/95cf9545-25b1-48ec-820b-02e1aec99839) | ![image](https://github.com/rust-lang/rust/assets/1593513/923532f6-59e0-4d7c-9976-21699c30d42e) | Mobile Closed | ![image](https://github.com/rust-lang/rust/assets/1593513/9bc00cc5-937c-4120-94be-94c7cb6d5297) | ![image](https://github.com/rust-lang/rust/assets/1593513/76a744d8-aac2-46fe-abb9-3b34e2d3ccaa) | Mobile Open | ![image](https://github.com/rust-lang/rust/assets/1593513/d19a94fe-47b1-462d-a280-44fc215b9b72) | ![image](https://github.com/rust-lang/rust/assets/1593513/2b2e3dec-b610-4b12-8a72-35b86359ba45)
2023-12-26rustdoc: treat query string `+` as spaceMichael Howell-0/+9
Fixes #119219
2023-12-24Add GUI regression test for position of warning blockGuillaume Gomez-0/+16
2023-12-19Fix corner cases when dealing with mobile modeMichael Howell-0/+29
2023-12-18Use folder icon instead of hamburger and sidebarMichael Howell-3/+6
2023-12-18Stop using the trigram of heaven as a hamburger buttonMichael Howell-2/+2
It doesn't look quite right, because the lines are too far apart, and it's not going to be announced by screenreaders as a menu button, since that's not what the symbol means. This adds a real tooltip and uses a better drawing of the icon.
2023-12-18Add back the columnMichael Howell-45/+16
2023-12-17rustdoc: clean up source sidebar hide buttonMichael Howell-54/+19
This is a redesign of the feature, with parts pulled from https://github.com/rust-lang/rust/pull/119049 but with a button that looks more like a button and matches the one used on other sidebar pages.
2023-12-15Rollup merge of #118988 - notriddle:notriddle/varconst, r=GuillaumeGomezMatthias Krüger-0/+24
rustdoc: add regression test for JS data file loading Follow up for #118961
2023-12-15rustdoc: add regression test for JS data file loadingMichael Howell-0/+24
Follow up for #118961
2023-12-15Rollup merge of #115660 - notriddle:notriddle/sidebar-resize, r=GuillaumeGomezGuillaume Gomez-7/+118
rustdoc: allow resizing the sidebar / hiding the top bar Fixes #97306 Preview: http://notriddle.com/rustdoc-html-demo-4/sidebar-resize/std/index.html ![image](https://github.com/rust-lang/rust/assets/1593513/a2f40ea2-0436-4e44-99e8-d160dab2a680) ## Summary This feature adds: 1. A checkbox to the Settings popover to hide the persistent navigation bar (the sidebar on large viewports and the top bar on small ones). 2. On large viewports, it adds a resize handle to the persistent sidebar. Resizing it into nothing is equivalent to turning off the persistent navigation bar checkbox in Settings. 3. If the navigation bar is hidden, a toolbar button to the left of the search appears. Clicking it brings the navigation bar back. ## Motivation While "mobile mode" is definitely a good default, it's not the only reason people have wanted to hide the sidebar: * Some people use tiling window managers, and don't like rustdoc's current breakpoints. Changing the breakpoints might help with that, but there's no perfect solution, because there's a gap between "huge screen" and "smartphone" where reasonable people can disagree about whether it makes sense for the sidebar to be on-screen. https://github.com/rust-lang/rust/issues/97306 * Some people ask for ways to reduce on-screen clutter because it makes it easier to focus. There's not a media query for that (and if there was, privacy-conscious users would turn it off). https://github.com/rust-lang/rust/issues/59829 This feature is designed to avoid these problems. Resizing the sidebar especially helps, because it provides a way to hide the sidebar without adding a new top-level button (which would add clutter), and it provides a way to make rustdoc play nicer in complex, custom screen layouts. ## Guide and Reference-level explanation On a desktop or laptop with a mouse, resize the sidebar by dragging its right edge. On any browser, including mobile phones, the sticky top bar or side bar can be hidden from the Settings area (the button with the cog wheel, next to the search bar). When it's hidden, a convenient button will appear on the search bar's left. ## Drawbacks This adds more JavaScript code to the render blocking area. ## Rationale and alternatives The most obvious way to allow people to hide the sidebar would have been to let them "manually enter mobile mode." The upside is that it's a feature we already have. The downside is that it's actually really hard to come up with a terse description. Is it: * A Setting that forces desktop viewers to always have the mobile-style top bar? If so, how do we label it? Should it be visible on mobile, and, if so, does it just not do anything? * A persistent hide/show sidebar button, present on desktop, just like on mobile? That's clutter that I'd like to avoid. ## Prior art * The new file browser in GitHub uses a similar divider with a mouse-over indicator * mdBook and macOS Finder both allow you to resize the sidebar to nothing as a gesture to hide it * https://www.nngroup.com/articles/drag-drop/ ## Future possibilities https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Table.20of.20contents proposes a new, second sidebar (a table of contents). How should it fit in with this feature? Should it be resizeable? Hideable? Can it be accessed on mobile?
2023-12-07Extend GUI tests for `doc_cfg`Guillaume Gomez-0/+31
2023-12-05Add tests for headings anchor and links in headingsGuillaume Gomez-4/+36
2023-12-05Update rustdoc headings testsGuillaume Gomez-1/+1
2023-12-01Add GUI tests for comments highlighting in items declarationGuillaume Gomez-1/+118