mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Also print the class name when logging elements.
Bug: 1368240 MozReview-Commit-ID: 1MSn4rty5RL
This commit is contained in:
parent
151b636562
commit
fd10729941
1 changed files with 18 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue