Adds browser tests for the page without JavaScript

The tests cover every page without JavaScript, the menu by keyboard and pointer,
the fade-in at load and on scroll, and image requests per width. They found that
the closed menu's shoot links could take focus, which is fixed here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 23:50:17 +01:00
co-authored by Claude Opus 5.5
parent 01fcfeefea
commit 2754890370
13 changed files with 1229 additions and 23 deletions
@@ -60,7 +60,11 @@ describe('NO_SCRIPT_CSS', () => {
],
[
'group expanded',
'#mobile-nav [id^="mobile-group-"]{grid-template-rows:1fr;visibility:visible;transition:none}',
'#mobile-nav [id^="mobile-group-"]{grid-template-rows:1fr;transition:none}',
],
[
'group visible while open',
'#mobile-nav:target [id^="mobile-group-"]{visibility:visible}',
],
[
'desktop submenu',
+6 -2
View File
@@ -38,8 +38,11 @@ const FOCUS_RING =
// stays hidden from lg up, even when the address ends in the fragment.
const PANEL_OPEN = `#${MOBILE_NAV_ID}:target{clip-path:inset(0);visibility:visible}`;
// The shoot group is always expanded
const GROUP_EXPANDED = `#${MOBILE_NAV_ID} [id^="mobile-group-"]{grid-template-rows:1fr;visibility:visible;transition:none}`;
// The shoot group is always expanded. Its visibility is only restored while the
// panel is open: a visible child of a hidden parent is focusable, so the links
// would stay in the Tab order of the closed panel.
const GROUP_EXPANDED = `#${MOBILE_NAV_ID} [id^="mobile-group-"]{grid-template-rows:1fr;transition:none}`;
const GROUP_VISIBLE = `#${MOBILE_NAV_ID}:target [id^="mobile-group-"]{visibility:visible}`;
// The desktop submenu opens on keyboard focus. transition none: a Tab pressed
// while the visibility transition starts would skip the panel.
@@ -55,5 +58,6 @@ export const NO_SCRIPT_CSS = [
FOCUS_RING,
PANEL_OPEN,
GROUP_EXPANDED,
GROUP_VISIBLE,
SUBMENU_FOCUS,
].join('');