mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Pass SharedStyleContext to compute_inline_size_constraint_inputs.
This commit is contained in:
parent
5c12755fa6
commit
018bebe90d
3 changed files with 10 additions and 8 deletions
|
@ -2276,10 +2276,10 @@ pub trait ISizeAndMarginsComputer {
|
||||||
fn compute_inline_size_constraint_inputs(&self,
|
fn compute_inline_size_constraint_inputs(&self,
|
||||||
block: &mut BlockFlow,
|
block: &mut BlockFlow,
|
||||||
parent_flow_inline_size: Au,
|
parent_flow_inline_size: Au,
|
||||||
layout_context: &LayoutContext)
|
shared_context: &SharedStyleContext)
|
||||||
-> ISizeConstraintInput {
|
-> ISizeConstraintInput {
|
||||||
let containing_block_inline_size =
|
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_block_direction_margins(containing_block_inline_size);
|
||||||
block.fragment.compute_inline_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,
|
let mut computed_inline_size = self.initial_computed_inline_size(block,
|
||||||
parent_flow_inline_size,
|
parent_flow_inline_size,
|
||||||
layout_context.shared_context());
|
shared_context);
|
||||||
let style = block.fragment.style();
|
let style = block.fragment.style();
|
||||||
match (computed_inline_size, style.get_position().box_sizing) {
|
match (computed_inline_size, style.get_position().box_sizing) {
|
||||||
(MaybeAuto::Specified(size), box_sizing::T::border_box) => {
|
(MaybeAuto::Specified(size), box_sizing::T::border_box) => {
|
||||||
|
@ -2407,7 +2407,7 @@ pub trait ISizeAndMarginsComputer {
|
||||||
parent_flow_inline_size: Au) {
|
parent_flow_inline_size: Au) {
|
||||||
let mut input = self.compute_inline_size_constraint_inputs(block,
|
let mut input = self.compute_inline_size_constraint_inputs(block,
|
||||||
parent_flow_inline_size,
|
parent_flow_inline_size,
|
||||||
layout_context);
|
layout_context.shared_context());
|
||||||
|
|
||||||
let containing_block_inline_size =
|
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, layout_context.shared_context());
|
||||||
|
|
|
@ -25,6 +25,7 @@ use std::cmp;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use style::computed_values::{border_collapse, border_spacing, table_layout};
|
use style::computed_values::{border_collapse, border_spacing, table_layout};
|
||||||
|
use style::context::StyleContext;
|
||||||
use style::logical_geometry::LogicalSize;
|
use style::logical_geometry::LogicalSize;
|
||||||
use style::properties::{ComputedValues, ServoComputedValues};
|
use style::properties::{ComputedValues, ServoComputedValues};
|
||||||
use style::values::CSSFloat;
|
use style::values::CSSFloat;
|
||||||
|
@ -521,7 +522,7 @@ impl ISizeAndMarginsComputer for InternalTable {
|
||||||
parent_flow_inline_size: Au) {
|
parent_flow_inline_size: Au) {
|
||||||
let mut input = self.compute_inline_size_constraint_inputs(block,
|
let mut input = self.compute_inline_size_constraint_inputs(block,
|
||||||
parent_flow_inline_size,
|
parent_flow_inline_size,
|
||||||
layout_context);
|
layout_context.shared_context());
|
||||||
|
|
||||||
// Tables are always at least as wide as their minimum inline size.
|
// Tables are always at least as wide as their minimum inline size.
|
||||||
let minimum_inline_size =
|
let minimum_inline_size =
|
||||||
|
|
|
@ -30,6 +30,7 @@ use std::fmt;
|
||||||
use std::ops::Add;
|
use std::ops::Add;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use style::computed_values::{border_collapse, table_layout};
|
use style::computed_values::{border_collapse, table_layout};
|
||||||
|
use style::context::StyleContext;
|
||||||
use style::logical_geometry::LogicalSize;
|
use style::logical_geometry::LogicalSize;
|
||||||
use style::properties::{ComputedValues, ServoComputedValues};
|
use style::properties::{ComputedValues, ServoComputedValues};
|
||||||
use style::servo::SharedStyleContext;
|
use style::servo::SharedStyleContext;
|
||||||
|
@ -234,7 +235,7 @@ impl TableWrapperFlow {
|
||||||
let input =
|
let input =
|
||||||
inline_size_computer.compute_inline_size_constraint_inputs(&mut self.block_flow,
|
inline_size_computer.compute_inline_size_constraint_inputs(&mut self.block_flow,
|
||||||
parent_flow_inline_size,
|
parent_flow_inline_size,
|
||||||
layout_context);
|
layout_context.shared_context());
|
||||||
|
|
||||||
let solution = inline_size_computer.solve_inline_size_constraints(&mut self.block_flow,
|
let solution = inline_size_computer.solve_inline_size_constraints(&mut self.block_flow,
|
||||||
&input);
|
&input);
|
||||||
|
@ -254,7 +255,7 @@ impl TableWrapperFlow {
|
||||||
let input =
|
let input =
|
||||||
inline_size_computer.compute_inline_size_constraint_inputs(&mut self.block_flow,
|
inline_size_computer.compute_inline_size_constraint_inputs(&mut self.block_flow,
|
||||||
parent_flow_inline_size,
|
parent_flow_inline_size,
|
||||||
layout_context);
|
layout_context.shared_context());
|
||||||
|
|
||||||
let solution = inline_size_computer.solve_inline_size_constraints(&mut self.block_flow,
|
let solution = inline_size_computer.solve_inline_size_constraints(&mut self.block_flow,
|
||||||
&input);
|
&input);
|
||||||
|
@ -273,7 +274,7 @@ impl TableWrapperFlow {
|
||||||
let input =
|
let input =
|
||||||
inline_size_computer.compute_inline_size_constraint_inputs(&mut self.block_flow,
|
inline_size_computer.compute_inline_size_constraint_inputs(&mut self.block_flow,
|
||||||
parent_flow_inline_size,
|
parent_flow_inline_size,
|
||||||
layout_context);
|
layout_context.shared_context());
|
||||||
|
|
||||||
let solution = inline_size_computer.solve_inline_size_constraints(&mut self.block_flow,
|
let solution = inline_size_computer.solve_inline_size_constraints(&mut self.block_flow,
|
||||||
&input);
|
&input);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue