style: Get rid of a few ComputedValueAsSpecified in grid.

Need Box to remove the macro invocation.
This commit is contained in:
Emilio Cobos Álvarez 2017-09-09 14:38:38 +02:00
parent 4c283fbed6
commit a3bfa5db3e
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -10,7 +10,7 @@ use parser::{Parse, ParserContext};
use std::{fmt, mem, usize}; use std::{fmt, mem, usize};
use style_traits::{ToCss, ParseError, StyleParseError}; use style_traits::{ToCss, ParseError, StyleParseError};
use values::{CSSFloat, CustomIdent, serialize_dimension}; use values::{CSSFloat, CustomIdent, serialize_dimension};
use values::computed::{ComputedValueAsSpecified, Context, ToComputedValue}; use values::computed::{Context, ToComputedValue};
use values::specified; use values::specified;
use values::specified::grid::parse_line_names; use values::specified::grid::parse_line_names;
@ -471,7 +471,7 @@ pub enum TrackListValue<LengthOrPercentage, Integer> {
/// The type of a `<track-list>` as determined during parsing. /// The type of a `<track-list>` as determined during parsing.
/// ///
/// https://drafts.csswg.org/css-grid/#typedef-track-list /// https://drafts.csswg.org/css-grid/#typedef-track-list
#[derive(Clone, Copy, Debug, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq, ToComputedValue)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum TrackListType { pub enum TrackListType {
/// [`<auto-track-list>`](https://drafts.csswg.org/css-grid/#typedef-auto-track-list) /// [`<auto-track-list>`](https://drafts.csswg.org/css-grid/#typedef-auto-track-list)
@ -491,8 +491,6 @@ pub enum TrackListType {
Explicit, Explicit,
} }
impl ComputedValueAsSpecified for TrackListType {}
/// A grid `<track-list>` type. /// A grid `<track-list>` type.
/// ///
/// https://drafts.csswg.org/css-grid/#typedef-track-list /// https://drafts.csswg.org/css-grid/#typedef-track-list
@ -573,6 +571,8 @@ pub struct LineNameList {
pub fill_idx: Option<u32>, pub fill_idx: Option<u32>,
} }
trivial_to_computed_value!(LineNameList);
impl Parse for LineNameList { impl Parse for LineNameList {
fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> { fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
input.expect_ident_matching("subgrid")?; input.expect_ident_matching("subgrid")?;
@ -655,8 +655,6 @@ impl ToCss for LineNameList {
} }
} }
impl ComputedValueAsSpecified for LineNameList {}
/// Variants for `<grid-template-rows> | <grid-template-columns>` /// Variants for `<grid-template-rows> | <grid-template-columns>`
/// Subgrid deferred to Level 2 spec due to lack of implementation. /// Subgrid deferred to Level 2 spec due to lack of implementation.
/// But it's implemented in gecko, so we have to as well. /// But it's implemented in gecko, so we have to as well.