mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
LibWeb+LibWebView+WebContent: Support both inspecting/highlighting nodes
Our own Inspector differs from most other DevTools implementations with regard to highlighting DOM nodes as you hover elements in the inspected DOM tree. In other implementations, as you change the hovered node, the browser will render a box model overlay onto the page for that node. We currently don't do this; we wait until you click the node, at which point we both paint the overlay and inspect the node's properties. This patch does not change that behavior, but separates the IPCs and internal tracking of inspected nodes to support the standard DevTools behavior. So the DOM document now stores an inspected node and a highlighted node. The former is used for features such as "$0" in the JavaScript console, and the latter is used for the box model overlay. Our Inspector continues to set these to the same node.
This commit is contained in:
@@ -103,11 +103,15 @@ public:
|
||||
void get_source();
|
||||
|
||||
void inspect_dom_tree();
|
||||
void inspect_dom_node(Web::UniqueNodeID node_id, Optional<Web::CSS::Selector::PseudoElement::Type> pseudo_element);
|
||||
void inspect_accessibility_tree();
|
||||
void clear_inspected_dom_node();
|
||||
void get_hovered_node_id();
|
||||
|
||||
void inspect_dom_node(Web::UniqueNodeID node_id, Optional<Web::CSS::Selector::PseudoElement::Type> pseudo_element);
|
||||
void clear_inspected_dom_node();
|
||||
|
||||
void highlight_dom_node(Web::UniqueNodeID node_id, Optional<Web::CSS::Selector::PseudoElement::Type> pseudo_element);
|
||||
void clear_highlighted_dom_node();
|
||||
|
||||
void set_dom_node_text(Web::UniqueNodeID node_id, String text);
|
||||
void set_dom_node_tag(Web::UniqueNodeID node_id, String name);
|
||||
void add_dom_node_attributes(Web::UniqueNodeID node_id, Vector<Attribute> attributes);
|
||||
|
||||
Reference in New Issue
Block a user