mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Derive ToComputedValue in grid properties.
This commit is contained in:
parent
b9f5388635
commit
5b05aa7c52
1 changed files with 2 additions and 5 deletions
|
@ -291,19 +291,18 @@ ${helpers.predefined_type("object-position",
|
||||||
animation_value_type="discrete">
|
animation_value_type="discrete">
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use style_traits::ToCss;
|
use style_traits::ToCss;
|
||||||
use values::computed::ComputedValueAsSpecified;
|
|
||||||
|
|
||||||
pub type SpecifiedValue = computed_value::T;
|
pub type SpecifiedValue = computed_value::T;
|
||||||
|
|
||||||
pub mod computed_value {
|
pub mod computed_value {
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToComputedValue)]
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub enum AutoFlow {
|
pub enum AutoFlow {
|
||||||
Row,
|
Row,
|
||||||
Column,
|
Column,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToComputedValue)]
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub struct T {
|
pub struct T {
|
||||||
pub autoflow: AutoFlow,
|
pub autoflow: AutoFlow,
|
||||||
|
@ -311,8 +310,6 @@ ${helpers.predefined_type("object-position",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
|
||||||
|
|
||||||
impl ToCss for computed_value::T {
|
impl ToCss for computed_value::T {
|
||||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||||
dest.write_str(match self.autoflow {
|
dest.write_str(match self.autoflow {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue