mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Account for a few more cases in the node's debug-formatting code.
This commit is contained in:
parent
a19219ec79
commit
56fc1a6649
1 changed files with 15 additions and 7 deletions
|
@ -170,14 +170,22 @@ impl<'ln> PartialEq for GeckoNode<'ln> {
|
|||
impl<'ln> fmt::Debug for GeckoNode<'ln> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
if let Some(el) = self.as_element() {
|
||||
el.fmt(f)
|
||||
} else {
|
||||
if self.is_text_node() {
|
||||
write!(f, "<text node> ({:#x})", self.opaque().0)
|
||||
} else {
|
||||
write!(f, "<non-text node> ({:#x})", self.opaque().0)
|
||||
}
|
||||
return el.fmt(f)
|
||||
}
|
||||
|
||||
if self.is_text_node() {
|
||||
return write!(f, "<text node> ({:#x})", self.opaque().0)
|
||||
}
|
||||
|
||||
if self.is_document() {
|
||||
return write!(f, "<document> ({:#x})", self.opaque().0)
|
||||
}
|
||||
|
||||
if self.is_shadow_root() {
|
||||
return write!(f, "<shadow-root> ({:#x})", self.opaque().0)
|
||||
}
|
||||
|
||||
write!(f, "<non-text node> ({:#x})", self.opaque().0)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue