1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:54:58 +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

@ -65,12 +65,12 @@ public:
void get_hovered_node_id();
void set_dom_node_text(i32 node_id, String text);
Optional<i32> set_dom_node_tag(i32 node_id, String name);
void set_dom_node_tag(i32 node_id, String name);
void add_dom_node_attributes(i32 node_id, Vector<Attribute> attributes);
void replace_dom_node_attribute(i32 node_id, String name, Vector<Attribute> replacement_attributes);
Optional<i32> create_child_element(i32 node_id);
Optional<i32> create_child_text_node(i32 node_id);
Optional<i32> clone_dom_node(i32 node_id);
void create_child_element(i32 node_id);
void create_child_text_node(i32 node_id);
void clone_dom_node(i32 node_id);
void remove_dom_node(i32 node_id);
Optional<String> get_dom_node_html(i32 node_id);
@ -144,6 +144,7 @@ public:
Function<void(Optional<DOMNodeProperties>)> on_received_dom_node_properties;
Function<void(ByteString const&)> on_received_accessibility_tree;
Function<void(i32 node_id)> on_received_hovered_node_id;
Function<void(Optional<i32> const& node_id)> on_finshed_editing_dom_node;
Function<void(i32 message_id)> on_received_console_message;
Function<void(i32 start_index, Vector<ByteString> const& message_types, Vector<ByteString> const& messages)> on_received_console_messages;
Function<Vector<Web::Cookie::Cookie>(AK::URL const& url)> on_get_all_cookies;