Skip to content

Populate AccessKit node bounds from layout - #842

Open
nicoburns wants to merge 1 commit into
mainfrom
devin/1788875037-accesskit-bounds
Open

Populate AccessKit node bounds from layout#842
nicoburns wants to merge 1 commit into
mainfrom
devin/1788875037-accesskit-bounds

Conversation

@nicoburns

@nicoburns nicoburns commented Sep 8, 2026

Copy link
Copy Markdown
Member

Summary

AccessKit nodes built by BaseDocument::build_accessibility_tree never had bounds set, so every node reported a 0×0 frame (macOS AX dump showed all content at (0,1200) 0x0). VoiceOver's cursor navigation skips zero-size nodes, so only focus-driven announcements worked. This is platform-independent (AT-SPI/UIA use the same property); the macOS set_window_bounds no-op in accesskit_xplat is not the cause — the macOS adapter derives the frame from the NSView and only needs per-node bounds.

build_accessibility_node now sets:

builder.set_bounds(self.accessibility_bounds(node))
// = get_client_bounding_rect(node_or_parent) * viewport.scale
  • Coordinates are physical pixels relative to the viewport origin (what accesskit_consumer expects; accesskit_macos::to_ns_rect divides by backingScaleFactor).
  • get_client_bounding_rect already handles inline (non-atomic) elements via per-line fragment rects and subtracts viewport_scroll.
  • Text nodes have no layout box; they use their parent element's rect. Comment nodes are skipped (layout_data() panics for them).

Adds a unit test checking element/text bounds at scale 2.0.

Found during the macOS smoke test of #614 (pre-existing on main).

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/a737411590c54bbb833aa9167f89ac51
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/a737411590c54bbb833aa9167f89ac51?variant=devin-insiders
Requested by: @nicoburns

WPT results

No changes in test results compared to main.

Generated by the WPT workflow.

@staging-devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@staging-devin-ai-integration
staging-devin-ai-integration Bot force-pushed the devin/1788875037-accesskit-bounds branch from b39b705 to e8841db Compare September 8, 2026 13:48
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.

1 participant