Get rendering back to parity with master

This commit is contained in:
Patrick Walton 2013-02-28 15:38:34 -08:00
parent cf3917f5b1
commit 416e870385
5 changed files with 12 additions and 7 deletions

View file

@ -44,7 +44,9 @@ impl DisplayItem {
fn draw_into_context(&self, ctx: &RenderContext) { fn draw_into_context(&self, ctx: &RenderContext) {
match self { match self {
&SolidColor(_, color) => ctx.draw_solid_color(&self.d().bounds, color), &SolidColor(_, color) => {
ctx.draw_solid_color(&self.d().bounds, color)
}
&Text(_, ref run, ref range, color) => { &Text(_, ref run, ref range, color) => {
debug!("drawing text at %?", self.d().bounds); debug!("drawing text at %?", self.d().bounds);
let new_run = @run.deserialize(ctx.font_ctx); let new_run = @run.deserialize(ctx.font_ctx);
@ -57,7 +59,9 @@ impl DisplayItem {
debug!("drawing image at %?", self.d().bounds); debug!("drawing image at %?", self.d().bounds);
ctx.draw_image(self.d().bounds, clone_arc(img)); ctx.draw_image(self.d().bounds, clone_arc(img));
} }
&Border(_, width, color) => ctx.draw_border(&self.d().bounds, width, color), &Border(_, width, color) => {
ctx.draw_border(&self.d().bounds, width, color)
}
} }
debug!("%?", { debug!("%?", {

View file

@ -124,7 +124,7 @@ pub struct Text {
impl Text { impl Text {
static pub fn new(text: ~str) -> Text { static pub fn new(text: ~str) -> Text {
Text { Text {
parent: Node::new(CommentNodeTypeId), parent: Node::new(TextNodeTypeId),
text: text text: text
} }
} }
@ -186,6 +186,7 @@ impl AbstractNode {
} }
child_n.prev_sibling = parent_n.last_child; child_n.prev_sibling = parent_n.last_child;
parent_n.last_child = Some(child);
} }
} }
} }

View file

@ -430,8 +430,7 @@ impl RenderBox {
} }
}, },
// TODO: items for background, border, outline // TODO: items for background, border, outline
@GenericBox(_) => { @GenericBox(_) => {}
},
@ImageBox(_, ref i) => { @ImageBox(_, ref i) => {
match i.get_image() { match i.get_image() {
Some(image) => { Some(image) => {

View file

@ -280,8 +280,8 @@ impl LayoutTreeBuilder {
fn next_box_id(&self) -> int { self.next_bid += 1; self.next_bid } fn next_box_id(&self) -> int { self.next_bid += 1; self.next_bid }
fn next_flow_id(&self) -> int { self.next_cid += 1; self.next_cid } fn next_flow_id(&self) -> int { self.next_cid += 1; self.next_cid }
/** Creates necessary box(es) and flow context(s) for the current DOM node, /// Creates necessary box(es) and flow context(s) for the current DOM node,
and recurses on its children. */ /// and recurses on its children.
fn construct_recursively(&self, fn construct_recursively(&self,
layout_ctx: &LayoutContext, layout_ctx: &LayoutContext,
cur_node: AbstractNode, cur_node: AbstractNode,

View file

@ -74,3 +74,4 @@ impl FlowDisplayListBuilderMethods for FlowContext {
} }
} }
} }