From 3d28a91e57872d1780aadc07bdc7b355b102b174 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 11 Nov 2025 13:04:58 +0000 Subject: [PATCH 1/3] feat: Implement sectionheader and sectionfooter roles --- common/src/lib.rs | 2 ++ platforms/atspi-common/src/node.rs | 2 ++ platforms/macos/src/node.rs | 4 ++++ platforms/windows/src/node.rs | 2 ++ 4 files changed, 10 insertions(+) diff --git a/common/src/lib.rs b/common/src/lib.rs index b364f738..bb5c6e48 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -181,6 +181,8 @@ pub enum Role { ScrollView, Search, Section, + SectionFooter, + SectionHeader, Slider, SpinButton, Splitter, diff --git a/platforms/atspi-common/src/node.rs b/platforms/atspi-common/src/node.rs index 2a930d01..3fcc7c79 100644 --- a/platforms/atspi-common/src/node.rs +++ b/platforms/atspi-common/src/node.rs @@ -224,6 +224,8 @@ impl NodeWrapper<'_> { // shows up in the tree. Role::RubyAnnotation => AtspiRole::Static, Role::Section => AtspiRole::Section, + Role::SectionFooter => AtspiRole::Footer, + Role::SectionHeader => AtspiRole::Header, Role::ScrollBar => AtspiRole::ScrollBar, Role::Search => AtspiRole::Landmark, Role::Slider => AtspiRole::Slider, diff --git a/platforms/macos/src/node.rs b/platforms/macos/src/node.rs index fc4aa314..87e6fce2 100644 --- a/platforms/macos/src/node.rs +++ b/platforms/macos/src/node.rs @@ -159,6 +159,8 @@ fn ns_role(node: &Node) -> &'static NSAccessibilityRole { Role::ScrollView => NSAccessibilityUnknownRole, Role::Search => NSAccessibilityGroupRole, Role::Section => NSAccessibilityGroupRole, + Role::SectionFooter => NSAccessibilityGroupRole, + Role::SectionHeader => NSAccessibilityGroupRole, Role::Slider => NSAccessibilitySliderRole, Role::SpinButton => NSAccessibilityIncrementorRole, Role::Splitter => NSAccessibilitySplitterRole, @@ -272,6 +274,8 @@ fn ns_sub_role(node: &Node) -> &'static NSAccessibilitySubrole { Role::Region => ns_string!("AXLandmarkRegion"), Role::Search => ns_string!("AXLandmarkSearch"), Role::SearchInput => NSAccessibilitySearchFieldSubrole, + Role::SectionFooter => ns_string!("AXSectionFooter"), + Role::SectionHeader => ns_string!("AXSectionHeader"), Role::Status => ns_string!("AXApplicationStatus"), Role::Strong => ns_string!("AXStrongStyleGroup"), Role::Switch => NSAccessibilitySwitchSubrole, diff --git a/platforms/windows/src/node.rs b/platforms/windows/src/node.rs index 4b1282d9..856a2723 100644 --- a/platforms/windows/src/node.rs +++ b/platforms/windows/src/node.rs @@ -181,6 +181,8 @@ impl NodeWrapper<'_> { Role::ScrollView => UIA_PaneControlTypeId, Role::Search => UIA_GroupControlTypeId, Role::Section => UIA_GroupControlTypeId, + Role::SectionFooter => UIA_GroupControlTypeId, + Role::SectionHeader => UIA_GroupControlTypeId, Role::Slider => UIA_SliderControlTypeId, Role::SpinButton => UIA_SpinnerControlTypeId, Role::Splitter => UIA_SeparatorControlTypeId, From 039d31baff979ea2f631c8a464d5e6297e05661a Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Wed, 12 Nov 2025 18:09:54 +0000 Subject: [PATCH 2/3] Remove Header/FooterAsNonLandmark --- common/src/lib.rs | 2 -- platforms/atspi-common/src/node.rs | 2 -- platforms/macos/src/node.rs | 2 -- platforms/windows/src/node.rs | 2 -- 4 files changed, 8 deletions(-) diff --git a/common/src/lib.rs b/common/src/lib.rs index bb5c6e48..b92eac18 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -142,12 +142,10 @@ pub enum Role { FigureCaption, Figure, Footer, - FooterAsNonLandmark, Form, Grid, Group, Header, - HeaderAsNonLandmark, Heading, Iframe, IframePresentational, diff --git a/platforms/atspi-common/src/node.rs b/platforms/atspi-common/src/node.rs index 3fcc7c79..ace24377 100644 --- a/platforms/atspi-common/src/node.rs +++ b/platforms/atspi-common/src/node.rs @@ -150,8 +150,6 @@ impl NodeWrapper<'_> { Role::Form => AtspiRole::Form, Role::Figure | Role::Feed => AtspiRole::Panel, Role::GenericContainer - | Role::FooterAsNonLandmark - | Role::HeaderAsNonLandmark | Role::Ruby => AtspiRole::Section, Role::GraphicsDocument => AtspiRole::DocumentFrame, Role::GraphicsObject => AtspiRole::Panel, diff --git a/platforms/macos/src/node.rs b/platforms/macos/src/node.rs index 87e6fce2..31679d0c 100644 --- a/platforms/macos/src/node.rs +++ b/platforms/macos/src/node.rs @@ -120,12 +120,10 @@ fn ns_role(node: &Node) -> &'static NSAccessibilityRole { Role::FigureCaption => NSAccessibilityGroupRole, Role::Figure => NSAccessibilityGroupRole, Role::Footer => NSAccessibilityGroupRole, - Role::FooterAsNonLandmark => NSAccessibilityGroupRole, Role::Form => NSAccessibilityGroupRole, Role::Grid => NSAccessibilityTableRole, Role::Group => NSAccessibilityGroupRole, Role::Header => NSAccessibilityGroupRole, - Role::HeaderAsNonLandmark => NSAccessibilityGroupRole, Role::Heading => ns_string!("Heading"), Role::Iframe => NSAccessibilityGroupRole, Role::IframePresentational => NSAccessibilityGroupRole, diff --git a/platforms/windows/src/node.rs b/platforms/windows/src/node.rs index 856a2723..ddafecbe 100644 --- a/platforms/windows/src/node.rs +++ b/platforms/windows/src/node.rs @@ -133,12 +133,10 @@ impl NodeWrapper<'_> { Role::FigureCaption => UIA_TextControlTypeId, Role::Figure => UIA_GroupControlTypeId, Role::Footer => UIA_GroupControlTypeId, - Role::FooterAsNonLandmark => UIA_GroupControlTypeId, Role::Form => UIA_GroupControlTypeId, Role::Grid => UIA_DataGridControlTypeId, Role::Group => UIA_GroupControlTypeId, Role::Header => UIA_GroupControlTypeId, - Role::HeaderAsNonLandmark => UIA_GroupControlTypeId, Role::Heading => UIA_TextControlTypeId, Role::Iframe => UIA_DocumentControlTypeId, Role::IframePresentational => UIA_GroupControlTypeId, From 1d616b94e365490f9dd18cca3d4d1e7fe006cfb7 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Wed, 12 Nov 2025 18:37:37 +0000 Subject: [PATCH 3/3] format fix --- platforms/atspi-common/src/node.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/platforms/atspi-common/src/node.rs b/platforms/atspi-common/src/node.rs index ace24377..294598d7 100644 --- a/platforms/atspi-common/src/node.rs +++ b/platforms/atspi-common/src/node.rs @@ -149,8 +149,7 @@ impl NodeWrapper<'_> { // names should be exposed as `AtspiRole::Landmark` according to Core AAM. Role::Form => AtspiRole::Form, Role::Figure | Role::Feed => AtspiRole::Panel, - Role::GenericContainer - | Role::Ruby => AtspiRole::Section, + Role::GenericContainer | Role::Ruby => AtspiRole::Section, Role::GraphicsDocument => AtspiRole::DocumentFrame, Role::GraphicsObject => AtspiRole::Panel, Role::GraphicsSymbol => AtspiRole::Image,