delan · GitHub

@delan

@alice

@alice

@alice alice changed the title Add logic to track new, stale and moved nodes. layout: Prune stale accessibility nodes from the cache after each update.

May 15, 2026

@alice

alice marked this pull request as ready for review

May 15, 2026 13:55

@alice

@alice alice mentioned this pull request

May 15, 2026

Merged

delan

delan

@alice

delan

delan

delan

@alice

mrobinson

mrobinson

@mrobinson

alice and others added 15 commits

May 20, 2026 10:33
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>
Previously, we detected an "impossible" New->Moved TreeStateChange update, because we were updating the state of all newly added children to be "Moved".
Now, we filter out newly-created nodes when updating the subtree TreeStateChange.
This change also introduces a `MoveState` enum for moved nodes, allowing us to assert that every moved node is removed exactly once.
Co-authored-by: delan azabani <dazabani@igalia.com>
Signed-off-by: Alice Boxhall <alice@igalia.com>
…ostic to MoveState for incoming TreeStateChanges.
Signed-off-by: Alice Boxhall <alice@igalia.com>
- Document `TreeChangeState`, `MoveState` and `set_subtree_state_change()`
- Panic when attempting to pass `New` or `Moved(Complete)` to set_subtree_state_change()
- Remove redundant integrity check at the beginning of the tree update
- `use` `TreeStateChange` and `MoveState` in `update_descendants()`.
Co-authored-by: delan azabani <dazabani@igalia.com>
Signed-off-by: Alice Boxhall <alice@igalia.com>
- TreeStateChange -> TreeChange
- MoveState -> Move
- get_node_by_dom_node() -> node_for_dom_node()
- assert_node_by_dom_node() -> assert_node_for_dom_node()
- assert_node_by_id() -> assert_node_for_id()
Also:
- don't `use` enums except in `set_subtree_state_change()`
- don't redundantly declare the type for `newly_created`
Co-authored-by: delan azabani <dazabani@igalia.com>
Signed-off-by: Alice Boxhall <alice@igalia.com>
Also rename finalize_tree_state_changes to finalize_tree_changes.
Also add doc comment for tree_changes.
Also update uses of `TreeStateChange` and `MoveState` in doc comments.
Signed-off-by: Alice Boxhall <alice@igalia.com>
This makes things a little bit more readable.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
- Remove stray spaces in doc comments
- Remove `eprintln` calls from assert_integrity().
Signed-off-by: Alice Boxhall <alice@igalia.com>

@alice

@mrobinson

Signed-off-by: Alice Boxhall <alice@igalia.com>

auto-merge was automatically disabled

May 20, 2026 08:47

Head branch was pushed to by a user without write access

@delan

@delan

@delan

delan deleted the accessibility-prune-stale-children branch

May 20, 2026 10:03

Read the original on github.com ↗