Add from_computed_value() function for converting computed values to specified

This commit is contained in:
Manish Goregaokar 2016-09-11 22:24:28 +05:30
parent 153ec64c15
commit d81c6af59c
17 changed files with 555 additions and 1 deletions

View file

@ -238,5 +238,16 @@ ${helpers.single_keyword("mask-composite",
computed_value::T::Url(url.clone(), data.clone()),
}
}
#[inline]
fn from_computed_value(computed: &computed_value::T) -> Self {
match *computed {
computed_value::T::None => SpecifiedValue::None,
computed_value::T::Image(ref image) =>
SpecifiedValue::Image(ToComputedValue::from_computed_value(image)),
computed_value::T::Url(ref url, ref data) =>
SpecifiedValue::Url(url.clone(), data.clone()),
}
}
}
</%helpers:vector_longhand>