public sealed class AccessibilityTreeThe accessibility tree of a document at one moment, as data a bridge can answer from.
Remarks
This is the traversal, and it is the only one. Two rules decide what the accessibility tree is, and they used to live in a test-support assembly:
⚠ An element that is not a node is walked through rather than skipped. Its children rise to its parent's depth, which is what ARIA's none means and is the difference between a tree a screen reader can read and thirty nested groups.
⚠ An element reached by Owns is emitted under its owner and not where the element tree has it. A Select's list is a child of the document root — an overlay inside the field that opens it would be clipped — and the relation is how the control says so. Reproducing that wrongly gives a screen reader a combo box with nothing in it and a pile of loose lists at the end.
AccessibilitySnapshot.Render is a renderer over this and no longer a second walk, which is what makes this repository's accessibility test discipline a bridge's evidence rather than a parallel universe: the string a control's snapshot test asserts on is rendered from the same nodes a screen reader would be handed.
Fields and properties (3)
public IReadOnlyList<AccessibilityNode> RootsThe tops of the tree.
public int CountHow many nodes there are, at every depth.
public IReadOnlyList<AccessibilityNode> NodesEvery node, in the order the walk reached them, which is document order.
Methods (3)
public static AccessibilityTree Capture(UiElement root)Captures the accessibility tree under an element.
public static IReadOnlyList<AccessibilityChange> Diff(AccessibilityTree? previous, AccessibilityTree current)What changed between two captures.
public AccessibilityNode? Node(int id)The node with an id, if this capture has one.
Used by (3)
- AccessibilitySnapshotVixen.Ui.Testing
- AccessibilityTreeSourceVixen.Ui
- AccessibilityTreeTestsVixen.Ui.Tests