Make geckolib possible to build on stable Rust

This commit is contained in:
Simon Sapin 2016-07-05 14:53:37 +02:00
parent bb916bb38b
commit 2d52b13f2f
6 changed files with 28 additions and 14 deletions

View file

@ -206,7 +206,8 @@
use cssparser::ToCss;
use std::fmt;
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct T(pub Vec<${to_camel_case(name)}>);
impl ToCss for T {

View file

@ -34,7 +34,8 @@ use values::computed::{CalcLengthOrPercentage, LengthOrPercentage};
// NB: This needs to be here because it needs all the longhands generated
// beforehand.
#[derive(Copy, Clone, Debug, PartialEq, HeapSizeOf)]
#[derive(Copy, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum TransitionProperty {
All,
% for prop in data.longhands:
@ -92,7 +93,8 @@ impl ToCss for TransitionProperty {
}
}
#[derive(Clone, Debug, PartialEq, HeapSizeOf)]
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum AnimatedProperty {
% for prop in data.longhands:
% if prop.animatable:

View file

@ -618,7 +618,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
pub use string_cache::Atom as SingleComputedValue;
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct T(pub Vec<Atom>);
impl ToCss for T {
@ -683,7 +684,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
pub use self::AnimationIterationCount as SingleComputedValue;
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum AnimationIterationCount {
Number(u32),
Infinite,
@ -698,7 +700,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
}
}
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct T(pub Vec<AnimationIterationCount>);
impl ToCss for T {