Bug 1459436: Implement Debug for KeyframeAnimationStyle by hand. r=emilio

The ComputedValues format is huge and unneeded.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>

MozReview-Commit-ID: 44OuCMWJPLk
This commit is contained in:
Emilio Cobos Álvarez 2018-05-05 17:39:12 +02:00
Родитель 6ee6a58a0f
Коммит d6f79cd48e
1 изменённых файлов: 18 добавлений и 1 удалений

Просмотреть файл

@ -16,6 +16,7 @@ use properties::longhands::animation_direction::computed_value::single_value::T
use properties::longhands::animation_play_state::computed_value::single_value::T as AnimationPlayState;
use rule_tree::CascadeLevel;
use servo_arc::Arc;
use std::fmt;
use std::sync::mpsc::Sender;
use stylesheets::keyframes_rule::{KeyframesAnimation, KeyframesStep, KeyframesStepValue};
use timer::Timer;
@ -52,7 +53,7 @@ pub enum KeyframesRunningState {
/// duration, the current and maximum iteration count, and the state (either
/// playing or paused).
// TODO: unify the use of f32/f64 in this file.
#[derive(Clone, Debug)]
#[derive(Clone)]
pub struct KeyframesAnimationState {
/// The time this animation started at.
pub started_at: f64,
@ -183,6 +184,22 @@ impl KeyframesAnimationState {
}
}
impl fmt::Debug for KeyframesAnimationState {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("KeyframesAnimationState")
.field("started_at", &self.started_at)
.field("duration", &self.duration)
.field("delay", &self.delay)
.field("iteration_state", &self.iteration_state)
.field("running_state", &self.running_state)
.field("direction", &self.direction)
.field("current_direction", &self.current_direction)
.field("expired", &self.expired)
.field("cascade_style", &())
.finish()
}
}
/// State relating to an animation.
#[derive(Clone, Debug)]
pub enum Animation {