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
@@ -118,7 +118,7 @@ Text alternative: a plain high-priority photo is preloaded by React, a photo in
| BR-NAV-03 | Open link: `<a class="ns-menu-open" href="#mobile-nav" aria-label="Menu openen">` with three bars, inside the header's right-hand `div` before the hamburger. It is 44 x 44 px like the button. It is hidden from `64rem` up (`lg`), where the header shows the links. `aria-label` reuses the existing string. | FR-PR-12 |
| BR-NAV-04 | The hamburger `button` gets `data-requires-js` and is hidden without JavaScript (BR-NJS-01). | FR-PR-12, FR-PR-13 |
| BR-NAV-05 | `#mobile-nav:target { clip-path: inset(0); visibility: visible }`. No `!important`: an id selector outranks the single-class selectors Emotion generates, also those inside media queries (verified: with the rule the computed values were `inset(0px)` and `visible`). `display` is not touched, so the panel stays `none` from `lg` up even when the address ends in `#mobile-nav`. The existing `clip-path` and `visibility` transition animates the opening, and `_motionReduce` on the panel still switches it off. | FR-PR-12 |
| BR-NAV-06 | The shoot submenu is expanded without JavaScript: `#mobile-nav [id^="mobile-group-"] { grid-template-rows: 1fr; visibility: visible; transition: none }` always, not only on `:target` (selector weight 1,1,0 beats Emotion's single class). The chevron button of the group carries `data-requires-js` and is hidden. | FR-PR-12 |
| BR-NAV-06 | The shoot submenu is expanded without JavaScript: `#mobile-nav [id^="mobile-group-"] { grid-template-rows: 1fr; transition: none }` always (selector weight 1,1,0 beats Emotion's single class), and `#mobile-nav:target [id^="mobile-group-"] { visibility: visible }` only while the panel is open: a visible child of a hidden parent is focusable, so an unconditional `visibility: visible` would leave the shoot links in the Tab order of the closed panel (BR-NAV-08; found in the browser test, decided 2026-10-31). The chevron button of the group carries `data-requires-js` and is hidden. | FR-PR-12 |
| BR-NAV-07 | Close link: `<a class="ns-menu-close" href="#site-header">` with the existing text "Menu sluiten", as the first child of the panel's content, so it is the first Tab stop after opening. `#site-header` is the fixed `header`, which gets an `id` for this. A fragment navigation to a fixed element does not scroll: verified in Chrome with the page at `scrollY` 300, opening via `#mobile-nav` and closing via `#site-header` both left it at 300 (Firefox and Safari: V-D4). Rejected: `href="#"` (scrolls to the top of the page) and `href="#main"` (scrolls to the content). | FR-PR-12 |
| BR-NAV-08 | Focus order without JavaScript: skip link, logo, open link; closed, the panel is `visibility: hidden`, so none of its links is focusable. After activating the open link the browser's sequential focus starting point is `#mobile-nav`, so the next Tab goes to the close link, then Home, Over mij, Portfolio, Soorten fotoshoots, Newborn, Zwangerschap, Gezin, Loveshoot, Portretten, Contact (verified, in that order). Both links get a visible focus ring (`:focus-visible` outline in the CSS). | FR-PR-12; WCAG 2.4.3, 2.4.7 |
| BR-NAV-09 | Desktop (from `lg`): all top-level links are in the header and work. The panel with the five shoot links is `visibility: hidden`, so by keyboard those links are unreachable, and the chevron button does nothing. **Decided (O3):** `[data-submenu]:focus-within > [data-submenu-panel] { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition: none }` opens it while focus is on the "Soorten fotoshoots" link or inside the panel, and the chevron is hidden (`data-requires-js`). `transition: none` is needed: the panel's `visibility` transition starts hidden, and a Tab pressed in the same frame skipped the panel (observed); with a 150 ms pause, Tab reached Newborn to Gezin in order. Mouse users click "Soorten fotoshoots", which opens the overview where each shoot has its "Lees meer" link; hover opening is not offered (the 0.75rem gap between link and panel would close it). | FR-PR-12; BR-NAV-21, 27 (earlier feature: no hover opening) |