Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layout: Modify styles for replaced content as appropriate during incremental flow construction. #6492

Merged
merged 4 commits into from Jul 7, 2015
Merged

layout: Make the output of flow tree dumping easier to read when there

are many fragments.
  • Loading branch information
pcwalton committed Jul 7, 2015
commit c84368b703d533eec3b55231eb01d8a708bb7e5b
@@ -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, ")")
}
}
@@ -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(())
}
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.