mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
Sets the accessibility role of nodes based on their DOM node type (ignoring ARIA roles and computed styles for now), for a small subset of roles. This change also re-works some details of accessibility tree building: - Set the `root` property for the accesskit tree to the node ID for the root DOM node, rather than creating a placeholder root node which contains the root DOM node. - Since we now map the `<body>` node to the `RootWebArea` role, this required a small change to the accessibility test logic to do a tree walk to find the `RootWebArea` node, which used to be the first child since we artificially set the placeholder root node to be the `RootWebArea` node. - Have `update_node_and_children()` return a bool indicating whether any node was updated. - Split the code updating the node itself into its own function, `update_node()`, which takes a DOM node and returns a tuple containing the accessibility node ID and a bool indicating whether the node required updating - Add an `assert_node_by_id()` method to retrieve an accessibility node based on its ID. Testing: See new tests added in this PR. --------- Signed-off-by: Alice Boxhall <alice@igalia.com> Co-authored-by: delan azabani <dazabani@igalia.com>