Feat/macos accessibility support#267
Open
xell wants to merge 2 commits into
Open
Conversation
On macOS, Chromium builds its renderer accessibility tree lazily, only once an assistive client performs the activation handshake. Tools that read the tree without performing that handshake (e.g. the Grammarly desktop app and similar proofreaders) were left blind: they found the app window but never the CodeMirror content, so they appeared to attach yet did nothing. - main: call app.setAccessibilitySupportEnabled(true) in whenReady (darwin), exposing editor content to that class of accessibility clients. - heading fold arrow: aria-hidden. It is an opacity:0 but AX-visible role="button" at the start of every heading line; as a field's leading element it made some clients treat the whole field as a non-prose control and disengage (e.g. any document starting with a heading). Folding is unchanged and still available by mouse, keyboard, and vim. - editor surface: aria-label so clients announce it as a named text field. No rendering or editing behavior changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…lity tree The rendered list bullet is decorative, so mark it aria-hidden to keep it out of the field's text value for clients that read it (screen readers, proofreaders). The underlying `- ` source text is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
xell
marked this pull request as draft
June 26, 2026 04:46
xell
marked this pull request as ready for review
June 26, 2026 05:30
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.
Expose the editor to macOS accessibility clients
Problem
On macOS, accessibility tools that read the system accessibility (AX) tree could not see the editor's text. Chromium builds its renderer accessibility tree lazily, only after an assistive client performs the macOS activation handshake. Tools that read the tree without performing that handshake were left blind: they could see the app window but not the CodeMirror content, so they appeared to attach, yet did nothing. The Grammarly desktop app is the clearest example (its bubble showed, but it never flagged anything), but this affects the whole class of AX-based text tools.
A second, related issue: a document whose first line was a heading disabled checking for the entire field because the heading fold arrow is at
opacity: 0but is an accessibility-visiblerole="button"placed at the very start of the line. Clients that inspect a field's leading content treated the whole field as a non prose control.Changes
app.setAccessibilitySupportEnabled(true)inwhenReady). This exposes editor content to AX clients that do not trigger Chromium's lazy activation on their own.aria-hiddenso it no longer sits in the accessibility tree as a leading interactive element. Folding is unchanged and still available by mouse, keyboard, and Vim.aria-hiddenso the decorative glyph does not pollute the field's text value.aria-labelto the editor surface so clients announce it as a named text field.No rendering or editing behavior changes. Typecheck and the full test suite pass.
Tradeoffs to flag
Not addressed (out of scope)
contenteditable="false"widget, so AX clients disengage inside them. Workaround: the existing "Render tables in live preview" setting.