mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
DevTools: Show HTML tree (#32655)
* feat: watch root node Signed-off-by: eri <eri@inventati.org> * reafactor: divide inspector in components Signed-off-by: eri <eri@inventati.org> * feat: add css properties actor Signed-off-by: eri <eri@inventati.org> * feat: accesibility actor Signed-off-by: eri <eri@inventati.org> * feat: layout actor Signed-off-by: eri <eri@inventati.org> * feat: network parent and refactor Signed-off-by: eri <eri@inventati.org> * feat: progress on the inspector messages Signed-off-by: eri <eri@inventati.org> * feat: more progress on inspector Signed-off-by: eri <eri@inventati.org> * feat: try to fix nodes showing Signed-off-by: eri <eri@inventati.org> * feat: initial dom tree Signed-off-by: eri <eri@inventati.org> * feat: some more messages Signed-off-by: eri <eri@inventati.org> * feat: clean and add documentation Signed-off-by: eri <eri@inventati.org> * refactor: add more docs and clean Signed-off-by: eri <eri@inventati.org> * fix: restore deleted node attributes field Signed-off-by: eri <eri@inventati.org> * Apply suggestions from code review Fix a few nits in comments Signed-off-by: Martin Robinson <mrobinson@igalia.com> --------- Signed-off-by: eri <eri@inventati.org> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
f7448b5d61
commit
902bf57331
23 changed files with 1487 additions and 833 deletions
|
@ -1113,30 +1113,18 @@ impl Node {
|
|||
|
||||
pub fn summarize(&self) -> NodeInfo {
|
||||
let USVString(base_uri) = self.BaseURI();
|
||||
let node_type = self.NodeType();
|
||||
NodeInfo {
|
||||
unique_id: self.unique_id(),
|
||||
base_uri,
|
||||
parent: self
|
||||
.GetParentNode()
|
||||
.map_or("".to_owned(), |node| node.unique_id()),
|
||||
node_type: self.NodeType(),
|
||||
namespace_uri: String::new(), //FIXME
|
||||
node_type,
|
||||
is_top_level_document: node_type == NodeConstants::DOCUMENT_NODE,
|
||||
node_name: String::from(self.NodeName()),
|
||||
num_children: self.ChildNodes().Length() as usize,
|
||||
|
||||
//FIXME doctype nodes only
|
||||
name: String::new(),
|
||||
public_id: String::new(),
|
||||
system_id: String::new(),
|
||||
attrs: self.downcast().map(Element::summarize).unwrap_or(vec![]),
|
||||
|
||||
is_document_element: self
|
||||
.owner_doc()
|
||||
.GetDocumentElement()
|
||||
.map_or(false, |elem| elem.upcast::<Node>() == self),
|
||||
|
||||
short_value: self.GetNodeValue().map(String::from).unwrap_or_default(), //FIXME: truncate
|
||||
incomplete_value: false, //FIXME: reflect truncation
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue