Pass SharedStyleContext to compute_inline_size_constraint_inputs.

This commit is contained in:
Ms2ger 2016-06-20 19:48:05 +02:00
parent 5c12755fa6
commit 018bebe90d
3 changed files with 10 additions and 8 deletions

View file

@ -2276,10 +2276,10 @@ pub trait ISizeAndMarginsComputer {
fn compute_inline_size_constraint_inputs(&self,
block: &mut BlockFlow,
parent_flow_inline_size: Au,
layout_context: &LayoutContext)
shared_context: &SharedStyleContext)
-> ISizeConstraintInput {
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);
block.fragment.compute_block_direction_margins(containing_block_inline_size);
block.fragment.compute_inline_direction_margins(containing_block_inline_size);
@ -2287,7 +2287,7 @@ pub trait ISizeAndMarginsComputer {
let mut computed_inline_size = self.initial_computed_inline_size(block,
parent_flow_inline_size,
layout_context.shared_context());
shared_context);
let style = block.fragment.style();
match (computed_inline_size, style.get_position().box_sizing) {
(MaybeAuto::Specified(size), box_sizing::T::border_box) => {
@ -2407,7 +2407,7 @@ pub trait ISizeAndMarginsComputer {
parent_flow_inline_size: Au) {
let mut input = self.compute_inline_size_constraint_inputs(block,
parent_flow_inline_size,
layout_context);
layout_context.shared_context());
let containing_block_inline_size =
self.containing_block_inline_size(block, parent_flow_inline_size, layout_context.shared_context());

View file

@ -25,6 +25,7 @@ use std::cmp;
use std::fmt;
use std::sync::Arc;
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::values::CSSFloat;
@ -521,7 +522,7 @@ impl ISizeAndMarginsComputer for InternalTable {
parent_flow_inline_size: Au) {
let mut input = self.compute_inline_size_constraint_inputs(block,
parent_flow_inline_size,
layout_context);
layout_context.shared_context());
// Tables are always at least as wide as their minimum inline size.
let minimum_inline_size =

View file

@ -30,6 +30,7 @@ use std::fmt;
use std::ops::Add;
use std::sync::Arc;
use style::computed_values::{border_collapse, table_layout};
use style::context::StyleContext;
use style::logical_geometry::LogicalSize;
use style::properties::{ComputedValues, ServoComputedValues};
use style::servo::SharedStyleContext;
@ -234,7 +235,7 @@ impl TableWrapperFlow {
let input =
inline_size_computer.compute_inline_size_constraint_inputs(&mut self.block_flow,
parent_flow_inline_size,
layout_context);
layout_context.shared_context());
let solution = inline_size_computer.solve_inline_size_constraints(&mut self.block_flow,
&input);
@ -254,7 +255,7 @@ impl TableWrapperFlow {
let input =
inline_size_computer.compute_inline_size_constraint_inputs(&mut self.block_flow,
parent_flow_inline_size,
layout_context);
layout_context.shared_context());
let solution = inline_size_computer.solve_inline_size_constraints(&mut self.block_flow,
&input);
@ -273,7 +274,7 @@ impl TableWrapperFlow {
let input =
inline_size_computer.compute_inline_size_constraint_inputs(&mut self.block_flow,
parent_flow_inline_size,
layout_context);
layout_context.shared_context());
let solution = inline_size_computer.solve_inline_size_constraints(&mut self.block_flow,
&input);