LibDevTools: Associate node actors with a DOM node identifier

This is a prepatory commit to be able to handle DOM mutations. Once a
node actor is created, the DOM node it is created for must continue to
be associated with the same actor even after DOM mutations. This change
stores an identifier on the node actor, and only creates new actors when
an actor for a node does not exist.
This commit is contained in:
Timothy Flynn 2025-03-06 19:49:27 -05:00 committed by Andreas Kling
commit ddea67034f
Notes: github-actions[bot] 2025-03-08 00:28:03 +00:00
6 changed files with 80 additions and 28 deletions

View file

@ -102,7 +102,7 @@ void PageStyleActor::inspect_dom_node(StringView node_actor, Callback&& callback
auto block_token = block_responses();
devtools().delegate().inspect_dom_node(
dom_node->tab->description(), dom_node->id, dom_node->pseudo_element,
dom_node->tab->description(), dom_node->identifier.id, dom_node->identifier.pseudo_element,
[weak_self = make_weak_ptr<PageStyleActor>(), block_token = move(block_token), callback = forward<Callback>(callback)](ErrorOr<DOMNodeProperties> properties) mutable {
if (properties.is_error()) {
dbgln_if(DEVTOOLS_DEBUG, "Unable to inspect DOM node: {}", properties.error());