From c8a69b9d766d400a944c50f2683fb307a8644252 Mon Sep 17 00:00:00 2001 From: "Brian J. Burg" Date: Wed, 10 Oct 2012 12:23:07 -0700 Subject: [PATCH] Revert the addition of accept_new_box() implementations for each flow type. --- src/servo/layout/block.rs | 9 --------- src/servo/layout/flow.rs | 10 ---------- src/servo/layout/inline.rs | 8 -------- src/servo/layout/root.rs | 9 --------- 4 files changed, 36 deletions(-) diff --git a/src/servo/layout/block.rs b/src/servo/layout/block.rs index ac75961c176..9531dd07ced 100644 --- a/src/servo/layout/block.rs +++ b/src/servo/layout/block.rs @@ -27,8 +27,6 @@ trait BlockLayout { fn bubble_widths_block(@self, ctx: &LayoutContext); fn assign_widths_block(@self, ctx: &LayoutContext); fn assign_height_block(@self, ctx: &LayoutContext); - fn accept_new_box_block(@self, ctx: &LayoutContext, @RenderBox); - fn build_display_list_block(@self, a: &dl::DisplayListBuilder, b: &Rect, c: &Point2D, d: &dl::DisplayList); } @@ -143,13 +141,6 @@ impl FlowContext : BlockLayout { } } - fn accept_new_box_block(@self, _ctx: &LayoutContext, box: @RenderBox) { - assert self.starts_block_flow(); - assert self.block().box.is_none(); - - self.block().box = Some(box); - } - fn build_display_list_block(@self, builder: &dl::DisplayListBuilder, dirty: &Rect, offset: &Point2D, list: &dl::DisplayList) { diff --git a/src/servo/layout/flow.rs b/src/servo/layout/flow.rs index 9a7a7a195a4..0fda10db7c9 100644 --- a/src/servo/layout/flow.rs +++ b/src/servo/layout/flow.rs @@ -70,7 +70,6 @@ trait FlowContextMethods { fn bubble_widths(@self, &LayoutContext); fn assign_widths(@self, &LayoutContext); fn assign_height(@self, &LayoutContext); - fn accept_new_box(@self, &LayoutContext, @RenderBox); fn build_display_list_recurse(@self, &dl::DisplayListBuilder, dirty: &Rect, offset: &Point2D, &dl::DisplayList); pure fn foldl_boxes_for_node(Node, +seed: B, cb: pure fn&(+a: B,@RenderBox) -> B) -> B; @@ -196,15 +195,6 @@ impl FlowContext : FlowContextMethods { } } - fn accept_new_box(@self, ctx: &LayoutContext, box: @RenderBox) { - match self { - @BlockFlow(*) => self.accept_new_box_block(ctx, box), - @InlineFlow(*) => self.accept_new_box_inline(ctx, box), - @RootFlow(*) => self.accept_new_box_root(ctx, box), - _ => fail fmt!("Tried to accept_new_box of flow: %?", self) - } - } - fn build_display_list_recurse(@self, builder: &dl::DisplayListBuilder, dirty: &Rect, offset: &Point2D, list: &dl::DisplayList) { match self { diff --git a/src/servo/layout/inline.rs b/src/servo/layout/inline.rs index 71c977dfeed..1f6f2de8157 100644 --- a/src/servo/layout/inline.rs +++ b/src/servo/layout/inline.rs @@ -190,7 +190,6 @@ trait InlineLayout { fn bubble_widths_inline(@self, ctx: &LayoutContext); fn assign_widths_inline(@self, ctx: &LayoutContext); fn assign_height_inline(@self, ctx: &LayoutContext); - fn accept_new_box_inline(@self, &LayoutContext, @RenderBox); fn build_display_list_inline(@self, a: &dl::DisplayListBuilder, b: &Rect, c: &Point2D, d: &dl::DisplayList); } @@ -287,13 +286,6 @@ impl FlowContext : InlineLayout { // during inline flowing. } - fn accept_new_box_inline(@self, _ctx: &LayoutContext, box: @RenderBox) { - assert self.starts_inline_flow(); - - self.inline().boxes.push(box); - // TODO: use the boxlistbuilder - } - fn build_display_list_inline(@self, builder: &dl::DisplayListBuilder, dirty: &Rect, offset: &Point2D, list: &dl::DisplayList) { diff --git a/src/servo/layout/root.rs b/src/servo/layout/root.rs index 24073333b0e..1c5cd2f3d29 100644 --- a/src/servo/layout/root.rs +++ b/src/servo/layout/root.rs @@ -25,8 +25,6 @@ trait RootLayout { fn bubble_widths_root(@self, ctx: &LayoutContext); fn assign_widths_root(@self, ctx: &LayoutContext); fn assign_height_root(@self, ctx: &LayoutContext); - fn accept_new_box_root(@self, ctx: &LayoutContext, @RenderBox); - fn build_display_list_root(@self, a: &dl::DisplayListBuilder, b: &Rect, c: &Point2D, d: &dl::DisplayList); } @@ -59,13 +57,6 @@ impl FlowContext : RootLayout { self.assign_height_block(ctx); } - fn accept_new_box_root(@self, _ctx: &LayoutContext, box: @RenderBox) { - assert self.starts_root_flow(); - assert self.root().box.is_none(); - - self.root().box = Some(box); - } - fn build_display_list_root(@self, builder: &dl::DisplayListBuilder, dirty: &Rect, offset: &Point2D, list: &dl::DisplayList) { assert self.starts_root_flow();