diff --git a/components/layout/accessibility_tree.rs b/components/layout/accessibility_tree.rs index 2f3d7e1215d..87ab9491be1 100644 --- a/components/layout/accessibility_tree.rs +++ b/components/layout/accessibility_tree.rs @@ -6,7 +6,7 @@ use std::rc::Rc; use std::sync::LazyLock; pub(crate) use accessibility_traits::AccessibilityTree; -use accesskit::{Node as AxNode, NodeId as AxNodeId, Role, Tree as AxTree}; +use accesskit::{Action, Node as AxNode, NodeId as AxNodeId, Role, Tree as AxTree}; use html5ever::{LocalName, local_name}; use layout_api::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode}; use log::trace; @@ -77,6 +77,7 @@ impl AccessibilityTreeCalculator { } } } + ax_next.add_action(Action::Click); ax_nodes.insert(ax_next_id, ax_next); } AccessibilityTree { diff --git a/ports/servoshell/desktop/app.rs b/ports/servoshell/desktop/app.rs index 82c318c126f..7e7afb5b57d 100644 --- a/ports/servoshell/desktop/app.rs +++ b/ports/servoshell/desktop/app.rs @@ -213,7 +213,7 @@ impl ApplicationHandler for App { .and_then(|window_id| state.window(ServoShellWindowId::from(u64::from(window_id)))) { if let Some(headed_window) = window.platform_window().as_headed_window() { - headed_window.handle_winit_app_event(app_event); + headed_window.handle_winit_app_event(&window, app_event); } } diff --git a/ports/servoshell/desktop/headed_window.rs b/ports/servoshell/desktop/headed_window.rs index b1689cb37f0..42b1ca7e6fc 100644 --- a/ports/servoshell/desktop/headed_window.rs +++ b/ports/servoshell/desktop/headed_window.rs @@ -758,8 +758,21 @@ impl HeadedWindow { } } - pub(crate) fn handle_winit_app_event(&self, app_event: AppEvent) { + pub(crate) fn handle_winit_app_event(&self, _window: &ServoShellWindow, app_event: AppEvent) { if let AppEvent::Accessibility(ref event) = app_event { + match &event.window_event { + egui_winit::accesskit_winit::WindowEvent::InitialTreeRequested => { + // TODO get the initial tree from servo + }, + egui_winit::accesskit_winit::WindowEvent::ActionRequested(req) => { + // TODO use window to get active webview, then do something with action request. + if req.target_tree != TreeId::ROOT { + println!("{:?}", req); + } + }, + _ => {}, + } + if self .gui .borrow_mut()