Skip to content

rustdoc: search box flickers on page load #90246

Closed
@jsha

Description

@jsha

Steps to reproduce:

  1. Visit, e.g. https://doc.rust-lang.org/std/string/trait.ToString.html
  2. Open Chrome Developer Tools
  3. Click the Sources tab, then main1.56.0.js.
  4. Click the first line of main1.56.0.js to set a breakpoint.
  5. Reload.
  6. Notice that the search box is grey, but it will later become white.

flicker-on-load

The search box has for a long time been disabled on page load, until the JS runs. It being grey is a side effect of #85367. Before that, our search-focus:disabled style wasn't getting applied. After that, it is. As a quick fix I think we should remove the grey styling on the disabled search bar. I know this means that no-JS users won't have as good a visual indication that the search bar is disabled. Perhaps we should address this by having styles inside a <noscript> tag that hide the search bar entirely.

It's good to minimize the number of changes that happen during page load - this reduces visual distractions and help page loads feel fast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions