mirror of
https://github.com/servo/servo.git
synced 2025-08-17 03:15:34 +01:00
Introduce CSSPixelLength and update NonNegativeLength.
First, we define computed::CSSPixelLength which contains a CSSFloat, a pixel value, and then we replace computed::Length with CSSPixelLength. Therefore, the |ComputedValue| of NoCalcLength, AbsoluteLength, FontRelativeLength, ViewportPercentageLength, CharacterWidth, and PhysicalLength is CSSPixelLength. Besides, we drop NonNegativeAu, and replace computed::NonNegativeLength with NonNegative<computed::Length>. (i.e. NonNegative<CSSPixelLength>)
This commit is contained in:
parent
cad3aff508
commit
a949e2a057
40 changed files with 502 additions and 406 deletions
|
@ -735,7 +735,7 @@ impl MaybeNew for ViewportConstraints {
|
|||
match *$value {
|
||||
ViewportLength::Specified(ref length) => match *length {
|
||||
LengthOrPercentageOrAuto::Length(ref value) =>
|
||||
Some(value.to_computed_value(&context)),
|
||||
Some(Au::from(value.to_computed_value(&context))),
|
||||
LengthOrPercentageOrAuto::Percentage(value) =>
|
||||
Some(initial_viewport.$dimension.scale_by(value.0)),
|
||||
LengthOrPercentageOrAuto::Auto => None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue