diff --git a/components/layout/block.rs b/components/layout/block.rs index 60971496b3d..082c6232c3f 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -590,56 +590,56 @@ impl BlockFlow { /// Compute the actual inline size and position for this block. pub fn compute_used_inline_size(&mut self, - layout_context: &LayoutContext, + shared_context: &SharedStyleContext, containing_block_inline_size: Au) { let block_type = self.block_type(); match block_type { BlockType::AbsoluteReplaced => { let inline_size_computer = AbsoluteReplaced; inline_size_computer.compute_used_inline_size(self, - layout_context, + shared_context, containing_block_inline_size); } BlockType::AbsoluteNonReplaced => { let inline_size_computer = AbsoluteNonReplaced; inline_size_computer.compute_used_inline_size(self, - layout_context, + shared_context, containing_block_inline_size); } BlockType::FloatReplaced => { let inline_size_computer = FloatReplaced; inline_size_computer.compute_used_inline_size(self, - layout_context, + shared_context, containing_block_inline_size); } BlockType::FloatNonReplaced => { let inline_size_computer = FloatNonReplaced; inline_size_computer.compute_used_inline_size(self, - layout_context, + shared_context, containing_block_inline_size); } BlockType::InlineBlockReplaced => { let inline_size_computer = InlineBlockReplaced; inline_size_computer.compute_used_inline_size(self, - layout_context, + shared_context, containing_block_inline_size); } BlockType::InlineBlockNonReplaced => { let inline_size_computer = InlineBlockNonReplaced; inline_size_computer.compute_used_inline_size(self, - layout_context, + shared_context, containing_block_inline_size); } BlockType::Replaced => { let inline_size_computer = BlockReplaced; inline_size_computer.compute_used_inline_size(self, - layout_context, + shared_context, containing_block_inline_size); } BlockType::NonReplaced => { let inline_size_computer = BlockNonReplaced; inline_size_computer.compute_used_inline_size(self, - layout_context, + shared_context, containing_block_inline_size); } } @@ -1297,7 +1297,7 @@ impl BlockFlow { /// This is run in the `AssignISizes` traversal. fn propagate_and_compute_used_inline_size(&mut self, layout_context: &LayoutContext) { let containing_block_inline_size = self.base.block_container_inline_size; - self.compute_used_inline_size(layout_context, containing_block_inline_size); + self.compute_used_inline_size(layout_context.shared_context(), containing_block_inline_size); if self.base.flags.is_float() { self.float.as_mut().unwrap().containing_inline_size = containing_block_inline_size } @@ -2403,14 +2403,14 @@ pub trait ISizeAndMarginsComputer { /// CSS Section 10.4: Minimum and Maximum inline-sizes fn compute_used_inline_size(&self, block: &mut BlockFlow, - layout_context: &LayoutContext, + shared_context: &SharedStyleContext, parent_flow_inline_size: Au) { let mut input = self.compute_inline_size_constraint_inputs(block, parent_flow_inline_size, - layout_context.shared_context()); + shared_context); let containing_block_inline_size = - self.containing_block_inline_size(block, parent_flow_inline_size, layout_context.shared_context()); + self.containing_block_inline_size(block, parent_flow_inline_size, shared_context); let mut solution = self.solve_inline_size_constraints(block, &input); diff --git a/components/layout/flex.rs b/components/layout/flex.rs index dd279bbdfdf..200402cf42f 100644 --- a/components/layout/flex.rs +++ b/components/layout/flex.rs @@ -25,6 +25,7 @@ use script_layout_interface::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW}; use std::cmp::max; use std::sync::Arc; use style::computed_values::flex_direction; +use style::context::StyleContext; use style::logical_geometry::LogicalSize; use style::properties::{ComputedValues, ServoComputedValues}; use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto, LengthOrPercentageOrNone}; @@ -413,7 +414,7 @@ impl Flow for FlexFlow { // Our inline-size was set to the inline-size of the containing block by the flow's parent. // Now compute the real value. let containing_block_inline_size = self.block_flow.base.block_container_inline_size; - self.block_flow.compute_used_inline_size(layout_context, containing_block_inline_size); + self.block_flow.compute_used_inline_size(layout_context.shared_context(), containing_block_inline_size); if self.block_flow.base.flags.is_float() { self.block_flow.float.as_mut().unwrap().containing_inline_size = containing_block_inline_size } diff --git a/components/layout/table.rs b/components/layout/table.rs index ff9048201a7..08fe3b395d6 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -28,6 +28,7 @@ use style::computed_values::{border_collapse, border_spacing, table_layout}; use style::context::StyleContext; use style::logical_geometry::LogicalSize; use style::properties::{ComputedValues, ServoComputedValues}; +use style::servo::SharedStyleContext; use style::values::CSSFloat; use style::values::computed::LengthOrPercentageOrAuto; use table_row::TableRowFlow; @@ -348,7 +349,7 @@ impl Flow for TableFlow { border_collapse: self.block_flow.fragment.style.get_inheritedtable().border_collapse, }; inline_size_computer.compute_used_inline_size(&mut self.block_flow, - layout_context, + layout_context.shared_context(), containing_block_inline_size); let inline_start_content_edge = self.block_flow.fragment.border_padding.inline_start; @@ -518,11 +519,11 @@ impl ISizeAndMarginsComputer for InternalTable { /// CSS Section 10.4: Minimum and Maximum inline-sizes fn compute_used_inline_size(&self, block: &mut BlockFlow, - layout_context: &LayoutContext, + shared_context: &SharedStyleContext, parent_flow_inline_size: Au) { let mut input = self.compute_inline_size_constraint_inputs(block, parent_flow_inline_size, - layout_context.shared_context()); + shared_context); // Tables are always at least as wide as their minimum inline size. let minimum_inline_size = diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs index 4f043e351c4..8e487ba97da 100644 --- a/components/layout/table_cell.rs +++ b/components/layout/table_cell.rs @@ -23,6 +23,7 @@ use script_layout_interface::wrapper_traits::ThreadSafeLayoutNode; use std::fmt; use std::sync::Arc; use style::computed_values::{border_collapse, border_top_style, vertical_align}; +use style::context::StyleContext; use style::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode}; use style::properties::{ComputedValues, ServoComputedValues}; use table::InternalTable; @@ -174,7 +175,7 @@ impl Flow for TableCellFlow { border_collapse: self.block_flow.fragment.style.get_inheritedtable().border_collapse, }; inline_size_computer.compute_used_inline_size(&mut self.block_flow, - layout_context, + layout_context.shared_context(), containing_block_inline_size); let inline_start_content_edge = diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs index dbeafead32e..69608513bd1 100644 --- a/components/layout/table_row.rs +++ b/components/layout/table_row.rs @@ -25,6 +25,7 @@ use std::fmt; use std::iter::{Enumerate, IntoIterator, Peekable}; use std::sync::Arc; use style::computed_values::{border_collapse, border_spacing, border_top_style}; +use style::context::StyleContext; use style::logical_geometry::{LogicalSize, PhysicalSide, WritingMode}; use style::properties::{ComputedValues, ServoComputedValues}; use style::values::computed::LengthOrPercentageOrAuto; @@ -327,7 +328,7 @@ impl Flow for TableRowFlow { border_collapse: self.block_flow.fragment.style.get_inheritedtable().border_collapse, }; inline_size_computer.compute_used_inline_size(&mut self.block_flow, - layout_context, + layout_context.shared_context(), containing_block_inline_size); // Spread out the completed inline sizes among columns with spans > 1. diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs index e7e3e2fa938..a5226310993 100644 --- a/components/layout/table_rowgroup.rs +++ b/components/layout/table_rowgroup.rs @@ -21,6 +21,7 @@ use std::fmt; use std::iter::{IntoIterator, Iterator, Peekable}; use std::sync::Arc; use style::computed_values::{border_collapse, border_spacing}; +use style::context::StyleContext; use style::logical_geometry::{LogicalSize, WritingMode}; use style::properties::{ComputedValues, ServoComputedValues}; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow}; @@ -154,7 +155,7 @@ impl Flow for TableRowGroupFlow { border_collapse: border_collapse, }; inline_size_computer.compute_used_inline_size(&mut self.block_flow, - layout_context, + layout_context.shared_context(), containing_block_inline_size); let column_computed_inline_sizes = &self.column_computed_inline_sizes;