mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Use conditional compilation for stylo properties
This commit is contained in:
parent
92c3961743
commit
c965beb3d9
12 changed files with 279 additions and 234 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue