aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-04-09 03:54:40 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2016-04-09 03:54:40 +0530
commit0a1efe4578e43c4ffc2f90ff0118660899a83ac4 (patch)
treeebae73a481653e77570d66efc53e2ea2c14dd2c8
parent93c41fba695e55fe2c5f5b19408a737c650b811c (diff)
parentd4dcaf316716d637648e9d69fed848dddaa06e49 (diff)
downloadservo-0a1efe4578e43c4ffc2f90ff0118660899a83ac4.tar.gz
servo-0a1efe4578e43c4ffc2f90ff0118660899a83ac4.zip
Auto merge of #10320 - malayaleecoder:master, r=KiChjang
Rename imm_child_iter() and child_iter(). Fixes #10286 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10320) <!-- Reviewable:end -->
-rw-r--r--components/layout/block.rs14
-rw-r--r--components/layout/flex.rs12
-rw-r--r--components/layout/flow.rs12
-rw-r--r--components/layout/inline.rs6
-rw-r--r--components/layout/layout_thread.rs2
-rw-r--r--components/layout/parallel.rs2
-rw-r--r--components/layout/sequential.rs8
-rw-r--r--components/layout/table.rs10
-rw-r--r--components/layout/table_row.rs6
-rw-r--r--components/layout/table_wrapper.rs6
-rw-r--r--components/layout/traversal.rs2
11 files changed, 40 insertions, 40 deletions
diff --git a/components/layout/block.rs b/components/layout/block.rs
index 103ac4c679c..07b70070f47 100644
--- a/components/layout/block.rs
+++ b/components/layout/block.rs
@@ -712,7 +712,7 @@ impl BlockFlow {
// 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
}
@@ -809,7 +809,7 @@ impl BlockFlow {
// 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.
@@ -967,7 +967,7 @@ impl BlockFlow {
// 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,
@@ -1017,7 +1017,7 @@ impl BlockFlow {
// 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);
}
}
@@ -1330,7 +1330,7 @@ impl BlockFlow {
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;
@@ -1468,7 +1468,7 @@ impl BlockFlow {
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);
@@ -1924,7 +1924,7 @@ impl Flow for BlockFlow {
&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
diff --git a/components/layout/flex.rs b/components/layout/flex.rs
index 4c2b615f09b..4c8f749b086 100644
--- a/components/layout/flex.rs
+++ b/components/layout/flex.rs
@@ -132,7 +132,7 @@ impl FlexFlow {
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 {
@@ -154,7 +154,7 @@ impl FlexFlow {
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);
@@ -186,7 +186,7 @@ impl FlexFlow {
// 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);
@@ -253,7 +253,7 @@ impl FlexFlow {
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;
@@ -277,7 +277,7 @@ impl FlexFlow {
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);
{
@@ -315,7 +315,7 @@ impl FlexFlow {
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;
diff --git a/components/layout/flow.rs b/components/layout/flow.rs
index 6f603c7a1ac..2dfcc05ab06 100644
--- a/components/layout/flow.rs
+++ b/components/layout/flow.rs
@@ -431,7 +431,7 @@ pub fn base<T: ?Sized + Flow>(this: &T) -> &BaseFlow {
}
/// 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()
}
@@ -445,7 +445,7 @@ pub fn mut_base<T: ?Sized + Flow>(this: &mut T) -> &mut BaseFlow {
}
/// 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()
}
@@ -1148,7 +1148,7 @@ impl BaseFlow {
}
}
- pub fn child_iter(&mut self) -> MutFlowListIterator {
+ pub fn child_iter_mut(&mut self) -> MutFlowListIterator {
self.children.iter_mut()
}
@@ -1379,7 +1379,7 @@ impl<'a> ImmutableFlowUtils for &'a Flow {
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();
@@ -1406,14 +1406,14 @@ impl<'a> MutableFlowUtils for &'a mut Flow {
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);
}
diff --git a/components/layout/inline.rs b/components/layout/inline.rs
index d9d750b0e83..6d1224dea25 100644
--- a/components/layout/inline.rs
+++ b/components/layout/inline.rs
@@ -1296,7 +1296,7 @@ impl Flow for InlineFlow {
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);
}
@@ -1398,7 +1398,7 @@ impl Flow for InlineFlow {
// 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;
@@ -1568,7 +1568,7 @@ impl Flow for InlineFlow {
// 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
diff --git a/components/layout/layout_thread.rs b/components/layout/layout_thread.rs
index c1e882f2a32..f6f88a0f29b 100644
--- a/components/layout/layout_thread.rs
+++ b/components/layout/layout_thread.rs
@@ -1425,7 +1425,7 @@ impl LayoutThread {
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);
}
}
diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs
index 628f0c4e07e..e74f9631ff1 100644
--- a/components/layout/parallel.rs
+++ b/components/layout/parallel.rs
@@ -162,7 +162,7 @@ trait ParallelPreorderFlowTraversal : PreorderFlowTraversal {
}
// 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));
}
diff --git a/components/layout/sequential.rs b/components/layout/sequential.rs
index f63e2a8bfcd..6ca7332497a 100644
--- a/components/layout/sequential.rs
+++ b/components/layout/sequential.rs
@@ -51,7 +51,7 @@ pub fn traverse_flow_tree_preorder(root: &mut FlowRef,
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);
}
@@ -103,7 +103,7 @@ pub fn iterate_through_flow_tree_fragment_border_boxes(root: &mut FlowRef,
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));
@@ -125,7 +125,7 @@ pub fn store_overflow(layout_context: &LayoutContext, flow: &mut Flow) {
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);
}
@@ -143,7 +143,7 @@ pub fn guess_float_placement(flow: &mut Flow) {
}
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);
diff --git a/components/layout/table.rs b/components/layout/table.rs
index 8c66f7fb66b..0585a509f09 100644
--- a/components/layout/table.rs
+++ b/components/layout/table.rs
@@ -230,7 +230,7 @@ impl Flow for TableFlow {
// 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 {
@@ -704,7 +704,7 @@ impl TableLikeFlow for BlockFlow {
// 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;
@@ -762,7 +762,7 @@ impl TableLikeFlow for BlockFlow {
// 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,
@@ -801,7 +801,7 @@ struct TableRowIterator<'a> {
impl<'a> TableRowIterator<'a> {
fn new(base: &'a mut BaseFlow) -> Self {
TableRowIterator {
- kids: base.child_iter(),
+ kids: base.child_iter_mut(),
grandkids: None,
}
}
@@ -822,7 +822,7 @@ impl<'a> Iterator for TableRowIterator<'a> {
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())
diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs
index 1d8d50c822f..7fb6cd6ab27 100644
--- a/components/layout/table_row.rs
+++ b/components/layout/table_row.rs
@@ -108,7 +108,7 @@ impl TableRowFlow {
// 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);
@@ -148,7 +148,7 @@ impl TableRowFlow {
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();
@@ -244,7 +244,7 @@ impl Flow for TableRowFlow {
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());
diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs
index e9e6ff3a86a..99bd3d29b64 100644
--- a/components/layout/table_wrapper.rs
+++ b/components/layout/table_wrapper.rs
@@ -72,7 +72,7 @@ impl TableWrapperFlow {
}
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();
@@ -95,7 +95,7 @@ impl TableWrapperFlow {
// 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
}
@@ -308,7 +308,7 @@ impl Flow for TableWrapperFlow {
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()
diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs
index 586a71029e0..00732f852ee 100644
--- a/components/layout/traversal.rs
+++ b/components/layout/traversal.rs
@@ -226,7 +226,7 @@ impl<'a> BuildDisplayList<'a> {
self.state.pop_stacking_context_id();
}
- for kid in flow::child_iter(flow) {
+ for kid in flow::child_iter_mut(flow) {
self.traverse(kid);
}
}