style: Also print the class name when logging elements.

Bug: 1368240
MozReview-Commit-ID: 1MSn4rty5RL
This commit is contained in:
Emilio Cobos Álvarez 2017-06-09 17:19:50 +02:00
parent 151b636562
commit fd10729941
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -408,6 +408,24 @@ impl<'le> fmt::Debug for GeckoElement<'le> {
if let Some(id) = self.get_id() {
try!(write!(f, " id={}", id));
}
let mut first = true;
let mut any = false;
self.each_class(|c| {
if first {
first = false;
any = true;
let _ = f.write_str(" class=\"");
} else {
let _ = f.write_str(" ");
}
let _ = write!(f, "{}", c);
});
if any {
f.write_str("\"")?;
}
write!(f, "> ({:#x})", self.as_node().opaque().0)
}
}