aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authoreri <eri@inventati.org>2024-07-26 17:17:54 +0200
committerGitHub <noreply@github.com>2024-07-26 15:17:54 +0000
commit902bf5733139ba6269e4f10c52ae62e0eea4a4c0 (patch)
tree223d9ecab6fab047675ce40328683795056c6397 /components/script
parentf7448b5d6121339508a5cbc31e1da2db704da371 (diff)
downloadservo-902bf5733139ba6269e4f10c52ae62e0eea4a4c0.tar.gz
servo-902bf5733139ba6269e4f10c52ae62e0eea4a4c0.zip
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>
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/node.rs18
1 files changed, 3 insertions, 15 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 635d1cdf245..5e818348665 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -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
}
}