style: Derive ToComputedValue in grid properties.

This commit is contained in:
Emilio Cobos Álvarez 2017-09-09 13:25:53 +02:00
parent b9f5388635
commit 5b05aa7c52
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -291,19 +291,18 @@ ${helpers.predefined_type("object-position",
animation_value_type="discrete">
use std::fmt;
use style_traits::ToCss;
use values::computed::ComputedValueAsSpecified;
pub type SpecifiedValue = computed_value::T;
pub mod computed_value {
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToComputedValue)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum AutoFlow {
Row,
Column,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToComputedValue)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct T {
pub autoflow: AutoFlow,
@ -311,8 +310,6 @@ ${helpers.predefined_type("object-position",
}
}
impl ComputedValueAsSpecified for SpecifiedValue {}
impl ToCss for computed_value::T {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
dest.write_str(match self.autoflow {