diff --git a/components/style/animation.rs b/components/style/animation.rs index 5d96f5cacd1..59d45dc6302 100644 --- a/components/style/animation.rs +++ b/components/style/animation.rs @@ -369,22 +369,6 @@ impl PropertyAnimation { GenericTimingFunction::Steps(steps, StepPosition::End) => { (time * (steps as f64)).floor() / (steps as f64) }, - GenericTimingFunction::Frames(frames) => { - // https://drafts.csswg.org/css-timing/#frames-timing-functions - let mut out = (time * (frames as f64)).floor() / ((frames - 1) as f64); - if out > 1.0 { - // FIXME: Basically, during the animation sampling process, the input progress - // should be in the range of [0, 1]. However, |time| is not accurate enough - // here, which means |time| could be larger than 1.0 in the last animation - // frame. (It should be equal to 1.0 exactly.) This makes the output of frames - // timing function jumps to the next frame/level. - // However, this solution is still not correct because |time| is possible - // outside the range of [0, 1] after introducing Web Animations. We should fix - // this problem when implementing web animations. - out = 1.0; - } - out - }, GenericTimingFunction::Keyword(keyword) => { let (x1, x2, y1, y2) = keyword.to_bezier(); Bezier::new(x1, x2, y1, y2).solve(time, epsilon) diff --git a/components/style/gecko_bindings/sugar/ns_timing_function.rs b/components/style/gecko_bindings/sugar/ns_timing_function.rs index 635b1f86768..8d7e68b5b44 100644 --- a/components/style/gecko_bindings/sugar/ns_timing_function.rs +++ b/components/style/gecko_bindings/sugar/ns_timing_function.rs @@ -22,17 +22,7 @@ impl nsTimingFunction { self.__bindgen_anon_1 .__bindgen_anon_1 .as_mut() - .mStepsOrFrames = steps; - } - } - - fn set_as_frames(&mut self, frames: u32) { - self.mType = nsTimingFunction_Type::Frames; - unsafe { - self.__bindgen_anon_1 - .__bindgen_anon_1 - .as_mut() - .mStepsOrFrames = frames; + .mSteps = steps; } } @@ -74,10 +64,6 @@ impl From for nsTimingFunction { debug_assert!(steps.value() >= 0); tf.set_as_step(nsTimingFunction_Type::StepEnd, steps.value() as u32); }, - GenericTimingFunction::Frames(frames) => { - debug_assert!(frames.value() >= 2); - tf.set_as_frames(frames.value() as u32); - }, GenericTimingFunction::CubicBezier { x1, y1, x2, y2 } => { tf.set_as_bezier( nsTimingFunction_Type::CubicBezier, @@ -105,7 +91,7 @@ impl From for ComputedTimingFunction { .__bindgen_anon_1 .__bindgen_anon_1 .as_ref() - .mStepsOrFrames + .mSteps }, StepPosition::Start, ), @@ -115,17 +101,10 @@ impl From for ComputedTimingFunction { .__bindgen_anon_1 .__bindgen_anon_1 .as_ref() - .mStepsOrFrames + .mSteps }, StepPosition::End, ), - nsTimingFunction_Type::Frames => GenericTimingFunction::Frames(unsafe { - function - .__bindgen_anon_1 - .__bindgen_anon_1 - .as_ref() - .mStepsOrFrames - }), nsTimingFunction_Type::Ease => GenericTimingFunction::Keyword(TimingKeyword::Ease), nsTimingFunction_Type::Linear => GenericTimingFunction::Keyword(TimingKeyword::Linear), nsTimingFunction_Type::EaseIn => GenericTimingFunction::Keyword(TimingKeyword::EaseIn), diff --git a/components/style/values/generics/transform.rs b/components/style/values/generics/transform.rs index d398b40c3f1..61c9821a816 100644 --- a/components/style/values/generics/transform.rs +++ b/components/style/values/generics/transform.rs @@ -92,7 +92,7 @@ pub struct TransformOrigin { /// A generic timing function. /// -/// +/// https://drafts.csswg.org/css-easing-1/#timing-functions #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)] #[value_info(ty = "TIMING_FUNCTION")] pub enum TimingFunction { @@ -111,9 +111,6 @@ pub enum TimingFunction { #[css(comma, function)] #[value_info(other_values = "step-start,step-end")] Steps(Integer, #[css(skip_if = "is_end")] StepPosition), - /// `frames()` - #[css(comma, function)] - Frames(Integer), } #[allow(missing_docs)] diff --git a/components/style/values/specified/transform.rs b/components/style/values/specified/transform.rs index 835d505836c..749a3d7b265 100644 --- a/components/style/values/specified/transform.rs +++ b/components/style/values/specified/transform.rs @@ -350,19 +350,6 @@ impl OriginComponent { } } -#[cfg(feature = "gecko")] -#[inline] -fn allow_frames_timing() -> bool { - use gecko_bindings::structs::mozilla; - unsafe { mozilla::StaticPrefs_sVarCache_layout_css_frames_timing_enabled } -} - -#[cfg(feature = "servo")] -#[inline] -fn allow_frames_timing() -> bool { - true -} - impl Parse for TimingFunction { fn parse<'i, 't>( context: &ParserContext, @@ -406,14 +393,6 @@ impl Parse for TimingFunction { }).unwrap_or(StepPosition::End); Ok(generic::TimingFunction::Steps(steps, position)) }, - "frames" => { - if allow_frames_timing() { - let frames = Integer::parse_with_minimum(context, i, 2)?; - Ok(generic::TimingFunction::Frames(frames)) - } else { - Err(()) - } - }, _ => Err(()), }).map_err(|()| { location.new_custom_error(StyleParseErrorKind::UnexpectedFunction(function.clone())) @@ -440,9 +419,6 @@ impl ToComputedValue for TimingFunction { generic::TimingFunction::Steps(steps, position) => { generic::TimingFunction::Steps(steps.to_computed_value(context) as u32, position) }, - generic::TimingFunction::Frames(frames) => { - generic::TimingFunction::Frames(frames.to_computed_value(context) as u32) - }, } } @@ -465,9 +441,6 @@ impl ToComputedValue for TimingFunction { Integer::from_computed_value(&(steps as i32)), position, ), - generic::TimingFunction::Frames(frames) => { - generic::TimingFunction::Frames(Integer::from_computed_value(&(frames as i32))) - }, } } }