about summary refs log tree commit diff
path: root/src/test/rustdoc-gui
AgeCommit message (Collapse)AuthorLines
2022-09-30Rollup merge of #102491 - notriddle:notriddle/sidebar-opacity, r=GuillaumeGomezMatthias Krüger-11/+8
rustdoc: remove no-op source sidebar `opacity` These rules were added in dc2c9723343c985740be09919236a6e96c4e4433 to work with CSS transitions. They're otherwise redundant, since the `visibility` property already hides everything. https://github.com/rust-lang/rust/blob/dc2c9723343c985740be09919236a6e96c4e4433/src/librustdoc/html/static/css/rustdoc.css#L350-L354 The transition was remove with 237d62588ddb4b7a93f3f5c61ea9253eba30ed5d, but the now-redundant `opacity` property was not.
2022-09-29rustdoc: update test case now that the UI animation is removedMichael Howell-11/+8
2022-09-28rustdoc: remove bad CSS font-weight on `.impl`, `.method`, etcMichael Howell-7/+7
This line was added in c494a06064017f307a8d9dc4797e614d2ed99143, because at the time, the headers had these classes on them. Now, the headers are children of the `<section>` with the class on it. This commit also adds a test case, to make sure the srclink font weight does not regress again.
2022-09-27Rollup merge of #102369 - GuillaumeGomez:results-colors, r=notriddleMatthias Krüger-4/+152
Fix search result colors Fixes regression introduced in https://github.com/rust-lang/rust/commit/99c00714cff0d13b6c5092c9949cb4e93a121346. As you can see, ayu lost some colors for its search results: beta/nightly: ![Screenshot from 2022-09-27 19-46-49](https://user-images.githubusercontent.com/3050060/192606456-e7bb58dd-cf76-49a0-b1ae-28565adb1dc6.png) stable: ![Screenshot from 2022-09-27 19-46-36](https://user-images.githubusercontent.com/3050060/192606453-e720e219-a336-4ff1-989b-2fdb76e789eb.png) We'll need to backport it to beta too to prevent it reaching stable. r? `@notriddle`
2022-09-27Add GUI regression test for search results colorsGuillaume Gomez-4/+152
2022-09-27Update src/test/rustdoc-gui/sidebar-mobile-scroll.gomlJacob Hoffman-Andrews-3/+3
Co-authored-by: Michael Howell <michael@notriddle.com>
2022-09-27rustdoc: use CSS containment to speed up renderJacob Hoffman-Andrews-3/+3
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Containment This affected layout a little and required adjustments to the CSS to keep spacing the same. In particular, the margins of adjacent items usually overlap with each other. However, when an item has contain: layout, any margins of child nodes push out the size of the item itself. This was making spacing between items a little too big. To solve that, I removed margins in some places: in particular for certain classes that often occur at the end of a `details.rustdoc-toggle` block, I removed their bottom margin. Generally, the margins provided by the next item down are sufficient. Also remove an unnecessary margin-top on .code-header.
2022-09-26rustdoc: give `.line-number` / `.line-numbers` meaningful namesMichael Howell-15/+15
2022-09-25Round offset to whole integerMichael Howell-2/+2
2022-09-25rustdoc: clean up `.out-of-band`/`.in-band` CSSMichael Howell-8/+8
* Remove the `float: right` fallback from the main header, which hasn't been needed since IE11 support was dropped. * Remove `in-band` from low-level headers, which hasn't been needed since `.rightside` switched to `float: right` in 593d6d1cb15c55c88319470dabb40126c7b7f1e2 * Remove unreachable `.in-band > code, .in-band > .code-header` CSS, since the `in-band` class was attached to the `code-header` itself, not nested directly below it. * Use `rem` instead of `em` for code header margins. * This results in a slight change in spacing around impls and item-info, but since it makes it more consistent with the way methods are presented, it's probably fine.
2022-09-24Rollup merge of #102199 - GuillaumeGomez:improve-rustdoc-gui-tests, r=notriddleMatthias Krüger-5/+11
Improve rustdoc GUI tests I finally finished the update so we can now store values in variables and use them. It improves things nicely. r? ``@notriddle``
2022-09-23rustdoc: fix GUI tests to deal with slightly changed widthMichael Howell-12/+12
2022-09-23Improve GUI tests by using variablesGuillaume Gomez-5/+11
2022-09-23rustdoc: add regression test for sidebar width jankMichael Howell-0/+15
2022-09-23Auto merge of #102165 - matthiaskrgr:rollup-n5oquhe, r=matthiaskrgrbors-1/+1
Rollup of 8 pull requests Successful merges: - #100734 (Split out async_fn_in_trait into a separate feature) - #101664 (Note if mismatched types have a similar name) - #101815 (Migrated the rustc_passes annotation without effect diagnostic infrastructure) - #102042 (Distribute rust-docs-json via rustup.) - #102066 (rustdoc: remove unnecessary `max-width` on headers) - #102095 (Deduplicate two functions that would soon have been three) - #102104 (Set 'exec-env:RUST_BACKTRACE=0' in const-eval-select tests) - #102112 (Allow full relro on powerpc64-unknown-linux-gnu) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-09-23Rollup merge of #102066 - notriddle:notriddle/headers-max-width, ↵Matthias Krüger-1/+1
r=GuillaumeGomez rustdoc: remove unnecessary `max-width` on headers This code was added in 003b2bc1c65251ec2fc80b78ed91c43fb35402ec to prevent these headers from overlapping `.out-of-band` side items. That stopped being a problem when 3f92ff34b5a2fe8dd1a32aa27d437519e63782f0 switched rustdoc over to using `float`, rather than `position: absolute`, to implement this.
2022-09-22Rollup merge of #102118 - notriddle:notriddle/line-numbers, r=GuillaumeGomezMatthias Krüger-1/+18
rustdoc: clean up line numbers on code examples * First commit switches from `display: inline-flex; width: 100%` to `display: flex`. `display: inline-flex` was used as part of https://github.com/rust-lang/rust/commit/e961d397cab900c55f8d8c104648852e2b63664e, the original commit that added these line numbers. Does anyone know why it was done this way? * Second commit makes it so that toggling this checkbox will update the page in real time, just like changing themes does. Preview: https://notriddle.com/notriddle-rustdoc-test/line-numbers/std/vec/struct.Vec.html
2022-09-21rustdoc: update test case for headers without max-widthMichael Howell-1/+1
2022-09-22Rollup merge of #102100 - GuillaumeGomez:stab-in-docblocks, r=notriddleYuki Okushi-0/+39
Prevent usage of .stab elements to create scrollable areas in doc blocks Fixes #101874. You can test it online [here](https://rustdoc.crud.net/imperio/stab-in-doblocks/foo/index.html). r? `@notriddle`
2022-09-21rustdoc: adjust test to cope with slightly different scrolling behaviourMichael Howell-1/+1
2022-09-21rustdoc: dynamically show-hide line numbers on code examplesMichael Howell-0/+17
2022-09-21Add GUI test for `.stab` elements in docblocksGuillaume Gomez-0/+39
2022-09-20Rollup merge of #102034 - notriddle:notriddle/border-bottom, r=GuillaumeGomezMichael Howell-13/+13
rustdoc: remove no-op CSS `h1-6 { border-bottom-color }` For this rule to have an actual effect, the border-bottom width needs specified, elsewhere, without also specifying the color. This doesn't happen. Ever since 88b137d5fe0cbe28dab4f9af61045c726f831872, every spot where headers get a border assigned to them also assigns the color. Preview: https://notriddle.com/notriddle-rustdoc-test/border-bottom/rustc_monomorphize/collector/index.html
2022-09-20Rollup merge of #102027 - notriddle:notriddle/docblock-item-decl, ↵Michael Howell-7/+7
r=GuillaumeGomez rustdoc: remove `docblock` class from `item-decl` This class was originally added in 73b97c7e7c9cfac4dfa4804654b1db6ab687b589 to support hiding and showing the item, because `main.js` went through all `docblock` elements in the DOM and added toggles to them. https://github.com/rust-lang/rust/blob/73b97c7e7c9cfac4dfa4804654b1db6ab687b589/src/librustdoc/html/static/main.js#L1856-L1867 The `item-decl` is no longer auto-hidden since c96f86de3026f864e78397aff9097e885f2f8fdf removed it. `item-decl` used to be called `type-decl`: that name was changed in 8b7a2dd4626acf164e1ce8397878b3f5af83d585. The `docblock` class is no longer used for implementing toggles, since rustdoc switched to using `<details>` elements. Preview: https://notriddle.com/notriddle-rustdoc-test/docblock-item-decl/rustdoc/clean/types/enum.Type.html
2022-09-19Remove useless color assertions on 0px bordersMichael Howell-13/+13
2022-09-19rustdoc: update test cases for changed item-decl HTMLMichael Howell-7/+7
2022-09-19Add GUI test for notable traits element positionGuillaume Gomez-0/+103
2022-09-16Add GUI test for links colorsGuillaume Gomez-0/+85
2022-09-15Rollup merge of #101778 - notriddle:notriddle/docblock-short-p, r=GuillaumeGomezMatthias Krüger-15/+3
rustdoc: clean up DOM by removing `.dockblock-short p` On https://doc.rust-lang.org/nightly/std/ this reduces the number out of `document.querySelectorAll("*").length` from 1278 to 1103. Preview: https://notriddle.com/notriddle-rustdoc-test/docblock-short-p/std/index.html
2022-09-13rustdoc: clean up DOM by removing `.dockblock-short p`Michael Howell-15/+3
On https://doc.rust-lang.org/nightly/std/ this reduces the number out of `document.querySelectorAll("*").length` from 1278 to 1103.
2022-09-12rustdoc: remove no-op CSS `.search-results .result-name > span`Michael Howell-0/+3
The rule `display: inline-block` was added in 5afa52bc7dee683f25f437dddf338dbc6ad32eb8. The `margin: 0` and `font-weight: normal` were added in c01bd560e2f87a9a960ed071213edd70f73171a8. Both seem to have been added to override class-based rules that were targetted at method sections. See <https://github.com/rust-lang/rust/blob/c01bd560e2f87a9a960ed071213edd70f73171a8/src/librustdoc/html/static/rustdoc.css#L140-L148> for an example. The selectors that these were meant to override were changed in a8318e420d19c364b1eec33956a86164941f6df4 and 76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30 to be more specific, so they no longer need to be overridden.
2022-09-12Rollup merge of #101693 - GuillaumeGomez:update-browser-ui-test-0-10, ↵Dylan DPC-12/+15
r=notriddle Update browser UI test 0 10 The biggest change from this browser-ui-test update is the upgrade of the puppeteer version to `17.1.3` (the latest in short). I also added the command `click-with-offset` to still allow us to click on the `[-]` part. cc `@jsha` r? `@notriddle`
2022-09-11Update tests for new browser-ui-test versionGuillaume Gomez-12/+15
2022-09-10Auto merge of #101613 - GuillaumeGomez:codeblock-tooltip, r=notriddlebors-50/+50
Simplify codeblock and their associated tooltip It is based on https://github.com/rust-lang/rust/pull/101600 so it needs to wait for this one to be merged first. This PR does two things: * Remove CSS class duplication by setting CSS classes such as `compile_fail` directly on the `div` wrapping both the codeblock and the tooltip. * Simplify DOM: no need to wrap the tooltip into a `<div>`, it can work just as well without it. You can test it [here](https://rustdoc.crud.net/imperio/codeblock-tooltip/std/string/struct.String.html#deref). r? `@notriddle`
2022-09-10Update rustdoc GUI testsGuillaume Gomez-50/+50
2022-09-10Rollup merge of #101624 - notriddle:notriddle/search, r=GuillaumeGomezMatthias Krüger-2/+2
rustdoc: remove unused CSS `#search { position: relative }` This was added in 611d0e6ccef8b60fa86ff5aa8fe3571cd36c444a, to allow its child `#results` element to be absolutely positioned inside it. The child stopped being absolute in 8c0469552e879f6319f8f96db660bab9eae1de5c. To keep the layout looking the same, the links need to not have `width: 100%` any more, relying instead on the box naturally growing to fit because it has `display: block`.
2022-09-09rustdoc: update test casesMichael Howell-2/+2
Width changed by 2/4 pixels by b273c7502e363baeec293b972f671070e80f1391
2022-09-09rustdoc: simplify the codeblock tooltipMichael Howell-23/+23
This commit moves the tooltip into example-wrap, simplifying allowing several overly-complex things to be fixed: * The mousover javascript can be removed, because hovering example-wrap can style the tooltip inside. * The sibling selecor can be removed, because hovering the tooltip also hovers the wrapper, which can hover the codeblock itself. * The relative positioning of the `<li>` tag, which was added in e861efd9f9ca45c1048a256812dfe8faffbb1367 to fix the positioning of the code tooltip, can now be removed, because example-wrap itself already has relative positioning.
2022-09-09Add gui test for codeblocks tooltip colorsGuillaume Gomez-0/+96
2022-09-09Clean up themes a bit moreGuillaume Gomez-2/+8
2022-09-04Remove duplicated test (superseeded by search-form-elements.goml)Guillaume Gomez-22/+0
2022-09-03Rollup merge of #101335 - notriddle:notriddle/methods-stability, r=notriddleMatthias Krüger-0/+20
rustdoc: remove old CSS selector that causes weird spacing It was added with e08a84a0c18739417a50c3e46917ced5037244eb (actually, it was called `.methods > .stability` at the time) and was directly nested that way. **EDIT**: It is technically reachable code still, but it seems wrong. ## With the old CSS rule still present https://notriddle.com/notriddle-rustdoc-test/weird-spacing/lib/struct.Foo.html ![image](https://user-images.githubusercontent.com/1593513/188216226-c667c560-d33d-494f-a492-4e0ec3ac0009.png) ## Version 2 (an older version of this PR) https://notriddle.com/notriddle-rustdoc-test/normal-spacing-2/lib/struct.Foo.html ![image](https://user-images.githubusercontent.com/1593513/188216418-9fcd3109-f1b2-425d-b4fc-0c6b3b54e48e.png) ## Version 3 (with alignment fix for mobile) https://notriddle.com/notriddle-rustdoc-test/normal-spacing-3/lib/struct.Foo.html ![image](https://user-images.githubusercontent.com/1593513/188223161-0e1ebce7-842f-41cb-8a0c-ae43aedcfccc.png)
2022-09-03Update rustdoc-gui tests for search-input border color on dark themeGuillaume Gomez-2/+2
2022-09-02rustdoc: put in rule to get alignment in desktop and mobile layoutsMichael Howell-0/+20
2022-09-01Rollup merge of #101245 - GuillaumeGomez:remove-unneeded-where-whitespace, ↵Matthias Krüger-0/+54
r=notriddle Remove unneeded where whitespace It fixes these two bugs: ![Screenshot from 2022-08-31 18-14-40](https://user-images.githubusercontent.com/3050060/187727950-94657419-abfa-454c-9d27-004280fbcb45.png) ![Screenshot from 2022-08-31 18-14-49](https://user-images.githubusercontent.com/3050060/187727956-21d1b39d-62d7-4e7b-8f6f-631ceda67a19.png) It's a relic from a very old time (this commit: https://github.com/rust-lang/rust/commit/bfd01b7f40ae2cbfe9acbc1d10e79ffe16870df8). You can test the result [here](https://rustdoc.crud.net/imperio/remove-unneeded-where-whitespace/lib2/struct.WhereWhitespace.html). cc `````````@jsha````````` r? `````````@notriddle`````````
2022-09-01Auto merge of #100606 - cuviper:upgrade-linux-ci, r=Mark-Simulacrumbors-2/+2
ci: Upgrade non-dist Linux testers from ubuntu:16.04 to 22.04 The main goal of updating to 22.04 is to get away from `llvm.allow-old-toolchain`. A side benefit is that they can also use the system `cmake` instead of building one.
2022-08-31Add rustdoc GUI testGuillaume Gomez-0/+27
2022-08-31Update rustdoc testsGuillaume Gomez-0/+27
2022-08-31Rollup merge of #100804 - GuillaumeGomez:search-results-color-ayu, r=notriddleYuki Okushi-0/+51
Fix search results color on hover for ayu theme Before: ![image](https://user-images.githubusercontent.com/3050060/185747851-038d2333-8b01-44a8-a104-ceb7410ac089.png) After: ![image](https://user-images.githubusercontent.com/3050060/185747869-53b502f5-5800-470f-b897-2683f1cdb7ee.png) You can test it [here](https://rustdoc.crud.net/imperio/search-results-color-ayu/foo/index.html?search=item). r? ``@jsha``
2022-08-27Rollup merge of #101046 - notriddle:notriddle/table-css, r=jshaYuki Okushi-0/+30
rustdoc: remove incorrect CSS selector `.impl-items table td` Fixes #100994 This selector was added in c7312fbae4979c6d4fdfbd1f55a71cd47d82a480. The bug can be seen at <https://doc.rust-lang.org/1.27.0/alloc/slice/trait.SliceIndex.html#foreign-impls>. This rule was added to help with a `<table>` that was used for displaying the function signature [src] lockup. That lockup was changed in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to use flexbox instead, leaving this selector unused (at least, for its original purpose).