mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Cleanup various debug output.
This commit is contained in:
parent
be53bb14f7
commit
e01ffd9477
4 changed files with 11 additions and 20 deletions
|
@ -91,14 +91,14 @@ impl LayoutTreeBuilder {
|
||||||
|
|
||||||
// if this is a new flow, attach to parent flow and make a new BuilderContext.
|
// if this is a new flow, attach to parent flow and make a new BuilderContext.
|
||||||
if !core::box::ptr_eq(next_flow, parent_ctx.flow) {
|
if !core::box::ptr_eq(next_flow, parent_ctx.flow) {
|
||||||
debug!("using parent builder context");
|
debug!("LayoutTreeBuilder: using parent builder context");
|
||||||
debug!("Adding child flow f%? of f%?",
|
debug!("LayoutTreeBuilder: Adding child flow f%? of f%?",
|
||||||
parent_ctx.flow.d().id, next_flow.d().id);
|
parent_ctx.flow.d().id, next_flow.d().id);
|
||||||
FlowTree.add_child(parent_ctx.flow, next_flow);
|
FlowTree.add_child(parent_ctx.flow, next_flow);
|
||||||
|
|
||||||
builder_ctx = { flow: next_flow, consumer: BoxConsumer(next_flow) };
|
builder_ctx = { flow: next_flow, consumer: BoxConsumer(next_flow) };
|
||||||
} else {
|
} else {
|
||||||
debug!("creating fresh builder context");
|
debug!("LayoutTreeBuilder: creating fresh builder context");
|
||||||
builder_ctx = copy *parent_ctx;
|
builder_ctx = copy *parent_ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ impl LayoutTreeBuilder {
|
||||||
do cur_node.aux |data| { data.flow = Some(builder_ctx.flow) }
|
do cur_node.aux |data| { data.flow = Some(builder_ctx.flow) }
|
||||||
|
|
||||||
let new_box = self.make_box(layout_ctx, box_type, cur_node, builder_ctx.flow);
|
let new_box = self.make_box(layout_ctx, box_type, cur_node, builder_ctx.flow);
|
||||||
debug!("Assign ^box to flow: %?", builder_ctx.flow.debug_str());
|
debug!("LayoutTreeBuilder: Assign ^box to flow f%d", builder_ctx.flow.d().id);
|
||||||
builder_ctx.consumer.push_box(layout_ctx, new_box);
|
builder_ctx.consumer.push_box(layout_ctx, new_box);
|
||||||
|
|
||||||
// recurse on child nodes.
|
// recurse on child nodes.
|
||||||
|
@ -193,7 +193,7 @@ impl LayoutTreeBuilder {
|
||||||
Flow_Root => @RootFlow(data, RootFlowData()),
|
Flow_Root => @RootFlow(data, RootFlowData()),
|
||||||
Flow_Table => @TableFlow(data)
|
Flow_Table => @TableFlow(data)
|
||||||
};
|
};
|
||||||
debug!("Created context: %s", ret.debug_str());
|
debug!("LayoutTreeBuilder: created flow: %s", ret.debug_str());
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ impl LayoutTreeBuilder {
|
||||||
RenderBox_Text => self.make_text_box(layout_ctx, node, ctx),
|
RenderBox_Text => self.make_text_box(layout_ctx, node, ctx),
|
||||||
RenderBox_Image => self.make_image_box(layout_ctx, node, ctx),
|
RenderBox_Image => self.make_image_box(layout_ctx, node, ctx),
|
||||||
};
|
};
|
||||||
debug!("Created box: %s", ret.debug_str());
|
debug!("LayoutTreeBuilder: created box: %s", ret.debug_str());
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -379,6 +379,6 @@ impl FlowContext : BoxedDebugMethods {
|
||||||
_ => ~"(Unknown flow)"
|
_ => ~"(Unknown flow)"
|
||||||
};
|
};
|
||||||
|
|
||||||
fmt!("c%? %?", self.d().id, repr)
|
fmt!("f%? %?", self.d().id, repr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,18 +222,14 @@ impl FlowContext : InlineLayout {
|
||||||
fn bubble_widths_inline(@self, ctx: &LayoutContext) {
|
fn bubble_widths_inline(@self, ctx: &LayoutContext) {
|
||||||
assert self.starts_inline_flow();
|
assert self.starts_inline_flow();
|
||||||
|
|
||||||
debug!("box count: %u", self.inline().boxes.len());
|
|
||||||
|
|
||||||
let scanner = TextRunScanner(self);
|
let scanner = TextRunScanner(self);
|
||||||
scanner.scan_for_runs(ctx);
|
scanner.scan_for_runs(ctx);
|
||||||
|
|
||||||
let mut min_width = au(0);
|
let mut min_width = au(0);
|
||||||
let mut pref_width = au(0);
|
let mut pref_width = au(0);
|
||||||
|
|
||||||
debug!("/box count: %u", self.inline().boxes.len());
|
|
||||||
|
|
||||||
for self.inline().boxes.each |box| {
|
for self.inline().boxes.each |box| {
|
||||||
debug!("measuring box: %s", box.debug_str());
|
debug!("FlowContext[%d]: measuring %s", self.d().id, box.debug_str());
|
||||||
min_width = au::max(min_width, box.get_min_width(ctx));
|
min_width = au::max(min_width, box.get_min_width(ctx));
|
||||||
pref_width = au::max(pref_width, box.get_pref_width(ctx));
|
pref_width = au::max(pref_width, box.get_pref_width(ctx));
|
||||||
}
|
}
|
||||||
|
@ -315,11 +311,12 @@ impl FlowContext : InlineLayout {
|
||||||
assert self.starts_inline_flow();
|
assert self.starts_inline_flow();
|
||||||
|
|
||||||
// TODO: if the CSS box introducing this inline context is *not* anonymous,
|
// TODO: if the CSS box introducing this inline context is *not* anonymous,
|
||||||
// we need to draw it too, in a way similar to BlowFlowContext
|
// we need to draw it too, in a way similar to BlockFlowContext
|
||||||
|
|
||||||
// TODO: once we form line boxes and have their cached bounds, we can be
|
// TODO: once we form line boxes and have their cached bounds, we can be
|
||||||
// smarter and not recurse on a line if nothing in it can intersect dirty
|
// smarter and not recurse on a line if nothing in it can intersect dirty
|
||||||
debug!("building display list for %u inline boxes", self.inline().boxes.len());
|
debug!("FlowContext[%d]: building display list for %u inline boxes",
|
||||||
|
self.d().id, self.inline().boxes.len());
|
||||||
for self.inline().boxes.each |box| {
|
for self.inline().boxes.each |box| {
|
||||||
box.build_display_list(builder, dirty, offset, list)
|
box.build_display_list(builder, dirty, offset, list)
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,6 @@ impl TextRun {
|
||||||
assert offset < self.text.len();
|
assert offset < self.text.len();
|
||||||
assert offset + length <= self.text.len();
|
assert offset + length <= self.text.len();
|
||||||
|
|
||||||
debug!("enter min_width_for_range(o=%?, l=%?)", offset, length);
|
|
||||||
|
|
||||||
let mut max_piece_width = au(0);
|
let mut max_piece_width = au(0);
|
||||||
// TODO: use a real font reference
|
// TODO: use a real font reference
|
||||||
let font = ctx.font_cache.get_test_font();
|
let font = ctx.font_cache.get_test_font();
|
||||||
|
@ -38,7 +36,6 @@ impl TextRun {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
debug!("exit min_width_for_range(o=%?, l=%?)", offset, length);
|
|
||||||
return max_piece_width;
|
return max_piece_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,8 +75,6 @@ impl TextRun {
|
||||||
assert offset < self.text.len();
|
assert offset < self.text.len();
|
||||||
assert offset + length <= self.text.len();
|
assert offset + length <= self.text.len();
|
||||||
|
|
||||||
debug!("enter iter_indivisible_pieces_for_range(o=%?, l=%?)", offset, length);
|
|
||||||
|
|
||||||
//TODO: need a more sophisticated model of words and possible breaks
|
//TODO: need a more sophisticated model of words and possible breaks
|
||||||
let text = str::view(self.text, offset, length);
|
let text = str::view(self.text, offset, length);
|
||||||
|
|
||||||
|
@ -122,7 +117,6 @@ impl TextRun {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
debug!("exit iter_indivisible_pieces_for_range(o=%?, l=%?)", offset, length);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue