diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs index 9e1009ce835..fcef3b54f98 100644 --- a/components/layout/parallel.rs +++ b/components/layout/parallel.rs @@ -10,7 +10,7 @@ use context::{LayoutContext, SharedLayoutContext}; use flow::{self, Flow, MutableFlowUtils, PostorderFlowTraversal, PreorderFlowTraversal}; -use flow_ref::{self, FlowRef}; +use flow_ref::FlowRef; use profile_traits::time::{self, TimerMetadata, profile}; use std::mem; use std::sync::atomic::{AtomicIsize, Ordering}; @@ -220,7 +220,7 @@ fn assign_block_sizes_and_store_overflow( } pub fn traverse_flow_tree_preorder( - root: &mut FlowRef, + root: &mut Flow, profiler_metadata: Option, time_profiler_chan: time::ProfilerChan, shared_layout_context: &SharedLayoutContext, @@ -228,7 +228,7 @@ pub fn traverse_flow_tree_preorder( if opts::get().bubble_inline_sizes_separately { let layout_context = LayoutContext::new(shared_layout_context); let bubble_inline_sizes = BubbleISizes { layout_context: &layout_context }; - flow_ref::deref_mut(root).traverse_postorder(&bubble_inline_sizes); + root.traverse_postorder(&bubble_inline_sizes); } run_queue_with_custom_work_data_type(queue, |queue| { @@ -236,7 +236,7 @@ pub fn traverse_flow_tree_preorder( time_profiler_chan, || { queue.push(WorkUnit { fun: assign_inline_sizes, - data: (box vec![mut_owned_flow_to_unsafe_flow(root)], 0), + data: (box vec![borrowed_flow_to_unsafe_flow(root)], 0), }) }); }, shared_layout_context); diff --git a/components/layout/sequential.rs b/components/layout/sequential.rs index 804063b7629..5fca977b8b1 100644 --- a/components/layout/sequential.rs +++ b/components/layout/sequential.rs @@ -41,7 +41,7 @@ pub fn resolve_generated_content(root: &mut Flow, shared_layout_context: &Shared doit(root, 0, &mut traversal) } -pub fn traverse_flow_tree_preorder(root: &mut FlowRef, +pub fn traverse_flow_tree_preorder(root: &mut Flow, shared_layout_context: &SharedLayoutContext) { fn doit(flow: &mut Flow, assign_inline_sizes: AssignISizes, @@ -61,8 +61,6 @@ pub fn traverse_flow_tree_preorder(root: &mut FlowRef, let layout_context = LayoutContext::new(shared_layout_context); - let root = flow_ref::deref_mut(root); - if opts::get().bubble_inline_sizes_separately { let bubble_inline_sizes = BubbleISizes { layout_context: &layout_context }; { diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 2ff314d7170..c001f3b2345 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -875,7 +875,7 @@ impl LayoutThread { fn solve_constraints(layout_root: &mut FlowRef, shared_layout_context: &SharedLayoutContext) { let _scope = layout_debug_scope!("solve_constraints"); - sequential::traverse_flow_tree_preorder(layout_root, shared_layout_context); + sequential::traverse_flow_tree_preorder(flow_ref::deref_mut(layout_root), shared_layout_context); } /// Performs layout constraint solving in parallel. @@ -892,7 +892,7 @@ impl LayoutThread { // NOTE: this currently computes borders, so any pruning should separate that // operation out. - parallel::traverse_flow_tree_preorder(layout_root, + parallel::traverse_flow_tree_preorder(flow_ref::deref_mut(layout_root), profiler_metadata, time_profiler_chan, shared_layout_context,