layout: Improvements to a11y update counters, and some extra tests - #46589
Merged
mrobinson merged 3 commits intoJul 19, 2026
Merged
Conversation
The new test copies the test case in `test_accessibility_partial_subtree_move_and_delete()` in `components/servo/tests/accessibility.rs`, with a complex sequence of nested subtree moves and deletes intended to exercise the incremental update code. This test revealed an issue with computing the `accessibilityNodeInTreeUpdate` counter - a node can be both updated and removed in a single tree update, but removed nodes aren't included in the `TreeUpdate`. This is addressed by first dropping removed nodes, then filtering the list of updated nodes, then counting the filtered list for the final counter. Future work might be to avoid updating nodes which will end up being removed from the tree in the first place - the test notes that we are updating the removed node redundantly. Signed-off-by: Alice Boxhall <alice@igalia.com>
These tests assert that changing the subtree structure of a heading will cause the heading's label to be recomputed. Signed-off-by: Alice Boxhall <alice@igalia.com>
Signed-off-by: Alice Boxhall <alice@igalia.com>
mrobinson
approved these changes
Jul 19, 2026
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.
Note: this is a bit of a grab-bag of changes. Happy to split it out if necessary.
Improvements:
countersaboverooted_nodesinAccesibilityUpdate, and add a doc comment.changed_nodes, but we filter out removed nodes from the update (in fact, including them would cause a panic). The counter needs to track the number of nodes actually sent in the update.AccessibilityUpdateResultto remove redundantaccessibility, making tests easier to readNew tests:
accessibility-update-partial-subtree-move-and-delete.htmlto match the existingtest_accessibility_partial_subtree_move_and_deleteinaccessibility.rstest_accessibility_children_of_heading_changeandtest_accessibility_descendants_of_heading_change, and matching servo-wpt testsaccessibility-update-children-of-heading-change.htmlandaccessibility-update-descendants-of-heading-change.htmlto test that changing the subtree of a heading automatically causes its label to be recomputed.Testing: Existing and new tests pass.
Fixes: part of #46346