fix: enforce accessibility scopes for focus findings#2072
Merged
Conversation
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.
Summary
includeScopesandexcludeScopesfor focus-visible, attributable focus-loss, and dialog focus findings using the collector's existing scope matcherScope semantics
Targets match when they are a declared include root or its descendant, or when no include scope is declared. Matching exclude roots and descendants always win over includes. Static accessible-name, keyboard-reachable, tab-order, and ARIA-state scans continue through the same matcher; focus and dialog findings now obey it too.
Focus loss is attributed to the in-scope element that lost focus rather than the out-of-scope document body. Dialog entry and restoration obligations are attributed to the scoped dialog, while trigger and destination focus may remain contextual. Dialog and focus identities include frame identity internally so equivalent structural locators in different same-origin frames do not collide.
Invalid selectors remain inconclusive. Valid include selectors that collectively match no inspectable frame now emit
browser_accessibility_scope_unmatchedand are inconclusive rather than silently passing. Uninspectable frames retain the existing explicitbrowser_accessibility_frame_unsupporteddiagnostic.Tests
Passed:
npm run buildnpm run test:browser-accessibility-oracles(34 tests)npm run test:adversarial-runtime(16 tests)npm run test:redactionnpm run test:runtime-command-artifact-boundsnpm run test:evidence-bundle-digest-and-recipe-artifactnpm run test:schema-paritynpm run test:runtime-contract-manifestnpm run test:runtime-contract-package-exportsgit diff --checkNew browser fixtures cover inside/outside focus targets, nested exclude precedence, attributable focus loss, cross-boundary dialog focus and restoration, unmatched scopes, and same-origin frame filtering with preserved frame IDs. Existing replay, fingerprint, privacy, and artifact-bound assertions remain passing.
Baseline failures
npm run test:public-api-contractfails in untouched code because the expected public barrel list omits the already-exported./browser-accessibility.jsintroduced onmain.npm run checkpasses production-boundary enforcement and then reaches an unrelated existingcommand-registry-smokefailure:wordpress.collect-workload-result outputShape should mention outputSchema id.Limitations
Cross-origin or otherwise unavailable frame DOM remains outside the collector's inspection capability and is reported diagnostically; this change does not add cross-origin access or retain additional sensitive target content.
Fixes #2069