mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +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
|
@ -6,7 +6,7 @@
|
|||
|
||||
use values::{CSSInteger, CSSFloat};
|
||||
use values::animated::ToAnimatedZero;
|
||||
use values::computed::{NonNegativeAu, NonNegativeNumber};
|
||||
use values::computed::{NonNegativeLength, NonNegativeNumber};
|
||||
use values::computed::length::{Length, LengthOrPercentage};
|
||||
use values::generics::text::InitialLetter as GenericInitialLetter;
|
||||
use values::generics::text::LineHeight as GenericLineHeight;
|
||||
|
@ -22,7 +22,7 @@ pub type LetterSpacing = Spacing<Length>;
|
|||
pub type WordSpacing = Spacing<LengthOrPercentage>;
|
||||
|
||||
/// A computed value for the `line-height` property.
|
||||
pub type LineHeight = GenericLineHeight<NonNegativeNumber, NonNegativeAu>;
|
||||
pub type LineHeight = GenericLineHeight<NonNegativeNumber, NonNegativeLength>;
|
||||
|
||||
impl ToAnimatedZero for LineHeight {
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue