Use conditional compilation for stylo properties

This commit is contained in:
Manish Goregaokar 2016-09-02 15:24:22 +05:30
parent 92c3961743
commit c965beb3d9
No known key found for this signature in database
GPG key ID: 3BBF4D3E2EF79F98
12 changed files with 279 additions and 234 deletions

View file

@ -16,7 +16,7 @@ ${helpers.single_keyword("caption-side", "top bottom",
extra_gecko_values="right left top-outside bottom-outside",
animatable=False)}
<%helpers:longhand name="border-spacing" animatable="False">
<%helpers:longhand name="border-spacing" products="servo" animatable="False">
use app_units::Au;
use values::LocalToCss;
use values::HasViewportPercentage;
@ -26,6 +26,7 @@ ${helpers.single_keyword("caption-side", "top bottom",
pub mod computed_value {
use app_units::Au;
use properties::animated_properties::Interpolate;
#[derive(Clone, Copy, Debug, PartialEq, RustcEncodable)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
@ -33,6 +34,17 @@ ${helpers.single_keyword("caption-side", "top bottom",
pub horizontal: Au,
pub vertical: Au,
}
/// https://drafts.csswg.org/css-transitions/#animtype-simple-list
impl Interpolate for T {
#[inline]
fn interpolate(&self, other: &Self, time: f64) -> Result<Self, ()> {
Ok(T {
horizontal: try!(self.horizontal.interpolate(&other.horizontal, time)),
vertical: try!(self.vertical.interpolate(&other.vertical, time)),
})
}
}
}
impl HasViewportPercentage for SpecifiedValue {