Turn flow::base and friends into methods

This commit is contained in:
Matt Brubeck 2017-12-14 10:57:34 -06:00
parent 26feea3be5
commit c60cfc5a9f
20 changed files with 211 additions and 212 deletions

View file

@ -13,8 +13,7 @@ use context::LayoutContext;
use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode};
use display_list_builder::{DisplayListBuildState, StackingContextCollectionFlags, StackingContextCollectionState};
use euclid::Point2D;
use flow;
use flow::{BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ImmutableFlowUtils, OpaqueFlow};
use flow::{BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ImmutableFlowUtils, GetBaseFlow, OpaqueFlow};
use flow_list::MutFlowListIterator;
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
use gfx_traits::print_tree::PrintTree;
@ -752,12 +751,12 @@ impl TableLikeFlow for BlockFlow {
}
// At this point, `current_block_offset` is at the border edge of the child.
flow::mut_base(kid).position.start.b = current_block_offset;
kid.mut_base().position.start.b = current_block_offset;
// Move past the child's border box. Do not use the `translate_including_floats`
// function here because the child has already translated floats past its border
// box.
let kid_base = flow::mut_base(kid);
let kid_base = kid.mut_base();
current_block_offset = current_block_offset + kid_base.position.size.block;
}
@ -796,7 +795,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_mut() {
flow::mut_base(kid).early_absolute_position_info = EarlyAbsolutePositionInfo {
kid.mut_base().early_absolute_position_info = EarlyAbsolutePositionInfo {
relative_containing_block_size: self.fragment.content_box().size,
relative_containing_block_mode: self.fragment.style().writing_mode,
};
@ -856,7 +855,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_mut());
self.grandkids = Some(kid.mut_base().child_iter_mut());
self.next()
} else if kid.is_table_row() {
Some(kid.as_mut_table_row())