#[derive(Debug, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
pub enum ViewportZoom
{
auto,
value(CalculablePropertyValue<NumberOrPercentageUnit<CssUnsignedNumber>>),
}
impl ToCss for ViewportZoom
{
fn to_css<W: fmt::Write>(&self, dest: &mut W) -> fmt::Result
{
use self::ViewportZoom::*;
match *self
{
auto => dest.write_str("auto"),
value(ref calculable) => calculable.to_css(dest),
}
}
}
impl ViewportZoom
{
pub(crate) fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, CustomParseError<'i>>>
{
use self::ViewportZoom::*;
if input.try(|input| input.expect_ident_matching("auto")).is_ok()
{
return Ok(auto);
}
Ok(value(NumberOrPercentageUnit::parse_one_outside_calc_function(context, input)?))
}
}