mirror of
https://github.com/servo/servo.git
synced 2025-09-05 20:48:22 +01:00
Add some fmt::Debug implementations
This commit is contained in:
parent
477cae67df
commit
bc71e8b65b
7 changed files with 59 additions and 4 deletions
|
@ -34,6 +34,7 @@ use selectors::matching::DeclarationBlock;
|
|||
use selectors::parser::{AttrSelector, NamespaceConstraint};
|
||||
use snapshot::GeckoElementSnapshot;
|
||||
use snapshot_helpers;
|
||||
use std::fmt;
|
||||
use std::marker::PhantomData;
|
||||
use std::ops::BitOr;
|
||||
use std::ptr;
|
||||
|
@ -382,6 +383,16 @@ pub struct GeckoElement<'le> {
|
|||
chain: PhantomData<&'le ()>,
|
||||
}
|
||||
|
||||
impl<'le> fmt::Debug for GeckoElement<'le> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
try!(write!(f, "<{}", self.get_local_name()));
|
||||
if let Some(id) = self.get_id() {
|
||||
try!(write!(f, " id={}", id));
|
||||
}
|
||||
write!(f, ">")
|
||||
}
|
||||
}
|
||||
|
||||
impl<'le> GeckoElement<'le> {
|
||||
pub unsafe fn from_raw(el: *mut RawGeckoElement) -> GeckoElement<'le> {
|
||||
GeckoElement {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue