DevTools: Allow modification of attributes (#32888)

* feat: allow modification of attributes

Signed-off-by: eri <eri@inventati.org>

* fix: tidiness

Signed-off-by: eri <eri@inventati.org>

* feat: clean walker name generation

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: eri <eri@inventati.org>

* fix: missed out parameter

Signed-off-by: eri <eri@inventati.org>

---------

Signed-off-by: eri <eri@inventati.org>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
eri 2024-08-05 12:24:01 +02:00 committed by GitHub
parent 4d49b04668
commit babc844c93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 121 additions and 12 deletions

View file

@ -86,14 +86,27 @@ impl Actor for InspectorActor {
self.script_chan.send(GetRootNode(pipeline, tx)).unwrap();
let root_info = rx.recv().unwrap().ok_or(())?;
let root = root_info.encode(registry, false, self.script_chan.clone(), pipeline);
let name = self
.walker
.borrow()
.clone()
.unwrap_or_else(|| registry.new_name("walker"));
let root = root_info.encode(
registry,
false,
self.script_chan.clone(),
pipeline,
name.clone(),
);
if self.walker.borrow().is_none() {
let walker = WalkerActor {
name: registry.new_name("walker"),
name,
script_chan: self.script_chan.clone(),
pipeline,
root_node: root.clone(),
mutations: RefCell::new(vec![]),
};
let mut walker_name = self.walker.borrow_mut();
*walker_name = Some(walker.name());