Skip to content

test(web): cross-check every sectioning scope around shadow landmarks - #987

Closed
DeryFerd wants to merge 1 commit into
tester-army:mainfrom
DeryFerd:test/crosscheck-shadow-landmark-scope
Closed

DeryFerd wants to merge 1 commit into
tester-army:mainfrom
DeryFerd:test/crosscheck-shadow-landmark-scope

Conversation

@DeryFerd

@DeryFerd DeryFerd commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

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 landmarks fixture (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 fix(web): scope shadow landmarks to outer sections #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.txt lines, 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=1 on the same fixture produces an empty diff in tests/crosscheck/expected.txt: the tree, Chrome's accessibility tree over CDP, and Playwright's getByRole agree 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 as banner and contentinfo.
  • Three unrelated integration tests (cli-run shards and focused-CI cases, one runner-lifecycle junit 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.

View guided diff

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

View guided diff | Re-trigger cubic

The shadow section landmarks fixture added with tester-army#943 pinned the scoping
for two of the ten shapes isPageLevel scopes a header or footer to: an
article element and a region role. The other eight (aside, main, nav,
section, and the article, complementary, main, and navigation roles) had
no shadow-nested host in any fixture, so a regression in one of them
would pass the cross-check until another fixture happened to trip it.

The fixture now nests a header and footer two shadow roots deep under
each of the ten scoping shapes, with the page-level control beside
them. The run stays green with no new expected.txt lines: the tree and
both oracles agree on every header and footer the added hosts carry.
@DeryFerd
DeryFerd force-pushed the test/crosscheck-shadow-landmark-scope branch from 2c4715e to 04c60b8 Compare October 8, 2026 16:49
@okwasniewski

Copy link
Copy Markdown
Member

Thanks for this. Main already catches it, though. The shadow walk in isPageLevel checks one selector list (SECTIONING_SCOPE) at every level, so it can't break for aside and still work for article. Dropping any shape from that list already fails conformance.test.ts (tried aside, complementary, navigation, and main). The two hosts from #943 cover the walk, so the other eight only add page weight. Closing, and thanks for checking that expected.txt stayed clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants