Skip to content

Commit d024198

Browse files
committed
Hide invisible items from the accessibility tree
1 parent 5af4d4d commit d024198

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

internal/backends/winit/accesskit.rs

-4
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,6 @@ impl NodeCollection {
485485
node.set_disabled();
486486
}
487487

488-
if !item.is_visible() {
489-
node.set_hidden();
490-
}
491-
492488
let geometry = item.geometry();
493489
let absolute_origin = item.map_to_window(geometry.origin) + window_position.to_vector();
494490
let physical_origin = (absolute_origin * scale_factor).cast::<f64>();

internal/core/accessibility.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub fn accessible_descendents(root_item: &ItemRc) -> impl Iterator<Item = ItemRc
6666
candidate: ItemRc,
6767
descendent_candidates: &mut Vec<ItemRc>,
6868
) -> Option<ItemRc> {
69-
if candidate.is_accessible() {
69+
if candidate.is_accessible() && candidate.is_visible() {
7070
return Some(candidate);
7171
}
7272

internal/core/item_tree.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ impl ItemRc {
335335
!clip.is_empty()
336336
&& clip.max.x >= geometry.min.x
337337
&& clip.max.y >= geometry.min.y
338-
&& clip.min.x <= geometry.max.x
339-
&& clip.min.y <= geometry.max.y
338+
&& clip.min.x < geometry.max.x
339+
&& clip.min.y < geometry.max.y
340340
}
341341

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

0 commit comments

Comments
 (0)