1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 11:07:35 +00:00

LibWeb+LibWebView+WebContent: Separate tag/attribute in Inspector menu

It was a bit short-sighted to combine the tag and attribute names into
one string when the Inspector requests a context menu. We will want both
values for some context menu actions. Send both names, as well as the
attribute value, when requesting the context menu.
This commit is contained in:
Timothy Flynn 2023-12-06 09:34:53 -05:00 committed by Andreas Kling
parent c9f0f0fc70
commit 8162dc5ee6
16 changed files with 80 additions and 58 deletions

View file

@ -33,7 +33,7 @@ public:
Function<void(Gfx::IntPoint)> on_requested_dom_node_text_context_menu;
Function<void(Gfx::IntPoint, String const&)> on_requested_dom_node_tag_context_menu;
Function<void(Gfx::IntPoint, String const&)> on_requested_dom_node_attribute_context_menu;
Function<void(Gfx::IntPoint, String const&, Attribute const&)> on_requested_dom_node_attribute_context_menu;
private:
void load_inspector();
@ -61,8 +61,12 @@ private:
bool m_dom_tree_loaded { false };
Optional<i32> m_context_menu_dom_node_id;
Optional<String> m_context_menu_tag_or_attribute_name;
struct ContextMenuData {
i32 dom_node_id { 0 };
Optional<String> tag;
Optional<Attribute> attribute;
};
Optional<ContextMenuData> m_context_menu_data;
i32 m_highest_notified_message_index { -1 };
i32 m_highest_received_message_index { -1 };