diff options
-rw-r--r-- | components/layout/fragment.rs | 18 | ||||
-rw-r--r-- | components/layout/inline.rs | 5 |
2 files changed, 20 insertions, 3 deletions
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 91cc9ddfb26..b9a2713b9a4 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -208,6 +208,19 @@ impl SpecificFragmentInfo { } } +impl fmt::Debug for SpecificFragmentInfo { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + SpecificFragmentInfo::ScannedText(ref info) => { + write!(f, " \"{}\"", info.run.text.slice_chars(info.range.begin().get() as usize, + info.range.end().get() as usize)); + } + _ => {} + } + Ok(()) + } +} + /// Clamp a value obtained from style_length, based on min / max lengths. fn clamp_size(size: Au, min_size: LengthOrPercentage, @@ -2120,10 +2133,11 @@ impl Fragment { impl fmt::Debug for Fragment { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { try!(write!(f, "({} {} ", self.debug_id(), self.specific.get_type())); - try!(write!(f, "bb {:?} bp {:?} m {:?}", + try!(write!(f, "bb {:?} bp {:?} m {:?}{:?}", self.border_box, self.border_padding, - self.margin)); + self.margin, + self.specific)); write!(f, ")") } } diff --git a/components/layout/inline.rs b/components/layout/inline.rs index 73c51134178..b16d075a738 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -689,7 +689,10 @@ pub struct InlineFragments { impl fmt::Debug for InlineFragments { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{:?}", self.fragments) + for fragment in self.fragments.iter() { + try!(write!(f, "\n * {:?}", fragment)) + } + Ok(()) } } |