1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

LibWebView+WebContent: Make the DOM node editing IPCs async

All DOM node mutation IPCs now invoke an async completion IPC after the
DOM is mutated. This allows consolidating where the Inspector updates
its view and the selected DOM node.

This also allows improving the response to removing a DOM node. We would
previously just select the <body> tag after removing a DOM node because
the Inspector client had no idea what node preceded the removed node.
Now the WebContent process can just indicate what that node is. So now
after removing a DOM node, we inspect either its previous sibling (if it
had one) or its parent.
This commit is contained in:
Timothy Flynn 2023-12-30 10:08:33 -05:00 committed by Andreas Kling
parent 1eba170d03
commit 3572a047d1
9 changed files with 91 additions and 69 deletions

View file

@ -77,12 +77,12 @@ private:
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;
virtual void set_dom_node_tag(i32 node_id, String const& name) override;
virtual void add_dom_node_attributes(i32 node_id, Vector<WebView::Attribute> const& attributes) override;
virtual void replace_dom_node_attribute(i32 node_id, String const& name, Vector<WebView::Attribute> const& replacement_attributes) override;
virtual Messages::WebContentServer::CreateChildElementResponse create_child_element(i32 node_id) override;
virtual Messages::WebContentServer::CreateChildTextNodeResponse create_child_text_node(i32 node_id) override;
virtual Messages::WebContentServer::CloneDomNodeResponse clone_dom_node(i32 node_id) override;
virtual void create_child_element(i32 node_id) override;
virtual void create_child_text_node(i32 node_id) override;
virtual void clone_dom_node(i32 node_id) override;
virtual void remove_dom_node(i32 node_id) override;
virtual Messages::WebContentServer::GetDomNodeHtmlResponse get_dom_node_html(i32 node_id) override;