mirror of
https://github.com/servo/servo.git
synced 2025-07-16 20:03:39 +01:00
Make geckolib possible to build on stable Rust
This commit is contained in:
parent
bb916bb38b
commit
2d52b13f2f
6 changed files with 28 additions and 14 deletions
|
@ -10,7 +10,8 @@ use std::sync::Arc;
|
||||||
|
|
||||||
/// A number from 1 to 100, indicating the percentage of the animation where
|
/// A number from 1 to 100, indicating the percentage of the animation where
|
||||||
/// this keyframe should run.
|
/// this keyframe should run.
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, HeapSizeOf)]
|
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)]
|
||||||
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub struct KeyframePercentage(pub f32);
|
pub struct KeyframePercentage(pub f32);
|
||||||
|
|
||||||
impl ::std::cmp::Ord for KeyframePercentage {
|
impl ::std::cmp::Ord for KeyframePercentage {
|
||||||
|
@ -49,7 +50,8 @@ impl KeyframePercentage {
|
||||||
|
|
||||||
/// A keyframes selector is a list of percentages or from/to symbols, which are
|
/// A keyframes selector is a list of percentages or from/to symbols, which are
|
||||||
/// converted at parse time to percentages.
|
/// converted at parse time to percentages.
|
||||||
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub struct KeyframeSelector(Vec<KeyframePercentage>);
|
pub struct KeyframeSelector(Vec<KeyframePercentage>);
|
||||||
impl KeyframeSelector {
|
impl KeyframeSelector {
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -64,7 +66,8 @@ impl KeyframeSelector {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A keyframe.
|
/// A keyframe.
|
||||||
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub struct Keyframe {
|
pub struct Keyframe {
|
||||||
pub selector: KeyframeSelector,
|
pub selector: KeyframeSelector,
|
||||||
pub declarations: Arc<Vec<PropertyDeclaration>>,
|
pub declarations: Arc<Vec<PropertyDeclaration>>,
|
||||||
|
@ -95,14 +98,16 @@ impl Keyframe {
|
||||||
/// is, one autogenerated from the current computed values, or a list of
|
/// is, one autogenerated from the current computed values, or a list of
|
||||||
/// declarations to apply.
|
/// declarations to apply.
|
||||||
// TODO: Find a better name for this?
|
// TODO: Find a better name for this?
|
||||||
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub enum KeyframesStepValue {
|
pub enum KeyframesStepValue {
|
||||||
Declarations(Arc<Vec<PropertyDeclaration>>),
|
Declarations(Arc<Vec<PropertyDeclaration>>),
|
||||||
ComputedValues,
|
ComputedValues,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A single step from a keyframe animation.
|
/// A single step from a keyframe animation.
|
||||||
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub struct KeyframesStep {
|
pub struct KeyframesStep {
|
||||||
/// The percentage of the animation duration when this step starts.
|
/// The percentage of the animation duration when this step starts.
|
||||||
pub start_percentage: KeyframePercentage,
|
pub start_percentage: KeyframePercentage,
|
||||||
|
@ -126,7 +131,8 @@ impl KeyframesStep {
|
||||||
/// of keyframes, in order.
|
/// of keyframes, in order.
|
||||||
///
|
///
|
||||||
/// It only takes into account animable properties.
|
/// It only takes into account animable properties.
|
||||||
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub struct KeyframesAnimation {
|
pub struct KeyframesAnimation {
|
||||||
pub steps: Vec<KeyframesStep>,
|
pub steps: Vec<KeyframesStep>,
|
||||||
/// The properties that change in this animation.
|
/// The properties that change in this animation.
|
||||||
|
|
|
@ -206,7 +206,8 @@
|
||||||
use cssparser::ToCss;
|
use cssparser::ToCss;
|
||||||
use std::fmt;
|
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)}>);
|
pub struct T(pub Vec<${to_camel_case(name)}>);
|
||||||
|
|
||||||
impl ToCss for T {
|
impl ToCss for T {
|
||||||
|
|
|
@ -34,7 +34,8 @@ use values::computed::{CalcLengthOrPercentage, LengthOrPercentage};
|
||||||
|
|
||||||
// NB: This needs to be here because it needs all the longhands generated
|
// NB: This needs to be here because it needs all the longhands generated
|
||||||
// beforehand.
|
// beforehand.
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, HeapSizeOf)]
|
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||||
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub enum TransitionProperty {
|
pub enum TransitionProperty {
|
||||||
All,
|
All,
|
||||||
% for prop in data.longhands:
|
% 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 {
|
pub enum AnimatedProperty {
|
||||||
% for prop in data.longhands:
|
% for prop in data.longhands:
|
||||||
% if prop.animatable:
|
% if prop.animatable:
|
||||||
|
|
|
@ -618,7 +618,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
||||||
|
|
||||||
pub use string_cache::Atom as SingleComputedValue;
|
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>);
|
pub struct T(pub Vec<Atom>);
|
||||||
|
|
||||||
impl ToCss for T {
|
impl ToCss for T {
|
||||||
|
@ -683,7 +684,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
||||||
|
|
||||||
pub use self::AnimationIterationCount as SingleComputedValue;
|
pub use self::AnimationIterationCount as SingleComputedValue;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub enum AnimationIterationCount {
|
pub enum AnimationIterationCount {
|
||||||
Number(u32),
|
Number(u32),
|
||||||
Infinite,
|
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>);
|
pub struct T(pub Vec<AnimationIterationCount>);
|
||||||
|
|
||||||
impl ToCss for T {
|
impl ToCss for T {
|
||||||
|
|
|
@ -67,7 +67,8 @@ pub enum CSSRule<Impl: SelectorImpl> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[derive(Debug, HeapSizeOf, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub struct KeyframesRule {
|
pub struct KeyframesRule {
|
||||||
pub name: Atom,
|
pub name: Atom,
|
||||||
pub keyframes: Vec<Keyframe>,
|
pub keyframes: Vec<Keyframe>,
|
||||||
|
|
|
@ -18,6 +18,7 @@ default = ["servo_features"]
|
||||||
# recompiled when building both Servo and geckolib in the same source tree.
|
# recompiled when building both Servo and geckolib in the same source tree.
|
||||||
servo_features = [
|
servo_features = [
|
||||||
"heapsize",
|
"heapsize",
|
||||||
|
"selectors/unstable",
|
||||||
"style/servo",
|
"style/servo",
|
||||||
"time",
|
"time",
|
||||||
"url/query_encoding",
|
"url/query_encoding",
|
||||||
|
@ -36,7 +37,7 @@ lazy_static = "0.2"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
log = {version = "0.3.5", features = ["release_max_level_info"]}
|
log = {version = "0.3.5", features = ["release_max_level_info"]}
|
||||||
num_cpus = "0.2.2"
|
num_cpus = "0.2.2"
|
||||||
selectors = {version = "0.6", features = ["unstable"]}
|
selectors = "0.6"
|
||||||
smallvec = "0.1"
|
smallvec = "0.1"
|
||||||
string_cache = {version = "0.2.20", features = ["unstable"]}
|
string_cache = {version = "0.2.20", features = ["unstable"]}
|
||||||
style = {path = "../../components/style", features = ["gecko"]}
|
style = {path = "../../components/style", features = ["gecko"]}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue