Commit Graph

116 Commits

Author SHA1 Message Date
Matthias Krüger a1c0a28012 Rollup merge of #113228 - GuillaumeGomez:migrate-gui-test-color-18, r=notriddle
Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? ``@notriddle``
2023-07-02 10:27:20 +02:00
Guillaume Gomez 147617bb09 Migrate GUI colors test to original CSS color format 2023-07-01 13:18:28 +02:00
Guillaume Gomez 6c7374e26b Improve search-result-display.goml test 2023-06-30 11:45:42 +02:00
Guillaume Gomez 1a5fb80d2e Update GUI tests 2023-06-28 11:21:57 +02:00
Matthias Krüger c478767675 Rollup merge of #113023 - GuillaumeGomez:migrate-gui-test-color-17, r=notriddle
Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? `@notriddle`
2023-06-25 13:48:37 +02:00
Guillaume Gomez c741fe62a2 Migrate GUI colors test to original CSS color format 2023-06-25 10:49:28 +02:00
Matthias Krüger 7941c5aa92 Rollup merge of #112937 - camelid:align-typenames, r=notriddle,GuillaumeGomez
rustdoc: Align search results horizontally for easy scanning

The recent PR #110688 added info about an item's kind before its name in
search results. However, because the kind and name are inline with no
alignment, it's now hard to visually scan downward through the search
results, looking at item names. This PR fixes that by horizontally
aligning search results such that there are now two columns of
information.

r? `@GuillaumeGomez`
2023-06-25 02:04:20 +02:00
Noah Lev 2535eac8b6 rustdoc: Update GUI test 2023-06-24 14:30:35 -07:00
Guillaume Gomez 63aba49583 Migrate GUI colors test to original CSS color format 2023-06-24 14:47:16 +02:00
Matthias Krüger 8ee2ee45d0 Rollup merge of #112962 - GuillaumeGomez:fix-rustdoc-gui-tester, r=ozkanonur
Fix rustdoc gui tester

Problem was that the `main` was always exiting with `0`, whether or not there was an error. It led to failing GUI tests being ignored in the CI since no one saw them.

r? ````@klensy````
2023-06-23 19:40:01 +02:00
Guillaume Gomez e263c286b0 Fix GUI test for popover 2023-06-23 19:34:37 +02:00
Guillaume Gomez 8b5c47d133 Fix failing rustdoc GUI test 2023-06-23 15:50:30 +02:00
Guillaume Gomez 3e98b050ef Rollup merge of #112894 - GuillaumeGomez:gui-fields-display, r=notriddle
Fix union fields display

![Screenshot from 2023-06-21 16-47-24](https://github.com/rust-lang/rust/assets/3050060/833b0fe6-7fb6-4371-86c3-d82fa0c3fe49)

So two bugs in this screenshot: no whitespace between field name and type name, both fields are on the same line. Both problems come from issues in the templates because all whitespace are removed if a askama "command" follows.

r? `@notriddle`
2023-06-21 20:00:51 +02:00
Guillaume Gomez 6246810e4d Add test to prevent regression for fields display 2023-06-21 17:42:53 +02:00
Alexis (Poliorcetics) Bourget c84f1cdcc0 tests: add test for color of item kind 2023-06-20 08:28:56 +02:00
Matthias Krüger 94e090b43d Rollup merge of #112707 - GuillaumeGomez:back-in-history-fix, r=notriddle
[rustdoc] Fix invalid handling of "going back in history" when "go to only search result" setting is enabled

You can test the fix [here](https://rustdoc.crud.net/imperio/back-in-history-fix/lib2/index.html). Enable "Directly go to item in search if there is only one result", then search for `HasALongTraitWithParams` and finally go back to previous page. It should be back on the `index.html` page.

The reason for this bug is that the JS state is cached as is, so when we go back to the page, it resumes where it was left, somewhat (very weird), meaning the search is run again etc. The best way to handle this is to force the JS re-execution in this case so that it doesn't try to resume from where it left and then lead us back to the current page.

r? ``@notriddle``
2023-06-17 12:43:31 +02:00
Guillaume Gomez 4885f4524c Add regression test for #112676 2023-06-16 20:41:00 +02:00
bors 7474429d4b Auto merge of #110688 - GuillaumeGomez:result-search-type, r=notriddle,jsha
rustdoc: Add search result item types after their name

Here what it looks like:

![Screenshot from 2023-04-22 15-16-58](https://user-images.githubusercontent.com/3050060/233789566-b5f3f625-3b78-4c56-a7ee-0a4f2d62e667.png)

The idea is to improve accessibility by providing this information directly in the text and not only in the text color. Currently we already use it for doc aliases and for primitive types, so I extended it to all types.

r? `@notriddle`
2023-06-16 15:02:22 +00:00
Matthias Krüger 4da6ed6eb8 Rollup merge of #112613 - GuillaumeGomez:fix-gui-test-windows, r=notriddle
Fix rustdoc-gui tests on Windows

The browser-ui-test update contains fixes needed for backslash handling (they were not correctly escaped).

Since we have a mix of slash and backslash in some tests, I replaced `DOC_FOLDER` variable backslashes with slashes.

And finally it seemed like the unicode escaped wasn't much appreciated on Windows for some reason so I used the character directly.

cc `@klensy`
r? `@notriddle`
2023-06-14 18:10:32 +02:00
Guillaume Gomez bebbc61016 Fix href attribute value check on Windows (DOC_PATH lacks an extra /) 2023-06-14 16:23:05 +02:00
Guillaume Gomez e6dcd5aaa2 Replace unicode value with character in shortcuts.goml test 2023-06-14 10:37:56 +02:00
Guillaume Gomez 6153b7f17b Migrate GUI colors test to original CSS color format 2023-06-11 14:40:12 +02:00
Guillaume Gomez d0774dd1c0 Migrate GUI colors test to original CSS color format 2023-06-10 14:38:08 +02:00
Guillaume Gomez 46f94511b3 Migrate GUI colors test to original CSS color format 2023-06-07 17:42:04 +02:00
Guillaume Gomez c54e0cf192 Migrate GUI colors test to original CSS color format 2023-06-04 15:55:30 +02:00
Guillaume Gomez ba894b5175 Move type name directly into the same DOM element 2023-06-03 16:37:43 +02:00
Guillaume Gomez 839bc6077d Move item kind before the item name 2023-06-02 23:56:10 +02:00
Guillaume Gomez fbdb598c85 Update rustdoc tests and add more checks for type kind colors 2023-06-02 23:56:10 +02:00
Matthias Krüger 916f4a189a Rollup merge of #112133 - GuillaumeGomez:migrate-gui-test-color-10, r=notriddle
Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? ```@notriddle```
2023-06-01 22:47:31 +02:00
Dylan DPC 4867930589 Rollup merge of #111892 - notriddle:notriddle/timeout-tooltip, r=me,GuillaumeGomez,Manishearth
rustdoc: add interaction delays for tooltip popovers

Preview:

* [notable traits](http://notriddle.com/rustdoc-demo-html-3/delay-tooltip/testing/struct.Vec.html#method.iter)
* [panicking code block](http://notriddle.com/rustdoc-demo-html-3/delay-tooltip/testing/struct.Vec.html#indexing)

Designing a good hover microinteraction is a matter of guessing user intent from what are, literally, vague gestures. In this case, guessing if hovering in our out of the tooltip base is intentional or not.

To figure this out, a few different techniques are used:

* When the mouse pointer enters a tooltip anchor point, its hitbox is grown on the bottom, where the popover is/will appear. This was already there before this commit: search "hover tunnel" in rustdoc.css for the implementation.

* This commit adds a delay when the mouse pointer enters the base anchor, in case the mouse pointer was just passing through and the user didn't want to open it.

* This commit also adds a delay when the mouse pointer exits the tooltip's base anchor or its popover, before hiding it.

* A fade-out animation is layered onto the pointer exit delay to immediately inform the user that they successfully dismissed the popover, while still providing a way for them to cancel it if it was a mistake and they still wanted to interact with it.

* No animation is used for revealing it, because we don't want people to try to interact with an element while it's in the middle of fading in: either they're allowed to interact with it while it's fading in, meaning it can't serve as mistake- proofing for opening the popover, or they can't, but they might try and be frustrated.

See also:

* https://www.nngroup.com/articles/timing-exposing-content/
* https://www.nngroup.com/articles/tooltip-guidelines/
* https://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown
2023-06-01 11:09:43 +05:30
Guillaume Gomez 63bfa40f4d Migrate GUI colors test to original CSS color format 2023-05-31 13:03:46 +02:00
Nilstrieb 2af690d371 Rollup merge of #112064 - GuillaumeGomez:migrate-gui-test-color-9, r=notriddle
Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

The `browser-ui-test` update is a fix when converting the alpha value to hex format. More information [here](https://github.com/GuillaumeGomez/browser-UI-test/pull/511).

r? ````@notriddle````
2023-05-30 12:57:40 +02:00
Guillaume Gomez a9a2fcf696 Migrate GUI colors test to original CSS color format 2023-05-29 16:03:56 +02:00
Matthias Krüger 951b2f8aaa Rollup merge of #112042 - GuillaumeGomez:migrate-gui-test-color-8, r=notriddle
Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? `@notriddle`
2023-05-29 04:03:03 +02:00
Guillaume Gomez 450e1da20f Migrate GUI colors test to original CSS color format 2023-05-28 18:47:29 +02:00
bors bf3783f3fb Auto merge of #111348 - ozkanonur:remove-hardcoded-rustdoc-flags, r=albertlarsan68,oli-obk
new tool `rustdoc-gui-test`

Implements new tool `rustdoc-gui-test` that allows using compiletest headers for `rustdoc-gui` tests.
2023-05-27 04:20:44 +00:00
Guillaume Gomez da1744a96c Migrate GUI colors test to original CSS color format 2023-05-25 14:32:00 +02:00
Guillaume Gomez e62b4d85b1 Migrate GUI colors test to original CSS color format 2023-05-24 14:41:18 +02:00
Michael Howell a00ca8932d rustdoc: add hover indicator for notable trait tooltip 2023-05-23 17:19:35 -07:00
Michael Howell bab99ff402 rustdoc: add interaction delays for tooltip popovers
Designing a good hover microinteraction is a matter of guessing
user intent from what are, literally, vague gestures. In this case,
guessing if hovering in our out of the tooltip base is intentional
or not.

To figure this out, a few different techniques are used:

* When the mouse pointer enters a tooltip anchor point, its hitbox
  is grown on the bottom, where the popover is/will appear. This was
  already there before this commit: search "hover tunnel" in
  rustdoc.css for the implementation.

* This commit adds a delay when the mouse pointer enters the base
  anchor, in case the mouse pointer was just passing through and the
  user didn't want to open it.

* This commit also adds a delay when the mouse pointer exits the
  tooltip's base anchor or its popover, before hiding it.

* A fade-out animation is layered onto the pointer exit delay to
  immediately inform the user that they successfully dismissed the
  popover, while still providing a way for them to cancel it if
  it was a mistake and they still wanted to interact with it.

* No animation is used for revealing it, because we don't want
  people to try to interact with an element while it's in the
  middle of fading in: either they're allowed to interact with
  it while it's fading in, meaning it can't serve as mistake-
  proofing for opening the popover, or they can't, but they
  might try and be frustrated.

See also:

* https://www.nngroup.com/articles/timing-exposing-content/
* https://www.nngroup.com/articles/tooltip-guidelines/
* https://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown
2023-05-23 15:56:40 -07:00
Matthias Krüger edf955e5f6 Rollup merge of #111871 - GuillaumeGomez:migrate-gui-test-color-5, r=notriddle
Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? `@notriddle`
2023-05-23 19:53:43 +02:00
Guillaume Gomez 6ed585fa60 Migrate GUI colors test to original CSS color format 2023-05-23 15:26:59 +02:00
Michael Howell a1489eeb85 rustdoc: remove unneeded position: relative setting CSS
This was added to control percentage sizes, in
f1b5607a5c

Now, the only percentage size is [`border-radius`], which is
based on the size of the box itself, not its containing block.
This leaves the property unused.

[`border-radius`]: https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius
2023-05-22 16:46:29 -07:00
Dylan DPC 723318470c Rollup merge of #111844 - GuillaumeGomez:migrate-gui-test-color-4, r=notriddle
Migrate GUI colors test to original CSS color format

I updated the `browser-ui-test` version because I fixed https://github.com/GuillaumeGomez/browser-UI-test/issues/507. If inside a function, the colors were not considered, preventing the second commit of this PR.

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? `@notriddle`
2023-05-23 00:32:20 +05:30
Guillaume Gomez dbdb28724f Migrate GUI colors test to original CSS color format 2023-05-22 17:34:48 +02:00
Matthias Krüger 734dbc1f9a Rollup merge of #111817 - GuillaumeGomez:migrate-gui-test-color-3, r=notriddle
Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? `@notriddle`
2023-05-21 16:03:01 +02:00
Matthias Krüger 29c2c66223 Rollup merge of #111797 - GuillaumeGomez:migrate-gui-test-color-2, r=notriddle
Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? ``@notriddle``
2023-05-21 16:03:00 +02:00
Guillaume Gomez 19847fa53e Migrate GUI colors test to original CSS color format 2023-05-21 13:10:03 +02:00
Guillaume Gomez 915701e7f5 Rollup merge of #111765 - GuillaumeGomez:migrate-gui-test-color, r=notriddle
Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? `@notriddle`
2023-05-20 15:37:24 +02:00
Guillaume Gomez 6287ff51bf Migrate GUI colors test to original CSS color format 2023-05-20 15:35:52 +02:00