Skip to content

Shadow DOM traversal + git-installable build#1

Merged
eins78 merged 4 commits into
mainfrom
quatico-installable
Apr 16, 2026
Merged

Shadow DOM traversal + git-installable build#1
eins78 merged 4 commits into
mainfrom
quatico-installable

Conversation

@qubert-quatico
Copy link
Copy Markdown

Mirrors upstream PR #183 (fix: traverse open shadow DOM roots in accessibility tree) with one additional commit on top:

  • adds prepare script to package.json so the library can be installed from a git URL (pnpm add github:quatico-solutions/virtual-screen-reader#quatico-installable) — the build runs automatically on install.

Why this exists

The upstream library cannot traverse shadow DOM, which breaks it for any web-component-heavy codebase like mchweb. The upstream fix is in review (#183). This branch lets us dogfood the fix via git-URL install while we wait.

Commits

  1. feat: traverse open shadow DOM roots in accessibility tree — the core fix
  2. test: add shadow DOM traversal tests — 6 tests
  3. test: add coverage for shadow-aware aria-owns, aria-flowto, and nested ID lookup — 3 more tests, coverage thresholds green
  4. chore: add prepare script to support git-URL installs — enables git-URL install

335/335 tests pass locally. All coverage thresholds met (98%+ statements, 95%+ branches, 100% functions).

Escape hatch

If upstream rejects #183, we rename this package to @qs/virtual-screen-reader and publish to the internal Artifactory. See tiered strategy in mchweb docs/stories/screenreader-tests/STORY-screenreader-tests.md.

Consumer (first)

  • mchweb PR #3662 — verification test confirms the patched build traverses mch-header's 3-level shadow DOM.

qubert-quatico and others added 4 commits April 2, 2026 13:10
The tree builder now follows the WAI-ARIA flattened tree model:

- When a node has an open shadowRoot, traverse shadow children instead
  of light DOM children
- Resolve <slot> elements via assignedNodes({ flatten: true })
- Shadow-aware querySelectorAll for aria-flowto and aria-owns resolution
- Shadow-aware ID lookup for getNodeByIdRef
- MutationObserver now observes shadow roots in addition to the container

Fixes guidepup#182

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 tests covering:
- Open shadow root traversal
- Nested shadow roots (2 levels deep)
- Slotted content projection via assignedNodes
- Slot default content fallback
- Host element ARIA attributes with shadow children
- Closed shadow roots are not traversed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d ID lookup

- aria-owns referencing element inside shadow DOM
- aria-owns referencing element nested 2 shadow levels deep
- aria-flowto referencing element inside shadow DOM
- Fixes coverage threshold failures (getNodeByIdRef now 100%)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Allows consumers to install this package from a git URL
(e.g. for testing patches before they land upstream) by
triggering the build automatically after install.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@eins78 eins78 merged commit 1958fa3 into main Apr 16, 2026
@eins78 eins78 deleted the quatico-installable branch April 16, 2026 15:15
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