summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorJonah <jonahshafran@gmail.com>2022-12-07 19:30:37 -0600
committerSam Atkins <atkinssj@gmail.com>2023-01-07 10:51:53 +0000
commit367b1634fd4a0c3764d1f618b8045a5d15096a07 (patch)
tree51da839eac518db23070284a1ba9f9ba4788a1f2 /Userland/Services
parenta469bbd1786db749e63f081fc7e0fe193f37090b (diff)
downloadserenity-367b1634fd4a0c3764d1f618b8045a5d15096a07.zip
LibWebView+WebContent: Expose the Accessibility Tree to Other Processes
This patch also stubs out notify_server_did_get_accessiblity_tree in ladybird since ViewImplementation now has it. However, this feature is still immature, so just stubbing out in ladybird for now. Once we have more robust support in Serenity (namely ARIA properties/state and accessible names and descriptions) we can port this functionality over.
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/WebContent/ConnectionFromClient.cpp7
-rw-r--r--Userland/Services/WebContent/ConnectionFromClient.h1
-rw-r--r--Userland/Services/WebContent/WebContentClient.ipc1
-rw-r--r--Userland/Services/WebContent/WebContentServer.ipc1
4 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp
index e4f9da7229..ddd2b60553 100644
--- a/Userland/Services/WebContent/ConnectionFromClient.cpp
+++ b/Userland/Services/WebContent/ConnectionFromClient.cpp
@@ -595,4 +595,11 @@ void ConnectionFromClient::prompt_closed(DeprecatedString const& response)
m_page_host->prompt_closed(response);
}
+void ConnectionFromClient::inspect_accessibility_tree()
+{
+ if (auto* doc = page().top_level_browsing_context().active_document()) {
+ async_did_get_accessibility_tree(doc->dump_accessibility_tree_as_json());
+ }
+}
+
}
diff --git a/Userland/Services/WebContent/ConnectionFromClient.h b/Userland/Services/WebContent/ConnectionFromClient.h
index fa354309bd..45d1963b0e 100644
--- a/Userland/Services/WebContent/ConnectionFromClient.h
+++ b/Userland/Services/WebContent/ConnectionFromClient.h
@@ -68,6 +68,7 @@ private:
virtual void get_source() override;
virtual void inspect_dom_tree() override;
virtual Messages::WebContentServer::InspectDomNodeResponse inspect_dom_node(i32 node_id, Optional<Web::CSS::Selector::PseudoElement> const& pseudo_element) override;
+ virtual void inspect_accessibility_tree() override;
virtual Messages::WebContentServer::GetHoveredNodeIdResponse get_hovered_node_id() override;
virtual Messages::WebContentServer::DumpLayoutTreeResponse dump_layout_tree() override;
virtual void set_content_filters(Vector<DeprecatedString> const&) override;
diff --git a/Userland/Services/WebContent/WebContentClient.ipc b/Userland/Services/WebContent/WebContentClient.ipc
index 6d57963904..98811b3645 100644
--- a/Userland/Services/WebContent/WebContentClient.ipc
+++ b/Userland/Services/WebContent/WebContentClient.ipc
@@ -38,6 +38,7 @@ endpoint WebContentClient
did_get_source(URL url, DeprecatedString source) =|
did_get_dom_tree(DeprecatedString dom_tree) =|
did_get_dom_node_properties(i32 node_id, DeprecatedString computed_style, DeprecatedString resolved_style, DeprecatedString custom_properties, DeprecatedString node_box_sizing_json) =|
+ did_get_accessibility_tree(DeprecatedString accessibility_tree) =|
did_change_favicon(Gfx::ShareableBitmap favicon) =|
did_request_all_cookies(URL url) => (Vector<Web::Cookie::Cookie> cookies)
did_request_named_cookie(URL url, DeprecatedString name) => (Optional<Web::Cookie::Cookie> cookie)
diff --git a/Userland/Services/WebContent/WebContentServer.ipc b/Userland/Services/WebContent/WebContentServer.ipc
index 55f5a43a1c..5362651a3c 100644
--- a/Userland/Services/WebContent/WebContentServer.ipc
+++ b/Userland/Services/WebContent/WebContentServer.ipc
@@ -37,6 +37,7 @@ endpoint WebContentServer
get_source() =|
inspect_dom_tree() =|
inspect_dom_node(i32 node_id, Optional<Web::CSS::Selector::PseudoElement> pseudo_element) => (bool has_style, DeprecatedString computed_style, DeprecatedString resolved_style, DeprecatedString custom_properties, DeprecatedString node_box_sizing)
+ inspect_accessibility_tree() =|
get_hovered_node_id() => (i32 node_id)
js_console_input(DeprecatedString js_source) =|
js_console_request_messages(i32 start_index) =|