test(web): cross-check every sectioning scope around shadow landmarks
The shadow landmark fixture from #943 pins the scoping for two of the ten shapes isPageLevel scopes a header or footer to. A regression in one of the other eight would have passed the cross-check, because no other fixture nests a landmark in a shadow root under those ancestors. This expands the fixture so every shape the scoping rule reads is exercised on every pnpm test run.
isPageLevel (packages/web/src/in-page/read-semantics.ts:134) scopes an implicit banner or contentinfo through SECTIONING_SCOPE (read-semantics.ts:123): the article, aside, main, nav, and section elements, plus the article, complementary, main, navigation, and region roles. HTML-AAM scopes a header or footer this way, so a card header inside any of these ancestors is the article's header, not the page's banner. #943 fixed the shadow-host walk that decides this; its fixture covered an <article> host and a role="region" host, which left the other eight scoping shapes without a shadow-nested regression. The landmarks and headings fixture has these ancestors but no shadow roots, so it cannot catch a scoping walk that forgets one of them across a host boundary.
What changed
- The
shadow section landmarksfixture (packages/web/tests/crosscheck/fixtures.ts) now nests a header and footer two shadow roots deep under each of the ten scoping shapes, with the page-level control beside them. Each host keeps the structure #943 established: a shadow root on the scoping ancestor, a wrapper div inside it, a nested shadow root on the wrapper, and the header and footer in the innermost tree, named by the host id. - The fixture's inline script loops over all eleven host ids instead of three, so the added coverage costs no new machinery and the page-level control still proves the scoping is not over-applied.
- Test-only change: no product code, no new
expected.txtlines, no changeset, and no public surface moves.
fixture hosts (one header + footer pair each, two shadow roots deep)
main this branch
article article, aside, main, nav, section
role="region" role="article", role="complementary", role="main",
role="navigation", role="region"
page-level control page-level control (unchanged)
Verified
Ran it locally: yes
pnpm --filter @e2e-dev/web exec vitest run tests/integration/crosscheck.test.ts -t "shadow section landmarks": the fixture passes with the eleven hosts, and again with the whole suite (16 tests, 1 skipped).E2E_CROSSCHECK_UPDATE=1on the same fixture produces an empty diff intests/crosscheck/expected.txt: the tree, Chrome's accessibility tree over CDP, and Playwright'sgetByRoleagree on every header and footer the added hosts carry. All ten scoping shapes still scope their landmarks to the article or section role, and the page-level control still reads asbannerandcontentinfo.- Three unrelated integration tests (
cli-runshards and focused-CI cases, onerunner-lifecyclejunit case) fail on this Windows machine identically with and without the change, confirmed by stashing the fixture and rerunning on clean main. Path and line-ending baseline, not from this PR.