| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
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
|
|
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.
|
|
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.
|
|
rustdoc: avoid including line numbers in Google SERP snippets

|
|
|
|
|
|
improve UX
|
|
This is based on the compatibility data for `window.matchMedia` and
`MediaQueryList`'s `EventTarget` implementation.
https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList#browser_compatibility
https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia#browser_compatibility
* EventTarget would require us to drop support for all Chrome
versions before 39. However, we already require Chrome 49,
because rustdoc requires [CSS variables].
* EventTarget would also limit us to Firefox 55, but since #106502
rustdoc only supports Firefox > 68.
* EventTarget limits us to Mobile Safari version 14, but #102404
shows that our CSS is broken in Safari versions before 15.5.
[CSS variables]: https://developer.mozilla.org/en-US/docs/Web/CSS/--*#browser_compatibility
|
|
This converts a few functions to more compact versions of
themselves, and moves `RUSTDOC_MOBILE_BREAKPOINT` to main.js where
it's actually used.
|
|
Reverts a1d4ebe4961c107272f9764d1908227a3cd04092, as well as
fixing the problem it solved with links losing their color.
|
|
|
|
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.
|
|
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>

</details>
Fixes #91100
Preview: <https://notriddle.com/notriddle-rustdoc-demos/simplify-doctest-tooltip/std/vec/struct.Vec.html#indexing>
Screenshot:

|
|
|
|
This switches from using `<div>` to the more semantic `<ul>`, and
using class names that rhyme with the classes the search results
table uses.
|
|
rustdoc: fix item-spacer
rustdoc: use proper comment style
rustdoc: change formatting where clauses for traits
rustdoc: remove semicolon from provided methods
update provided methods formatting
|
|
Co-Authored-By: David Tolnay <dtolnay@gmail.com>
|
|
Inline CSS background images directly into the CSS
A nice advantage of this is that it removes a few entries in the list of static files.
r? ``@notriddle``
|
|
|
|
rustdoc: stop making unstable items transparent
Fixes #93393
|
|
rustdoc: update Source Serif 4 from 4.004 to 4.005
[Version 4.005](https://github.com/adobe-fonts/source-serif/releases/tag/4.005R) was released on 2023-01-20.
|
|
Fixes #93393
|
|
Migrate last part of CSS themes to CSS variables
No changes in the output. This is already tested in `tests/rustdoc-gui/search-tab.goml` so no need to add a GUI test.
r? `@notriddle`
|
|
|
|
|
|
Fixes https://discord.com/channels/442252698964721669/443150878111694848/1066420140167680000
Fixes #91100
|
|
|
|
Version 4.005 was released on 2023-01-20.
|
|
|
|
|
|
r=notriddle
rustdoc: Use correct pseudo-element selector
As explained [here](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements#syntax).
I wrote it on top of #107152 so we'll need to wait for this one to be merged first.
r? `@notriddle`
|
|
Migrate scraped-examples top and bottom "borders" to CSS variables
r? `@notriddle`
|
|
|
|
|
|
Since the current sidebar item is already a link, it doesn't
do anything.
|
|
r=GuillaumeGomez
rustdoc: remove `docblock` class from notable trait popover
This commit builds on b72de9be74dd5ac1d8b23d5ece03a7690274a14c, which removes the `docblock` class from the All Items page, and 9457380ac902db3febf92077c5b645db55998ad4, which removes the `docblock` class from the item decl.
Fixes #92974
|
|
rustdoc: remove unnecessary DOM class `h1.fqn`
It's misleading. The main heading sometimes isn't an fully qualified name at all.
It's also redundant. It's always a child of `div.main-heading`, so just use that.
|
|
This commit builds on b72de9be74dd5ac1d8b23d5ece03a7690274a14c, which removes
the `docblock` class from the All Items page, and
9457380ac902db3febf92077c5b645db55998ad4, which removes the `docblock` class
from the item decl.
Fixes #92974
|
|
This swaps things around so that the class that gets used more often has
the shorter name.
|
|
It's misleading. The main heading sometimes isn't an fully qualified name at all.
It's also redundant. It's always a child of `div.main-heading`, so just use that.
|
|
|
|
Fix scrolling for item declaration block
Fixes https://github.com/rust-lang/rust/issues/105580.
The `contain: layout` was the issue here and the bug was actually on both mobile and desktop.
r? `@notriddle`
|
|
|
|
|
|
r=GuillaumeGomez
rustdoc: remove no-op mobile CSS `.content { margin-left: 0 }`
This rule was added to override non-zero left margin on `.content`, which was removed in 135281ed1525db15edd8ebd092aa10aa40df2386 and the margin-left was put on the docblock.
|
|
This rule was added to override non-zero left margin on `.content`,
which was removed in 135281ed1525db15edd8ebd092aa10aa40df2386 and
the margin-left was put on the docblock.
|