mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 20:47:45 +00:00
LibWebView+WebContent: Make the hovered node retrieval IPC async
This commit is contained in:
parent
760ba5932b
commit
1eba170d03
9 changed files with 26 additions and 12 deletions
|
@ -621,14 +621,16 @@ void ConnectionFromClient::inspect_accessibility_tree()
|
|||
}
|
||||
}
|
||||
|
||||
Messages::WebContentServer::GetHoveredNodeIdResponse ConnectionFromClient::get_hovered_node_id()
|
||||
void ConnectionFromClient::get_hovered_node_id()
|
||||
{
|
||||
i32 node_id = 0;
|
||||
|
||||
if (auto* document = page().page().top_level_browsing_context().active_document()) {
|
||||
auto hovered_node = document->hovered_node();
|
||||
if (hovered_node)
|
||||
return hovered_node->unique_id();
|
||||
if (auto* hovered_node = document->hovered_node())
|
||||
node_id = hovered_node->unique_id();
|
||||
}
|
||||
return (i32)0;
|
||||
|
||||
async_did_get_hovered_node_id(node_id);
|
||||
}
|
||||
|
||||
void ConnectionFromClient::set_dom_node_text(i32 node_id, String const& text)
|
||||
|
|
|
@ -74,7 +74,7 @@ private:
|
|||
virtual void inspect_dom_tree() override;
|
||||
virtual void inspect_dom_node(i32 node_id, Optional<Web::CSS::Selector::PseudoElement::Type> const& pseudo_element) override;
|
||||
virtual void inspect_accessibility_tree() override;
|
||||
virtual Messages::WebContentServer::GetHoveredNodeIdResponse get_hovered_node_id() override;
|
||||
virtual void get_hovered_node_id() override;
|
||||
|
||||
virtual void set_dom_node_text(i32 node_id, String const& text) override;
|
||||
virtual Messages::WebContentServer::SetDomNodeTagResponse set_dom_node_tag(i32 node_id, String const& name) override;
|
||||
|
|
|
@ -44,6 +44,7 @@ endpoint WebContentClient
|
|||
did_inspect_dom_tree(ByteString dom_tree) =|
|
||||
did_inspect_dom_node(bool has_style, ByteString computed_style, ByteString resolved_style, ByteString custom_properties, ByteString node_box_sizing, ByteString aria_properties_state) =|
|
||||
did_inspect_accessibility_tree(ByteString accessibility_tree) =|
|
||||
did_get_hovered_node_id(i32 node_id) =|
|
||||
|
||||
did_change_favicon(Gfx::ShareableBitmap favicon) =|
|
||||
did_request_all_cookies(URL url) => (Vector<Web::Cookie::Cookie> cookies)
|
||||
|
|
|
@ -40,7 +40,7 @@ endpoint WebContentServer
|
|||
inspect_dom_tree() =|
|
||||
inspect_dom_node(i32 node_id, Optional<Web::CSS::Selector::PseudoElement::Type> pseudo_element) =|
|
||||
inspect_accessibility_tree() =|
|
||||
get_hovered_node_id() => (i32 node_id)
|
||||
get_hovered_node_id() =|
|
||||
js_console_input(ByteString js_source) =|
|
||||
js_console_request_messages(i32 start_index) =|
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue