Skip to content

layout: Root nodes which correspond to accessibility tree nodes.#44949

Draft
alice wants to merge 10 commits into
servo:mainfrom
alice:accessibility-root-nodes
Draft

layout: Root nodes which correspond to accessibility tree nodes.#44949
alice wants to merge 10 commits into
servo:mainfrom
alice:accessibility-root-nodes

Conversation

@alice
Copy link
Copy Markdown
Contributor

@alice alice commented May 15, 2026

Since we use OpaqueNodes to look up accessibility nodes, we want to ensure OpaqueNodes aren't reused before their corresponding accessibility nodes are pruned from the tree.

This change modifies AccessibilityTree::update_tree() to return, in addition to the TreeUpdate, two vectors containing OpaqueNodes which have been newly added to and removed from the accessibility tree, respectively. These vectors are stored on the LayoutThread until drain_new_nodes_for_accessibility() and drain_stale_nodes_for_accessibility() are called, which should happen as soon as possible after the reflow has finished so that the nodes can be rooted.

These vectors are used to maintain a HashMap of OpaqueNode to Dom<Node> on Document.

Testing: Keeps existing behaviour; not sure how to test the new behaviour.

Currently includes changes from #44801.

alice and others added 10 commits May 15, 2026 15:36
Signed-off-by: Alice Boxhall <alice@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
Signed-off-by: delan azabani <dazabani@igalia.com>
Signed-off-by: delan azabani <dazabani@igalia.com>
Co-authored-by: Alice Boxhall <alice@igalia.com>
Signed-off-by: delan azabani <dazabani@igalia.com>
Also, remove stale/fresh logic from get_or_create_node(), and add an integrity check for disjointness of new_nodes and stale_nodes.

Signed-off-by: Alice Boxhall <alice@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
Signed-off-by: Alice Boxhall <alice@igalia.com>
- TreeStateChange::Stale -> Removed
- TreeStateChange::Fresh -> Moved
- drain_tree_state_changes() -> finalize_tree_state_changes()

Signed-off-by: Alice Boxhall <alice@igalia.com>
Signed-off-by: Alice Boxhall <alice@igalia.com>
Co-authored-by: delan azabani <dazabani@igalia.com>
Signed-off-by: Alice Boxhall <alice@igalia.com>
Signed-off-by: Alice Boxhall <alice@igalia.com>
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.

2 participants