Skip to content

Commit

Permalink
Hide invisible items from the accessibility tree
Browse files Browse the repository at this point in the history
  • Loading branch information
DataTriny committed Jan 22, 2025
1 parent 5af4d4d commit 829ea6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 0 additions & 4 deletions internal/backends/winit/accesskit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,6 @@ impl NodeCollection {
node.set_disabled();
}

if !item.is_visible() {
node.set_hidden();
}

let geometry = item.geometry();
let absolute_origin = item.map_to_window(geometry.origin) + window_position.to_vector();
let physical_origin = (absolute_origin * scale_factor).cast::<f64>();
Expand Down
4 changes: 3 additions & 1 deletion internal/core/accessibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ pub fn accessible_descendents(root_item: &ItemRc) -> impl Iterator<Item = ItemRc
candidate: ItemRc,
descendent_candidates: &mut Vec<ItemRc>,
) -> Option<ItemRc> {
if candidate.is_accessible() {
if !candidate.is_visible() {
return None;
} else if candidate.is_accessible() {
return Some(candidate);
}

Expand Down
4 changes: 2 additions & 2 deletions internal/core/item_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ impl ItemRc {
!clip.is_empty()
&& clip.max.x >= geometry.min.x
&& clip.max.y >= geometry.min.y
&& clip.min.x <= geometry.max.x
&& clip.min.y <= geometry.max.y
&& clip.min.x < geometry.max.x
&& clip.min.y < geometry.max.y
}

/// Returns the clip rect that applies to this item (in window coordinates) as well as the
Expand Down

0 comments on commit 829ea6f

Please sign in to comment.