Shadow DOM traversal + git-installable build#1
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mirrors upstream PR #183 (fix: traverse open shadow DOM roots in accessibility tree) with one additional commit on top:
preparescript 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
feat: traverse open shadow DOM roots in accessibility tree— the core fixtest: add shadow DOM traversal tests— 6 teststest: add coverage for shadow-aware aria-owns, aria-flowto, and nested ID lookup— 3 more tests, coverage thresholds greenchore: add prepare script to support git-URL installs— enables git-URL install335/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-readerand publish to the internal Artifactory. See tiered strategy in mchwebdocs/stories/screenreader-tests/STORY-screenreader-tests.md.Consumer (first)