fix(web): scope shadow landmarks to outer sections
What changed
Keep implicit header/footer landmarks scoped by article, section, navigation, aside, and region ancestors across shadow hosts. isPageLevel previously checked only the current shadow tree, so a nested card header inside an article became a page banner in the agent's observation. Top-level shadow headers and footers retain their page landmark roles.
Adds native open/closed shadow regressions and a Chrome/Playwright/axe crosscheck fixture. Updates the browser docs and adds a patch changeset. No public type or wire format changes.
Verified
Ran it locally: yes.
| Upstream main | This branch |
|---|---|
| Native observation marks the article card header/footer as page landmarks; the public CLI observation check fails. | Card nodes retain article scoping; the same public CLI check passes, and top-level landmarks remain. |
- Built upstream CLI with real Chromium: a card header inside an article is correctly absent from the page banner locator, but incorrectly appears as a banner in the native observation; the observation consumer fails. This branch passes the same scenario.
- Native open/closed shadow regressions fail on upstream and pass here; top-level landmark controls remain valid.
- Focused role and oracle crosschecks: 30 passed, 1 skipped. Existing oracle exception rules unchanged.
- Full web suite: 509 passed, 1 skipped, 55 files. Public CLI testbed: 71 passed, 1 skipped, 14 files.
- Exact signed head rebuilt and rechecked with the public CLI scenario, focused tests, typecheck and lint.
- Full monorepo
pnpm checkremains blocked by existing dead-code/mobile dependency failures. The Next.js benchmark and Android runtime are unavailable in this lean local environment; hosted checks are pending and are not claimed green.
Screened current open PR files. #871 also touches role semantics but changes presentational roles on focusable controls, leaving this helper unchanged; #926 changes text flow. The existing role fallback, ARIA state, and select choice PRs address different defects.
AI assistance: implemented and verified with Codex on behalf of Rudy Celekli; the exact signed patch was reviewed in a separate source-review context before publication.