mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +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:
parent
d4b7dd88b7
commit
72905c84d5
Notes:
github-actions[bot]
2025-02-24 17:07:12 +00:00
Author: https://github.com/trflynn89
Commit: 72905c84d5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3666
Reviewed-by: https://github.com/AtkinsSJ
10 changed files with 83 additions and 34 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue