servo: Merge #10320 - Rename imm_child_iter() and child_iter() (from malayaleecoder:master); r=KiChjang
authormalayaleecoder <malayaleecoder@gmail.com>
Sat, 09 Apr 2016 03:25:10 +0500
changeset 338461 395e0a1740ebeea295104c174e2f2b7ccb9feb37
parent 338460 bc7e0b8097ece9c8cdf218722c1e51686e2ec72b
child 338462 1834fcc0d5e850fe448ca3e88615f2f21e2a3719
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersKiChjang
servo: Merge #10320 - Rename imm_child_iter() and child_iter() (from malayaleecoder:master); r=KiChjang Fixes #10286 Source-Repo: https://github.com/servo/servo Source-Revision: 0a1efe4578e43c4ffc2f90ff0118660899a83ac4
servo/components/layout/block.rs
servo/components/layout/flex.rs
servo/components/layout/flow.rs
servo/components/layout/inline.rs
servo/components/layout/layout_thread.rs
servo/components/layout/parallel.rs
servo/components/layout/sequential.rs
servo/components/layout/table.rs
servo/components/layout/table_row.rs
servo/components/layout/table_wrapper.rs
servo/components/layout/traversal.rs
--- a/servo/components/layout/block.rs
+++ b/servo/components/layout/block.rs
@@ -707,17 +707,17 @@ impl BlockFlow {
                 CollapsibleMargins::Collapse(block_start_margin, block_end_margin) => {
                     (block_start_margin.collapse(), block_end_margin.collapse())
                 }
                 CollapsibleMargins::None(block_start, block_end) => (block_start, block_end),
             };
 
         // Shift all kids down (or up, if margins are negative) if necessary.
         if block_start_margin_value != Au(0) {
-            for kid in self.base.child_iter() {
+            for kid in self.base.child_iter_mut() {
                 let kid_base = flow::mut_base(kid);
                 kid_base.position.start.b = kid_base.position.start.b + block_start_margin_value
             }
         }
 
         // FIXME(#2003, pcwalton): The max is taken here so that you can scroll the page, but this
         // is not correct behavior according to CSS 2.1 § 10.5. Instead I think we should treat the
         // root element as having `overflow: scroll` and use the layers-based scrolling
@@ -804,17 +804,17 @@ impl BlockFlow {
                 self.fragment.border_padding.block_start == Au(0);
             margin_collapse_info.initialize_block_start_margin(
                 &self.fragment,
                 can_collapse_block_start_margin_with_kids);
 
             // At this point, `cur_b` is at the content edge of our box. Now iterate over children.
             let mut floats = self.base.floats.clone();
             let thread_id = self.base.thread_id;
-            for (child_index, kid) in self.base.child_iter().enumerate() {
+            for (child_index, kid) in self.base.child_iter_mut().enumerate() {
                 if flow::base(kid).flags.contains(IS_ABSOLUTELY_POSITIONED) {
                     // Assume that the *hypothetical box* for an absolute flow starts immediately
                     // after the block-end border edge of the previous flow.
                     if flow::base(kid).flags.contains(BLOCK_POSITION_IS_STATIC) {
                         flow::mut_base(kid).position.start.b = cur_b +
                             flow::base(kid).collapsible_margins
                                            .block_start_margin_for_noncollapsible_context()
                     }
@@ -962,17 +962,17 @@ impl BlockFlow {
                 // dimensions later.
                 //
                 // FIXME(pcwalton): This looks not idempotent. Is it?
                 self.fragment.border_box.size.block = block_size;
             }
 
             // Write in the size of the relative containing block for children. (This information
             // is also needed to handle RTL.)
-            for kid in self.base.child_iter() {
+            for kid in self.base.child_iter_mut() {
                 flow::mut_base(kid).early_absolute_position_info = EarlyAbsolutePositionInfo {
                     relative_containing_block_size: self.fragment.content_box().size,
                     relative_containing_block_mode: self.fragment.style().writing_mode,
                 };
             }
 
             if self.base.flags.contains(IS_ABSOLUTELY_POSITIONED) {
                 return None
@@ -1012,17 +1012,17 @@ impl BlockFlow {
             // Store the current set of floats in the flow so that flows that come later in the
             // document can access them.
             self.base.floats = floats.clone();
             self.adjust_fragments_for_collapsed_margins_if_root(layout_context);
         } else {
             // We don't need to reflow, but we still need to perform in-order traversals if
             // necessary.
             let thread_id = self.base.thread_id;
-            for kid in self.base.child_iter() {
+            for kid in self.base.child_iter_mut() {
                 kid.assign_block_size_for_inorder_child_if_necessary(layout_context, thread_id);
             }
         }
 
         if (&*self as &Flow).contains_roots_of_absolute_flow_tree() {
             // Assign block-sizes for all flows in this absolute flow tree.
             // This is preorder because the block-size of an absolute flow may depend on
             // the block-size of its containing block, which may also be an absolute flow.
@@ -1325,17 +1325,17 @@ impl BlockFlow {
             content_inline_size
         };
         // FIXME (mbrubeck): Get correct mode for absolute containing block
         let containing_block_mode = self.base.writing_mode;
 
         let mut inline_start_margin_edge = inline_start_content_edge;
         let mut inline_end_margin_edge = inline_end_content_edge;
 
-        let mut iterator = self.base.child_iter().enumerate().peekable();
+        let mut iterator = self.base.child_iter_mut().enumerate().peekable();
         while let Some((i, kid)) = iterator.next() {
             flow::mut_base(kid).block_container_explicit_block_size = explicit_content_size;
 
             // The inline-start margin edge of the child flow is at our inline-start content edge,
             // and its inline-size is our content inline-size.
             let kid_mode = flow::base(kid).writing_mode;
             {
                 let kid_base = flow::mut_base(kid);
@@ -1463,17 +1463,17 @@ impl BlockFlow {
         let _scope = layout_debug_scope!("block::bubble_inline_sizes {:x}", self.base.debug_id());
 
         let mut flags = self.base.flags;
 
         // Find the maximum inline-size from children.
         let mut computation = self.fragment.compute_intrinsic_inline_sizes();
         let (mut left_float_width, mut right_float_width) = (Au(0), Au(0));
         let (mut left_float_width_accumulator, mut right_float_width_accumulator) = (Au(0), Au(0));
-        for kid in self.base.child_iter() {
+        for kid in self.base.child_iter_mut() {
             let is_absolutely_positioned =
                 flow::base(kid).flags.contains(IS_ABSOLUTELY_POSITIONED);
             let child_base = flow::mut_base(kid);
             let float_kind = child_base.flags.float_kind();
             if !is_absolutely_positioned && consult_children {
                 computation.content_intrinsic_sizes.minimum_inline_size =
                     max(computation.content_intrinsic_sizes.minimum_inline_size,
                         child_base.intrinsic_inline_sizes.minimum_inline_size);
@@ -1919,17 +1919,17 @@ impl Flow for BlockFlow {
                                                   .early_absolute_position_info
                                                   .relative_containing_block_mode,
                                               CoordinateSystem::Own);
         self.fragment.adjust_clipping_region_for_children(
             &mut clip,
             &stacking_relative_border_box);
 
         // Process children.
-        for kid in self.base.child_iter() {
+        for kid in self.base.child_iter_mut() {
             // If this layer preserves the 3d context of children,
             // then children will need a render layer.
             // TODO(gw): This isn't always correct. In some cases
             // this may create extra layers than needed. I think
             // there are also some edge cases where children don't
             // get a layer when they should.
             if transform_style == transform_style::T::preserve_3d {
                 flow::mut_base(kid).flags.insert(NEEDS_LAYER);
--- a/servo/components/layout/flex.rs
+++ b/servo/components/layout/flex.rs
@@ -127,17 +127,17 @@ impl FlexFlow {
     fn inline_mode_bubble_inline_sizes(&mut self) {
         let fixed_width = match self.block_flow.fragment.style().get_box().width {
             LengthOrPercentageOrAuto::Length(_) => true,
             _ => false,
         };
 
         let mut computation = self.block_flow.fragment.compute_intrinsic_inline_sizes();
         if !fixed_width {
-            for kid in self.block_flow.base.child_iter() {
+            for kid in self.block_flow.base.child_iter_mut() {
                 let is_absolutely_positioned =
                     flow::base(kid).flags.contains(IS_ABSOLUTELY_POSITIONED);
                 if !is_absolutely_positioned {
                     computation.union_nonbreaking_inline(&flex_item_inline_sizes(kid));
                 }
             }
         }
         self.block_flow.base.intrinsic_inline_sizes = computation.finish();
@@ -149,17 +149,17 @@ impl FlexFlow {
     fn block_mode_bubble_inline_sizes(&mut self) {
         let fixed_width = match self.block_flow.fragment.style().get_box().width {
             LengthOrPercentageOrAuto::Length(_) => true,
             _ => false,
         };
 
         let mut computation = self.block_flow.fragment.compute_intrinsic_inline_sizes();
         if !fixed_width {
-            for kid in self.block_flow.base.child_iter() {
+            for kid in self.block_flow.base.child_iter_mut() {
                 let is_absolutely_positioned =
                     flow::base(kid).flags.contains(IS_ABSOLUTELY_POSITIONED);
                 let child_base = flow::mut_base(kid);
                 if !is_absolutely_positioned {
                     computation.content_intrinsic_sizes.minimum_inline_size =
                         max(computation.content_intrinsic_sizes.minimum_inline_size,
                             child_base.intrinsic_inline_sizes.minimum_inline_size);
 
@@ -181,17 +181,17 @@ impl FlexFlow {
                                       inline_end_content_edge: Au,
                                       content_inline_size: Au) {
         let _scope = layout_debug_scope!("flex::block_mode_assign_inline_sizes");
         debug!("block_mode_assign_inline_sizes");
 
         // FIXME (mbrubeck): Get correct mode for absolute containing block
         let containing_block_mode = self.block_flow.base.writing_mode;
 
-        let mut iterator = self.block_flow.base.child_iter().enumerate().peekable();
+        let mut iterator = self.block_flow.base.child_iter_mut().enumerate().peekable();
         while let Some((_, kid)) = iterator.next() {
             {
                 let kid_base = flow::mut_base(kid);
                 kid_base.block_container_explicit_block_size = match self.available_main_size {
                     AxisSize::Definite(length) => Some(length),
                     _ => None
                 }
             }
@@ -248,17 +248,17 @@ impl FlexFlow {
         let even_content_inline_size = inline_size / child_count;
 
         let inline_size = self.block_flow.base.block_container_inline_size;
         let container_mode = self.block_flow.base.block_container_writing_mode;
         self.block_flow.base.position.size.inline = inline_size;
 
         let block_container_explicit_block_size = self.block_flow.base.block_container_explicit_block_size;
         let mut inline_child_start = inline_start_content_edge;
-        for kid in self.block_flow.base.child_iter() {
+        for kid in self.block_flow.base.child_iter_mut() {
             let kid_base = flow::mut_base(kid);
 
             kid_base.block_container_inline_size = even_content_inline_size;
             kid_base.block_container_writing_mode = container_mode;
             kid_base.block_container_explicit_block_size = block_container_explicit_block_size;
             kid_base.position.start.i = inline_child_start;
             inline_child_start = inline_child_start + even_content_inline_size;
         }
@@ -272,17 +272,17 @@ impl FlexFlow {
     // TODO(zentner): This function should actually flex elements!
     // Currently, this is the core of TableRowFlow::assign_block_size() with
     // float related logic stripped out.
     fn inline_mode_assign_block_size<'a>(&mut self, layout_context: &'a LayoutContext<'a>) {
         let _scope = layout_debug_scope!("flex::inline_mode_assign_block_size");
 
         let mut max_block_size = Au(0);
         let thread_id = self.block_flow.base.thread_id;
-        for kid in self.block_flow.base.child_iter() {
+        for kid in self.block_flow.base.child_iter_mut() {
             kid.assign_block_size_for_inorder_child_if_necessary(layout_context, thread_id);
 
             {
                 let child_fragment = &mut kid.as_mut_block().fragment;
                 // TODO: Percentage block-size
                 let child_specified_block_size =
                     MaybeAuto::from_style(child_fragment.style().content_block_size(),
                                           Au(0)).specified_or_zero();
@@ -310,17 +310,17 @@ impl FlexFlow {
 
         // Assign the block-size of own fragment
         let mut position = self.block_flow.fragment.border_box;
         position.size.block = block_size;
         self.block_flow.fragment.border_box = position;
         self.block_flow.base.position.size.block = block_size;
 
         // Assign the block-size of kid fragments, which is the same value as own block-size.
-        for kid in self.block_flow.base.child_iter() {
+        for kid in self.block_flow.base.child_iter_mut() {
             {
                 let kid_fragment = &mut kid.as_mut_block().fragment;
                 let mut position = kid_fragment.border_box;
                 position.size.block = block_size;
                 kid_fragment.border_box = position;
             }
 
             // Assign the child's block size.
--- a/servo/components/layout/flow.rs
+++ b/servo/components/layout/flow.rs
@@ -426,31 +426,31 @@ pub trait Flow: fmt::Debug + Sync + Send
 pub fn base<T: ?Sized + Flow>(this: &T) -> &BaseFlow {
     unsafe {
         let obj = mem::transmute::<&&T, &raw::TraitObject>(&this);
         mem::transmute::<*mut (), &BaseFlow>(obj.data)
     }
 }
 
 /// Iterates over the children of this immutable flow.
-pub fn imm_child_iter<'a>(flow: &'a Flow) -> FlowListIterator<'a> {
+pub fn child_iter<'a>(flow: &'a Flow) -> FlowListIterator<'a> {
     base(flow).children.iter()
 }
 
 #[inline(always)]
 #[allow(unsafe_code)]
 pub fn mut_base<T: ?Sized + Flow>(this: &mut T) -> &mut BaseFlow {
     unsafe {
         let obj = mem::transmute::<&&mut T, &raw::TraitObject>(&this);
         mem::transmute::<*mut (), &mut BaseFlow>(obj.data)
     }
 }
 
 /// Iterates over the children of this flow.
-pub fn child_iter<'a>(flow: &'a mut Flow) -> MutFlowListIterator<'a> {
+pub fn child_iter_mut<'a>(flow: &'a mut Flow) -> MutFlowListIterator<'a> {
     mut_base(flow).children.iter_mut()
 }
 
 pub trait ImmutableFlowUtils {
     // Convenience functions
 
     /// Returns true if this flow is a block flow or subclass thereof.
     fn is_block_like(self) -> bool;
@@ -1143,17 +1143,17 @@ impl BaseFlow {
             abs_descendants: self.abs_descendants.clone(),
             absolute_cb: self.absolute_cb.clone(),
             clip: self.clip.clone(),
 
             ..*self
         }
     }
 
-    pub fn child_iter(&mut self) -> MutFlowListIterator {
+    pub fn child_iter_mut(&mut self) -> MutFlowListIterator {
         self.children.iter_mut()
     }
 
     pub fn debug_id(&self) -> usize {
         let p = self as *const _;
         p as usize
     }
 
@@ -1374,17 +1374,17 @@ impl<'a> ImmutableFlowUtils for &'a Flow
         let mut print_tree = PrintTree::new(title);
         self.print_with_tree(&mut print_tree);
     }
 
     /// Dumps the flow tree for debugging into the given PrintTree.
     fn print_with_tree(self, print_tree: &mut PrintTree) {
         print_tree.new_level(format!("{:?}", self));
         self.print_extra_flow_children(print_tree);
-        for kid in imm_child_iter(self) {
+        for kid in child_iter(self) {
             kid.print_with_tree(print_tree);
         }
         print_tree.end_level();
     }
 
     fn floats_might_flow_through(self) -> bool {
         if !base(self).might_have_floats_in() && !base(self).might_have_floats_out() {
             return false
@@ -1401,24 +1401,24 @@ impl<'a> ImmutableFlowUtils for &'a Flow
 
 impl<'a> MutableFlowUtils for &'a mut Flow {
     /// Traverses the tree in preorder.
     fn traverse_preorder<T: PreorderFlowTraversal>(self, traversal: &T) {
         if traversal.should_process(self) {
             traversal.process(self);
         }
 
-        for kid in child_iter(self) {
+        for kid in child_iter_mut(self) {
             kid.traverse_preorder(traversal);
         }
     }
 
     /// Traverses the tree in postorder.
     fn traverse_postorder<T: PostorderFlowTraversal>(self, traversal: &T) {
-        for kid in child_iter(self) {
+        for kid in child_iter_mut(self) {
             kid.traverse_postorder(traversal);
         }
 
         if traversal.should_process(self) {
             traversal.process(self)
         }
     }
 
--- a/servo/components/layout/inline.rs
+++ b/servo/components/layout/inline.rs
@@ -1291,17 +1291,17 @@ impl Flow for InlineFlow {
     }
 
     fn bubble_inline_sizes(&mut self) {
         self.update_restyle_damage();
 
         let _scope = layout_debug_scope!("inline::bubble_inline_sizes {:x}", self.base.debug_id());
 
         let writing_mode = self.base.writing_mode;
-        for kid in self.base.child_iter() {
+        for kid in self.base.child_iter_mut() {
             flow::mut_base(kid).floats = Floats::new(writing_mode);
         }
 
         let mut intrinsic_sizes_for_flow = IntrinsicISizesContribution::new();
         let mut intrinsic_sizes_for_inline_run = IntrinsicISizesContribution::new();
         let mut intrinsic_sizes_for_nonbroken_run = IntrinsicISizesContribution::new();
         for fragment in &mut self.fragments.fragments {
             let intrinsic_sizes_for_fragment = fragment.compute_intrinsic_inline_sizes().finish();
@@ -1393,17 +1393,17 @@ impl Flow for InlineFlow {
                 fragment.compute_inline_direction_margins(inline_size);
                 fragment.assign_replaced_inline_size_if_necessary(inline_size);
             }
         }
 
         // If there are any inline-block kids, propagate explicit block and inline
         // sizes down to them.
         let block_container_explicit_block_size = self.base.block_container_explicit_block_size;
-        for kid in self.base.child_iter() {
+        for kid in self.base.child_iter_mut() {
             let kid_base = flow::mut_base(kid);
 
             kid_base.block_container_inline_size = inline_size;
             kid_base.block_container_writing_mode = container_mode;
             kid_base.block_container_explicit_block_size = block_container_explicit_block_size;
         }
     }
 
@@ -1563,17 +1563,17 @@ impl Flow for InlineFlow {
                 line.bounds.size.block;
 
             // We're no longer on the first line, so set indentation to zero.
             indentation = Au(0)
         } // End of `lines.iter_mut()` loop.
 
         // Assign block sizes for any inline-block descendants.
         let thread_id = self.base.thread_id;
-        for kid in self.base.child_iter() {
+        for kid in self.base.child_iter_mut() {
             if flow::base(kid).flags.contains(IS_ABSOLUTELY_POSITIONED) ||
                     flow::base(kid).flags.is_float() {
                 continue
             }
             kid.assign_block_size_for_inorder_child_if_necessary(layout_context, thread_id);
         }
 
         if self.contains_positioned_fragments() {
--- a/servo/components/layout/layout_thread.rs
+++ b/servo/components/layout/layout_thread.rs
@@ -1420,17 +1420,17 @@ impl LayoutThread {
             node.set_dirty_descendants(true);
         }
     }
 
     fn reflow_all_nodes(flow: &mut Flow) {
         debug!("reflowing all nodes!");
         flow::mut_base(flow).restyle_damage.insert(REFLOW | REPAINT);
 
-        for child in flow::child_iter(flow) {
+        for child in flow::child_iter_mut(flow) {
             LayoutThread::reflow_all_nodes(child);
         }
     }
 
     /// Handles a message to destroy layout data. Layout data must be destroyed on *this* thread
     /// because the struct type is transmuted to a different type on the script side.
     unsafe fn handle_reap_style_and_layout_data(&self, data: OpaqueStyleAndLayoutData) {
         let ptr: *mut () = *data.ptr;
--- a/servo/components/layout/parallel.rs
+++ b/servo/components/layout/parallel.rs
@@ -157,17 +157,17 @@ trait ParallelPreorderFlowTraversal : Pr
                 }
 
                 if self.should_process(flow) {
                     // Perform the appropriate traversal.
                     self.process(flow);
                 }
 
                 // Possibly enqueue the children.
-                for kid in flow::child_iter(flow) {
+                for kid in flow::child_iter_mut(flow) {
                     had_children = true;
                     discovered_child_flows.push(borrowed_flow_to_unsafe_flow(kid));
                 }
             }
 
             // If there were no more children, start assigning block-sizes.
             if !had_children {
                 bottom_up_func(unsafe_flow, proxy.user_data())
--- a/servo/components/layout/sequential.rs
+++ b/servo/components/layout/sequential.rs
@@ -46,17 +46,17 @@ pub fn traverse_flow_tree_preorder(root:
                                    shared_layout_context: &SharedLayoutContext) {
     fn doit(flow: &mut Flow,
             assign_inline_sizes: AssignISizes,
             assign_block_sizes: AssignBSizes) {
         if assign_inline_sizes.should_process(flow) {
             assign_inline_sizes.process(flow);
         }
 
-        for kid in flow::child_iter(flow) {
+        for kid in flow::child_iter_mut(flow) {
             doit(kid, assign_inline_sizes, assign_block_sizes);
         }
 
         if assign_block_sizes.should_process(flow) {
             assign_block_sizes.process(flow);
         }
     }
 
@@ -98,17 +98,17 @@ pub fn build_display_list_for_subtree(ro
 pub fn iterate_through_flow_tree_fragment_border_boxes(root: &mut FlowRef,
                                                        iterator: &mut FragmentBorderBoxIterator) {
     fn doit(flow: &mut Flow,
             level: i32,
             iterator: &mut FragmentBorderBoxIterator,
             stacking_context_position: &Point2D<Au>) {
         flow.iterate_through_fragment_border_boxes(iterator, level, stacking_context_position);
 
-        for kid in flow::mut_base(flow).child_iter() {
+        for kid in flow::mut_base(flow).child_iter_mut() {
             let stacking_context_position =
                 if kid.is_block_flow() && kid.as_block().fragment.establishes_stacking_context() {
                     let margin = Point2D::new(kid.as_block().fragment.margin.inline_start, Au(0));
                     *stacking_context_position + flow::base(kid).stacking_relative_position + margin
                 } else {
                     *stacking_context_position
                 };
 
@@ -120,17 +120,17 @@ pub fn iterate_through_flow_tree_fragmen
     doit(flow_ref::deref_mut(root), 0, iterator, &Point2D::zero());
 }
 
 pub fn store_overflow(layout_context: &LayoutContext, flow: &mut Flow) {
     if !flow::base(flow).restyle_damage.contains(STORE_OVERFLOW) {
         return
     }
 
-    for mut kid in flow::mut_base(flow).child_iter() {
+    for mut kid in flow::mut_base(flow).child_iter_mut() {
         store_overflow(layout_context, kid);
     }
 
     flow.store_overflow(layout_context);
 
     flow::mut_base(flow).restyle_damage.remove(STORE_OVERFLOW);
 }
 
@@ -138,17 +138,17 @@ pub fn store_overflow(layout_context: &L
 /// given flow. This is needed to speculatively calculate the inline sizes of block formatting
 /// contexts. The speculation typically succeeds, but if it doesn't we have to lay it out again.
 pub fn guess_float_placement(flow: &mut Flow) {
     if !flow::base(flow).restyle_damage.intersects(REFLOW) {
         return
     }
 
     let mut floats_in = SpeculatedFloatPlacement::compute_floats_in_for_first_child(flow);
-    for kid in flow::mut_base(flow).child_iter() {
+    for kid in flow::mut_base(flow).child_iter_mut() {
         floats_in.compute_floats_in(kid);
         flow::mut_base(kid).speculated_float_placement_in = floats_in;
         guess_float_placement(kid);
         floats_in = flow::base(kid).speculated_float_placement_out;
     }
     floats_in.compute_floats_out(flow);
     flow::mut_base(flow).speculated_float_placement_out = floats_in
 }
--- a/servo/components/layout/table.rs
+++ b/servo/components/layout/table.rs
@@ -225,17 +225,17 @@ impl Flow for TableFlow {
     fn bubble_inline_sizes(&mut self) {
         let _scope = layout_debug_scope!("table::bubble_inline_sizes {:x}",
                                          self.block_flow.base.debug_id());
 
         // Don't use `compute_intrinsic_inline_sizes` here because that will count padding as
         // part of the table, which we don't want to do—it belongs to the table wrapper instead.
 
         // Get column inline sizes from colgroups
-        for kid in self.block_flow.base.child_iter().filter(|kid| kid.is_table_colgroup()) {
+        for kid in self.block_flow.base.child_iter_mut().filter(|kid| kid.is_table_colgroup()) {
             for specified_inline_size in &kid.as_mut_table_colgroup().inline_sizes {
                 self.column_intrinsic_inline_sizes.push(ColumnIntrinsicInlineSize {
                     minimum_length: match *specified_inline_size {
                         LengthOrPercentageOrAuto::Auto |
                         LengthOrPercentageOrAuto::Calc(_) |
                         LengthOrPercentageOrAuto::Percentage(_) => Au(0),
                         LengthOrPercentageOrAuto::Length(length) => length,
                     },
@@ -699,17 +699,17 @@ impl TableLikeFlow for BlockFlow {
         if self.base.restyle_damage.contains(REFLOW) {
             // Our current border-box position.
             let block_start_border_padding = self.fragment.border_padding.block_start;
             let mut current_block_offset = block_start_border_padding;
             let mut has_rows = false;
 
             // At this point, `current_block_offset` is at the content edge of our box. Now iterate
             // over children.
-            for kid in self.base.child_iter() {
+            for kid in self.base.child_iter_mut() {
                 // Account for spacing or collapsed borders.
                 if kid.is_table_row() {
                     has_rows = true;
                     let child_table_row = kid.as_table_row();
                     current_block_offset = current_block_offset +
                         match self.fragment.style.get_inheritedtable().border_collapse {
                             border_collapse::T::separate => block_direction_spacing,
                             border_collapse::T::collapse => {
@@ -757,17 +757,17 @@ impl TableLikeFlow for BlockFlow {
             // Now that `current_block_offset` is at the block-end of the border box, compute the
             // final border box position.
             self.fragment.border_box.size.block = current_block_offset;
             self.fragment.border_box.start.b = Au(0);
             self.base.position.size.block = current_block_offset;
 
             // Write in the size of the relative containing block for children. (This information
             // is also needed to handle RTL.)
-            for kid in self.base.child_iter() {
+            for kid in self.base.child_iter_mut() {
                 flow::mut_base(kid).early_absolute_position_info = EarlyAbsolutePositionInfo {
                     relative_containing_block_size: self.fragment.content_box().size,
                     relative_containing_block_mode: self.fragment.style().writing_mode,
                 };
             }
         }
 
         self.base.restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW);
@@ -796,17 +796,17 @@ enum NextBlockCollapsedBorders<'a> {
 struct TableRowIterator<'a> {
     kids: MutFlowListIterator<'a>,
     grandkids: Option<MutFlowListIterator<'a>>,
 }
 
 impl<'a> TableRowIterator<'a> {
     fn new(base: &'a mut BaseFlow) -> Self {
         TableRowIterator {
-            kids: base.child_iter(),
+            kids: base.child_iter_mut(),
             grandkids: None,
         }
     }
 }
 
 impl<'a> Iterator for TableRowIterator<'a> {
     type Item = &'a mut TableRowFlow;
     #[inline]
@@ -817,17 +817,17 @@ impl<'a> Iterator for TableRowIterator<'
                 return Some(grandkid.as_mut_table_row())
             }
         }
         // Otherwise, iterate through the table's children.
         self.grandkids = None;
         match self.kids.next() {
             Some(kid) => {
                 if kid.is_table_rowgroup() {
-                    self.grandkids = Some(flow::mut_base(kid).child_iter());
+                    self.grandkids = Some(flow::mut_base(kid).child_iter_mut());
                     self.next()
                 } else if kid.is_table_row() {
                     Some(kid.as_mut_table_row())
                 } else {
                     self.next() // Skip children that are not rows or rowgroups
                 }
             }
             None => None
--- a/servo/components/layout/table_row.rs
+++ b/servo/components/layout/table_row.rs
@@ -103,17 +103,17 @@ impl TableRowFlow {
     /// inline(always) because this is only ever called by in-order or non-in-order top-level
     /// methods
     #[inline(always)]
     fn assign_block_size_table_row_base(&mut self, layout_context: &LayoutContext) {
         // Per CSS 2.1 § 17.5.3, find max_y = max(computed `block-size`, minimum block-size of all
         // cells).
         let mut max_block_size = Au(0);
         let thread_id = self.block_flow.base.thread_id;
-        for kid in self.block_flow.base.child_iter() {
+        for kid in self.block_flow.base.child_iter_mut() {
             kid.place_float_if_applicable(layout_context);
             if !flow::base(kid).flags.is_float() {
                 kid.assign_block_size_for_inorder_child_if_necessary(layout_context, thread_id);
             }
 
             {
                 let child_fragment = kid.as_mut_table_cell().fragment();
                 // TODO: Percentage block-size
@@ -143,17 +143,17 @@ impl TableRowFlow {
 
         // Assign the block-size of own fragment
         let mut position = self.block_flow.fragment.border_box;
         position.size.block = block_size;
         self.block_flow.fragment.border_box = position;
         self.block_flow.base.position.size.block = block_size;
 
         // Assign the block-size of kid fragments, which is the same value as own block-size.
-        for kid in self.block_flow.base.child_iter() {
+        for kid in self.block_flow.base.child_iter_mut() {
             let child_table_cell = kid.as_mut_table_cell();
             {
                 let kid_fragment = child_table_cell.mut_fragment();
                 let mut position = kid_fragment.border_box;
                 position.size.block = block_size;
                 kid_fragment.border_box = position;
             }
 
@@ -239,17 +239,17 @@ impl Flow for TableRowFlow {
                                      .fragment
                                      .style()
                                      .get_inheritedtable()
                                      .border_collapse == border_collapse::T::collapse;
         // FIXME(pcwalton): Shouldn't use `CollapsedBorder::new()` here.
         self.preliminary_collapsed_borders.reset(CollapsedBorder::new());
 
         {
-            let mut iterator = self.block_flow.base.child_iter().enumerate().peekable();
+            let mut iterator = self.block_flow.base.child_iter_mut().enumerate().peekable();
             while let Some((i, kid)) = iterator.next() {
                 assert!(kid.is_table_cell());
 
                 // Collect the specified column inline-size of the cell. This is used in both
                 // fixed and automatic table layout calculation.
                 let child_specified_inline_size;
                 let child_column_span;
                 {
--- a/servo/components/layout/table_wrapper.rs
+++ b/servo/components/layout/table_wrapper.rs
@@ -67,17 +67,17 @@ impl TableWrapperFlow {
         TableWrapperFlow {
             block_flow: block_flow,
             column_intrinsic_inline_sizes: vec!(),
             table_layout: table_layout
         }
     }
     fn border_padding_and_spacing(&mut self) -> (Au, Au) {
         let (mut table_border_padding, mut spacing) = (Au(0), Au(0));
-        for kid in self.block_flow.base.child_iter() {
+        for kid in self.block_flow.base.child_iter_mut() {
             if kid.is_table() {
                 let kid_table = kid.as_table();
                 spacing = kid_table.total_horizontal_spacing();
                 table_border_padding =
                     kid_table.block_flow.fragment.border_padding.inline_start_end();
                 break
             }
         }
@@ -90,17 +90,17 @@ impl TableWrapperFlow {
             intermediate_column_inline_sizes: &mut [IntermediateColumnInlineSize]) {
         // Find the padding and border of our first child, which is the table itself.
         //
         // This is a little weird because we're computing border/padding/margins for our child,
         // when normally the child computes it itself. But it has to be this way because the
         // padding will affect where we place the child. This is an odd artifact of the way that
         // tables are separated into table flows and table wrapper flows.
         let available_inline_size = self.block_flow.fragment.border_box.size.inline;
-        for kid in self.block_flow.base.child_iter() {
+        for kid in self.block_flow.base.child_iter_mut() {
             if !kid.is_table() {
                 continue
             }
 
             let kid_table = kid.as_mut_table();
             let kid_block_flow = &mut kid_table.block_flow;
             kid_block_flow.fragment
                           .compute_border_and_padding(available_inline_size,
@@ -303,17 +303,17 @@ impl Flow for TableWrapperFlow {
     }
 
     fn mark_as_root(&mut self) {
         self.block_flow.mark_as_root();
     }
 
     fn bubble_inline_sizes(&mut self) {
         // Get the intrinsic column inline-sizes info from the table flow.
-        for kid in self.block_flow.base.child_iter() {
+        for kid in self.block_flow.base.child_iter_mut() {
             debug_assert!(kid.is_table_caption() || kid.is_table());
             if kid.is_table() {
                 self.column_intrinsic_inline_sizes = kid.column_intrinsic_inline_sizes().clone()
             }
         }
 
         self.block_flow.bubble_inline_sizes();
     }
--- a/servo/components/layout/traversal.rs
+++ b/servo/components/layout/traversal.rs
@@ -221,17 +221,17 @@ impl<'a> BuildDisplayList<'a> {
     pub fn traverse(&mut self, flow: &mut Flow) {
         if self.should_process() {
             self.state.push_stacking_context_id(flow::base(flow).stacking_context_id);
             flow.build_display_list(&mut self.state);
             flow::mut_base(flow).restyle_damage.remove(REPAINT);
             self.state.pop_stacking_context_id();
         }
 
-        for kid in flow::child_iter(flow) {
+        for kid in flow::child_iter_mut(flow) {
             self.traverse(kid);
         }
     }
 
     #[inline]
     fn should_process(&self) -> bool {
         true
     }