Move AccessKit integration to examples - #716
Open
DataTriny wants to merge 3 commits into
Open
Conversation
Building an AccessKit-style integration outside Parley requires a handful of details that were either private or gated behind the `accesskit` feature. Make them public: - `Layout::text_len` and `Layout::alignment` - `Cursor::upstream_cluster` and `Cursor::downstream_cluster` - `ClusterPath::new` - the `Style::locale` field - `PlainEditor::is_cursor_visible` - `PlainEditorDriver::set_selection` `LayoutData::alignment` and `Style::locale` are no longer gated on the `accesskit` feature, and `LayoutData::clear` now resets the alignment so that `Layout::alignment` cannot report a value left over from a previous build.
`vello_editor` is the only example that opens a window, and so the only one that can expose a tree to assistive technologies. Add the integration to it directly, as `accessibility.rs`, and stop enabling Parley's `accesskit` feature. The module is a copy of Parley's internal integration, rewritten against the public API. `LayoutAccessibility` covers read-only layouts; `PlainEditorAccessibility` builds on it with the editor-specific parts, so a consumer only has to supply its own brush conversion. Three details that relied on private state are now expressed differently: the style index comes from `Cluster::style_index`, the alignment from `Layout::alignment`, and the trailing hard line break is detected with `Cluster::is_hard_line_break` on the last byte rather than by inspecting the shaped text.
Remove the `accesskit` feature along with the `accesskit` and `skrifa`
dependencies it pulled in.
This removes `LayoutAccessibility`, `PlainEditor::try_accessibility`,
`PlainEditorDriver::{accessibility, select_from_accesskit}`,
`Cursor::{from_access_position, to_access_position}`, and
`Selection::{from_access_selection, to_access_selection}`.
DataTriny
force-pushed
the
accesskit-in-examples
branch
from
July 28, 2026 12:37
0951e74 to
bdc6bf1
Compare
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.
As discussed at RustWeek 2026, the current API of the AccessKit integration is not a great fit for many consumers.
The conclusion we reached was that removing the integration entirely would allow users to design their own according to their needs. The existing integration can be moved to the vello_editor example to serve as a reference implementation or a starting point.
This require making some items public though.
The changes here are mostly mechanical. I am guessing that most of the changes made to parley's API will be controversial, so this pull request should be considered as a way to open the discussion, not necessarily as something to merge as is.
See slint-ui/slint#2895 for my current motivation.