style: Properly use integers on grid properties, and derive ToComputedValue.

This commit is contained in:
Emilio Cobos Álvarez 2017-09-09 14:33:53 +02:00
parent 02d24061e7
commit 64ab73eabd
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
7 changed files with 112 additions and 91 deletions

View file

@ -21,9 +21,9 @@ use std::sync::Arc;
use style_traits::ToCss;
use super::{CSSFloat, CSSInteger};
use super::generics::{GreaterThanOrEqualToOne, NonNegative};
use super::generics::grid::{TrackBreadth as GenericTrackBreadth, TrackSize as GenericTrackSize};
use super::generics::grid::{GridLine as GenericGridLine, TrackBreadth as GenericTrackBreadth};
use super::generics::grid::{TrackSize as GenericTrackSize, TrackList as GenericTrackList};
use super::generics::grid::GridTemplateComponent as GenericGridTemplateComponent;
use super::generics::grid::TrackList as GenericTrackList;
use super::specified;
pub use app_units::Au;
@ -44,7 +44,6 @@ pub use self::gecko::ScrollSnapPoint;
pub use self::rect::LengthOrNumberRect;
pub use super::{Auto, Either, None_};
pub use super::specified::BorderStyle;
pub use super::generics::grid::GridLine;
pub use self::length::{CalcLengthOrPercentage, Length, LengthOrNone, LengthOrNumber, LengthOrPercentage};
pub use self::length::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone, MaxLength, MozLength};
pub use self::length::NonNegativeLengthOrPercentage;
@ -502,10 +501,13 @@ pub type TrackSize = GenericTrackSize<LengthOrPercentage>;
/// The computed value of a grid `<track-list>`
/// (could also be `<auto-track-list>` or `<explicit-track-list>`)
pub type TrackList = GenericTrackList<LengthOrPercentage>;
pub type TrackList = GenericTrackList<LengthOrPercentage, Integer>;
/// The computed value of a `<grid-line>`.
pub type GridLine = GenericGridLine<Integer>;
/// `<grid-template-rows> | <grid-template-columns>`
pub type GridTemplateComponent = GenericGridTemplateComponent<LengthOrPercentage>;
pub type GridTemplateComponent = GenericGridTemplateComponent<LengthOrPercentage, Integer>;
impl ClipRectOrAuto {
/// Return an auto (default for clip-rect and image-region) value