diff --git a/components/layout/construct.rs b/components/layout/construct.rs index b29b6507c2d..bcc218702d2 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -588,7 +588,7 @@ impl<'a> FlowConstructor<'a> { if node.type_id() == Some(NodeTypeId::Element(ElementTypeId::HTMLElement( HTMLElementTypeId::HTMLTextAreaElement))) { for kid in node.children() { - kid.set_flow_construction_result(ConstructionResult::None) + self.set_flow_construction_result(&kid, ConstructionResult::None) } } @@ -744,7 +744,7 @@ impl<'a> FlowConstructor<'a> { fn build_fragments_for_replaced_inline_content(&mut self, node: &ThreadSafeLayoutNode) -> ConstructionResult { for kid in node.children() { - kid.set_flow_construction_result(ConstructionResult::None) + self.set_flow_construction_result(&kid, ConstructionResult::None) } // If this node is ignorable whitespace, bail out now. @@ -1095,7 +1095,7 @@ impl<'a> FlowConstructor<'a> { -> ConstructionResult { // CSS 2.1 ยง 17.2.1. Treat all child fragments of a `table-column` as `display: none`. for kid in node.children() { - kid.set_flow_construction_result(ConstructionResult::None) + self.set_flow_construction_result(&kid, ConstructionResult::None) } let specific = SpecificFragmentInfo::TableColumn(TableColumnFragmentInfo::new(node)); @@ -1222,15 +1222,15 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> { // results of children. (display::T::none, _, _) => { for child in node.children() { - child.set_flow_construction_result(ConstructionResult::None); + self.set_flow_construction_result(&child, ConstructionResult::None); } - node.set_flow_construction_result(ConstructionResult::None); + self.set_flow_construction_result(node, ConstructionResult::None); } // Table items contribute table flow construction results. (display::T::table, float_value, _) => { let construction_result = self.build_flow_for_table_wrapper(node, float_value); - node.set_flow_construction_result(construction_result) + self.set_flow_construction_result(node, construction_result) } // Absolutely positioned elements will have computed value of @@ -1241,13 +1241,14 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> { // below. (display::T::block, _, position::T::absolute) | (_, _, position::T::fixed) => { - node.set_flow_construction_result(self.build_flow_for_nonfloated_block(node)) + let construction_result = self.build_flow_for_nonfloated_block(node); + self.set_flow_construction_result(node, construction_result) } // List items contribute their own special flows. (display::T::list_item, float_value, _) => { - node.set_flow_construction_result(self.build_flow_for_list_item(node, - float_value)) + let construction_result = self.build_flow_for_list_item(node, float_value); + self.set_flow_construction_result(node, construction_result) } // Inline items that are absolutely-positioned contribute inline fragment construction @@ -1255,7 +1256,7 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> { (display::T::inline, _, position::T::absolute) => { let construction_result = self.build_fragment_for_absolutely_positioned_inline(node); - node.set_flow_construction_result(construction_result) + self.set_flow_construction_result(node, construction_result) } // Inline items contribute inline fragment construction results. @@ -1263,31 +1264,31 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> { // FIXME(pcwalton, #3307): This is not sufficient to handle floated generated content. (display::T::inline, float::T::none, _) => { let construction_result = self.build_fragments_for_inline(node); - node.set_flow_construction_result(construction_result) + self.set_flow_construction_result(node, construction_result) } // Inline-block items contribute inline fragment construction results. (display::T::inline_block, float::T::none, _) => { let construction_result = self.build_fragment_for_inline_block(node); - node.set_flow_construction_result(construction_result) + self.set_flow_construction_result(node, construction_result) } // Table items contribute table flow construction results. (display::T::table_caption, _, _) => { let construction_result = self.build_flow_for_table_caption(node); - node.set_flow_construction_result(construction_result) + self.set_flow_construction_result(node, construction_result) } // Table items contribute table flow construction results. (display::T::table_column_group, _, _) => { let construction_result = self.build_flow_for_table_colgroup(node); - node.set_flow_construction_result(construction_result) + self.set_flow_construction_result(node, construction_result) } // Table items contribute table flow construction results. (display::T::table_column, _, _) => { let construction_result = self.build_fragments_for_table_column(node); - node.set_flow_construction_result(construction_result) + self.set_flow_construction_result(node, construction_result) } // Table items contribute table flow construction results. @@ -1295,19 +1296,19 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> { (display::T::table_header_group, _, _) | (display::T::table_footer_group, _, _) => { let construction_result = self.build_flow_for_table_rowgroup(node); - node.set_flow_construction_result(construction_result) + self.set_flow_construction_result(node, construction_result) } // Table items contribute table flow construction results. (display::T::table_row, _, _) => { let construction_result = self.build_flow_for_table_row(node); - node.set_flow_construction_result(construction_result) + self.set_flow_construction_result(node, construction_result) } // Table items contribute table flow construction results. (display::T::table_cell, _, _) => { let construction_result = self.build_flow_for_table_cell(node); - node.set_flow_construction_result(construction_result) + self.set_flow_construction_result(node, construction_result) } // Block flows that are not floated contribute block flow construction results. @@ -1316,14 +1317,15 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> { // properties separately. (_, float::T::none, _) => { - node.set_flow_construction_result(self.build_flow_for_nonfloated_block(node)) + let construction_result = self.build_flow_for_nonfloated_block(node); + self.set_flow_construction_result(node, construction_result) } // Floated flows contribute float flow construction results. (_, float_value, _) => { let float_kind = FloatKind::from_property(float_value); - node.set_flow_construction_result( - self.build_flow_for_floated_block(node, float_kind)) + let construction_result = self.build_flow_for_floated_block(node, float_kind); + self.set_flow_construction_result(node, construction_result) } }