rust/tests
Jonathan Brouwer ab0689919e
Rollup merge of #151482 - ThanhNguyxn:fix/rustdoc-skip-nav, r=GuillaumeGomez
Add "Skip to main content" link for keyboard navigation in rustdoc

## Summary

This PR adds a "Skip to main content" link for keyboard navigation in rustdoc, improving accessibility by allowing users to bypass the sidebar and navigate directly to the main content area.

## Changes

- **`src/librustdoc/html/templates/page.html`**: Added a skip link (`<a class="skip-main-content">`) immediately after the `<body>` tag that links to `#main-content`
- **`src/librustdoc/html/static/css/rustdoc.css`**: Added CSS styles for the skip link:
  - Visually hidden by default (`position: absolute; top: -100%`)
  - Becomes visible when focused via Tab key (`top: 0` on `:focus`)
  - Styled consistently with rustdoc theme using existing CSS variables
- **`tests/rustdoc-gui/skip-navigation.goml`**: Added GUI test to verify the skip link functionality

## WCAG Compliance

This addresses **WCAG Success Criterion 2.4.1 (Level A)** - Bypass Blocks:
> A mechanism is available to bypass blocks of content that are repeated on multiple web pages.

## Demo

When pressing Tab on a rustdoc page, the first focusable element is now the "Skip to main content" link, allowing keyboard users to jump directly to the main content without tabbing through the entire sidebar.

## Future Improvements

Based on the discussion in rust-lang/rust#151420, additional skip links could be added between the page summary and module contents sections. This PR provides the foundation, and we can iterate on adding more skip links based on feedback.

Fixes rust-lang/rust#151420

r? @JayanAXHF
2026-01-24 08:18:07 +01:00
..
assembly-llvm Rollup merge of #151259 - bonega:fix-is-ascii-avx512, r=folkertdev 2026-01-24 08:18:05 +01:00
auxiliary Rollup merge of #150368 - minicore-ordering, r=workingjubilee 2026-01-11 09:56:38 +01:00
build-std/configurations Test that -Zbuild-std=core works on a variety of profiles 2026-01-14 20:39:12 -05:00
codegen-llvm Rollup merge of #151259 - bonega:fix-is-ascii-avx512, r=folkertdev 2026-01-24 08:18:05 +01:00
codegen-units address review comments; fix CI 2026-01-01 19:17:11 -05:00
coverage Rollup merge of #147611 - stablize-remap-path-scope, r=davidtwco 2026-01-20 14:36:30 +01:00
coverage-run-rustdoc
crashes Auto merge of #150843 - fmease:dyn-ace, r=BoxyUwU 2026-01-22 01:56:41 +00:00
debuginfo Auto merge of #150843 - fmease:dyn-ace, r=BoxyUwU 2026-01-22 01:56:41 +00:00
incremental Implement incremental caching for derive macro expansions 2026-01-16 07:36:36 +01:00
mir-opt Rollup merge of #148623 - trimmed-paths, r=davidtwco 2026-01-19 20:53:19 +01:00
pretty Update uitests 2026-01-19 21:50:29 +01:00
run-make Rollup merge of #151517 - paradoxicalguy:enable-debuginfo-tests-linux, r=Kobzol 2026-01-24 08:18:06 +01:00
run-make-cargo tests/run-make-cargo/same-crate-name-and-macro-name: New regression test 2025-12-17 11:21:27 +01:00
rustdoc-gui Add 'Skip to main content' link for keyboard navigation in rustdoc 2026-01-23 18:19:00 +07:00
rustdoc-html rustdoc: render doc(hidden) as a code attribute 2026-01-22 09:15:53 +09:00
rustdoc-js Auto merge of #149370 - Zalathar:rollup-6fkk5x4, r=Zalathar 2025-11-27 07:30:25 +00:00
rustdoc-js-std Explicitly export core and std macros 2026-01-13 08:47:48 +01:00
rustdoc-json
rustdoc-ui Rollup merge of #151255 - fix-rustdoc-ice-reexported-deprecated-note, r=lolbinarycat 2026-01-20 18:00:10 +11:00
ui Rollup merge of #151500 - androm3da:bcain/hexagon_hvx_feat, r=folkertdev 2026-01-24 08:18:06 +01:00
ui-fulldeps Move assert_matches to planned stable path 2026-01-21 23:17:24 +01:00
COMPILER_TESTS.md