devtools: Support getting XPath selector for node actor (#39892)

You can copy the XPath selector from the inspector by right-clicking on
a node and selecting `Copy->XPath`.

Testing: I tried adding a test but the effort didn't seem worth it. The
devtools tests are currently very specifically tailored towards
source-list tests.

Part of https://github.com/servo/servo/issues/39862
Part of #34527

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker
2025-10-25 06:38:49 +02:00
committed by GitHub
parent 3f8d4eba46
commit 13a66f7560
4 changed files with 104 additions and 5 deletions

View File

@@ -2107,6 +2107,9 @@ impl ScriptThread {
DevtoolScriptControlMsg::GetLayout(id, node_id, reply) => {
devtools::handle_get_layout(&documents, id, node_id, reply, can_gc)
},
DevtoolScriptControlMsg::GetXPath(id, node_id, reply) => {
devtools::handle_get_xpath(&documents, id, node_id, reply)
},
DevtoolScriptControlMsg::ModifyAttribute(id, node_id, modifications) => {
devtools::handle_modify_attribute(&documents, id, node_id, modifications, can_gc)
},