#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct MediaTransform3D
{
pub support: bool,
}
impl ToCss for MediaTransform3D
{
fn to_css<W: fmt::Write>(&self, dest: &mut W) -> fmt::Result
{
let value = if self.support
{
1
}
else
{
0
};
value.to_css(dest)
}
}
impl Parse for MediaTransform3D
{
fn parse<'i, 't>(_context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, CustomParseError<'i>>>
{
let support = match input.expect_integer()?
{
0 => false,
1 => true,
invalid @ _ => return Err(ParseError::Custom(CustomParseError::MediaTransform3DMustBeEitherZeroOrOne(invalid))),
};
Ok
(
Self
{
support
}
)
}
}