mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Rename the MinMaxConstraint to SizeConstraint and enhancement
Renamed to `SizeConstraint`, add an optional `border` parameter to deal with `box-sizing: border-box`, and fix its bug when involving with `calc`.
This commit is contained in:
parent
b9a8ccd775
commit
39780e894b
3 changed files with 66 additions and 49 deletions
|
@ -19,7 +19,7 @@ use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
|||
use gfx::display_list::StackingContext;
|
||||
use gfx_traits::ScrollRootId;
|
||||
use layout_debug;
|
||||
use model::{IntrinsicISizes, MaybeAuto, MinMaxConstraint};
|
||||
use model::{IntrinsicISizes, MaybeAuto, SizeConstraint};
|
||||
use model::{specified, specified_or_none};
|
||||
use std::cmp::{max, min};
|
||||
use std::ops::Range;
|
||||
|
@ -38,7 +38,7 @@ use style::values::computed::{LengthOrPercentageOrAutoOrContent, LengthOrPercent
|
|||
#[derive(Debug)]
|
||||
enum AxisSize {
|
||||
Definite(Au),
|
||||
MinMax(MinMaxConstraint),
|
||||
MinMax(SizeConstraint),
|
||||
Infinite,
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ impl AxisSize {
|
|||
}
|
||||
}
|
||||
LengthOrPercentageOrAuto::Auto => {
|
||||
AxisSize::MinMax(MinMaxConstraint::new(content_size, min, max))
|
||||
AxisSize::MinMax(SizeConstraint::new(content_size, min, max, None))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue