mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: More useful logging for transition-related stuff.
Transitions are still broken, but I found these messages more helpful than the previous ones when diagnosing problems.
This commit is contained in:
parent
a949e9e1e8
commit
561e9c81f1
7 changed files with 32 additions and 32 deletions
|
@ -89,6 +89,8 @@ pub fn update_animation_state<E>(
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
debug!("update_animation_state({:?}): {:?}", still_running, running_animation);
|
||||||
|
|
||||||
if still_running {
|
if still_running {
|
||||||
animations_still_running.push(running_animation);
|
animations_still_running.push(running_animation);
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -438,9 +438,16 @@ pub fn start_transitions_if_applicable(
|
||||||
.iter()
|
.iter()
|
||||||
.any(|animation| animation.has_the_same_end_value_as(&property_animation))
|
.any(|animation| animation.has_the_same_end_value_as(&property_animation))
|
||||||
{
|
{
|
||||||
|
debug!(
|
||||||
|
"Not initiating transition for {}, other transition \
|
||||||
|
found with the same end value",
|
||||||
|
property_animation.property_name()
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug!("Kicking off transition of {:?}", property_animation);
|
||||||
|
|
||||||
// Kick off the animation.
|
// Kick off the animation.
|
||||||
let box_style = new_style.get_box();
|
let box_style = new_style.get_box();
|
||||||
let now = timer.seconds();
|
let now = timer.seconds();
|
||||||
|
@ -451,7 +458,7 @@ pub fn start_transitions_if_applicable(
|
||||||
start_time,
|
start_time,
|
||||||
AnimationFrame {
|
AnimationFrame {
|
||||||
duration: box_style.transition_duration_mod(i).seconds() as f64,
|
duration: box_style.transition_duration_mod(i).seconds() as f64,
|
||||||
property_animation: property_animation,
|
property_animation,
|
||||||
},
|
},
|
||||||
)).unwrap();
|
)).unwrap();
|
||||||
|
|
||||||
|
@ -657,12 +664,11 @@ pub fn update_style_for_animation<E>(
|
||||||
where
|
where
|
||||||
E: TElement,
|
E: TElement,
|
||||||
{
|
{
|
||||||
debug!("update_style_for_animation: entering");
|
debug!("update_style_for_animation: {:?}", animation);
|
||||||
debug_assert!(!animation.is_expired());
|
debug_assert!(!animation.is_expired());
|
||||||
|
|
||||||
match *animation {
|
match *animation {
|
||||||
Animation::Transition(_, start_time, ref frame) => {
|
Animation::Transition(_, start_time, ref frame) => {
|
||||||
debug!("update_style_for_animation: transition found");
|
|
||||||
let now = context.timer.seconds();
|
let now = context.timer.seconds();
|
||||||
let mut new_style = (*style).clone();
|
let mut new_style = (*style).clone();
|
||||||
let updated_style =
|
let updated_style =
|
||||||
|
@ -678,10 +684,6 @@ where
|
||||||
AnimationUpdate::Regular
|
AnimationUpdate::Regular
|
||||||
},
|
},
|
||||||
Animation::Keyframes(_, ref animation, ref name, ref state) => {
|
Animation::Keyframes(_, ref animation, ref name, ref state) => {
|
||||||
debug!(
|
|
||||||
"update_style_for_animation: animation found: \"{}\", {:?}",
|
|
||||||
name, state
|
|
||||||
);
|
|
||||||
let duration = state.duration;
|
let duration = state.duration;
|
||||||
let started_at = state.started_at;
|
let started_at = state.started_at;
|
||||||
|
|
||||||
|
@ -716,11 +718,6 @@ where
|
||||||
total_progress = 1.;
|
total_progress = 1.;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!(
|
|
||||||
"update_style_for_animation: anim \"{}\", steps: {:?}, state: {:?}, progress: {}",
|
|
||||||
name, animation.steps, state, total_progress
|
|
||||||
);
|
|
||||||
|
|
||||||
// Get the target and the last keyframe position.
|
// Get the target and the last keyframe position.
|
||||||
let last_keyframe_position;
|
let last_keyframe_position;
|
||||||
let target_keyframe_position;
|
let target_keyframe_position;
|
||||||
|
@ -865,6 +862,7 @@ pub fn complete_expired_transitions(
|
||||||
had_animations_to_expire = animations_to_expire.is_some();
|
had_animations_to_expire = animations_to_expire.is_some();
|
||||||
if let Some(ref animations) = animations_to_expire {
|
if let Some(ref animations) = animations_to_expire {
|
||||||
for animation in *animations {
|
for animation in *animations {
|
||||||
|
debug!("Updating expired animation {:?}", animation);
|
||||||
// TODO: support animation-fill-mode
|
// TODO: support animation-fill-mode
|
||||||
if let Animation::Transition(_, _, ref frame) = *animation {
|
if let Animation::Transition(_, _, ref frame) = *animation {
|
||||||
frame.property_animation.update(Arc::make_mut(style), 1.0);
|
frame.property_animation.update(Arc::make_mut(style), 1.0);
|
||||||
|
|
|
@ -602,17 +602,8 @@ trait PrivateMatchMethods: TElement {
|
||||||
|
|
||||||
let mut all_running_animations = context.running_animations.write();
|
let mut all_running_animations = context.running_animations.write();
|
||||||
for mut running_animation in all_running_animations.get_mut(&this_opaque).unwrap() {
|
for mut running_animation in all_running_animations.get_mut(&this_opaque).unwrap() {
|
||||||
// This shouldn't happen frequently, but under some circumstances
|
if let Animation::Transition(_, _, ref frame) = *running_animation {
|
||||||
// mainly huge load or debug builds, the constellation might be
|
possibly_expired_animations.push(frame.property_animation.clone());
|
||||||
// delayed in sending the `TickAllAnimations` message to layout.
|
|
||||||
//
|
|
||||||
// Thus, we can't assume all the animations have been already
|
|
||||||
// updated by layout, because other restyle due to script might be
|
|
||||||
// triggered by layout before the animation tick.
|
|
||||||
//
|
|
||||||
// See #12171 and the associated PR for an example where this
|
|
||||||
// happened while debugging other release panic.
|
|
||||||
if running_animation.is_expired() {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,9 +615,7 @@ trait PrivateMatchMethods: TElement {
|
||||||
);
|
);
|
||||||
|
|
||||||
match *running_animation {
|
match *running_animation {
|
||||||
Animation::Transition(_, _, ref frame) => {
|
Animation::Transition(..) => unreachable!(),
|
||||||
possibly_expired_animations.push(frame.property_animation.clone())
|
|
||||||
}
|
|
||||||
Animation::Keyframes(_, _, _, ref mut state) => {
|
Animation::Keyframes(_, _, _, ref mut state) => {
|
||||||
match update {
|
match update {
|
||||||
AnimationUpdate::Regular => {},
|
AnimationUpdate::Regular => {},
|
||||||
|
|
|
@ -127,17 +127,22 @@ pub enum AnimatedProperty {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AnimatedProperty {
|
impl AnimatedProperty {
|
||||||
/// Get the name of this property.
|
/// Get the id of the property we're animating.
|
||||||
pub fn name(&self) -> &'static str {
|
pub fn id(&self) -> LonghandId {
|
||||||
match *self {
|
match *self {
|
||||||
% for prop in data.longhands:
|
% for prop in data.longhands:
|
||||||
% if prop.animatable and not prop.logical:
|
% if prop.animatable and not prop.logical:
|
||||||
AnimatedProperty::${prop.camel_case}(..) => "${prop.name}",
|
AnimatedProperty::${prop.camel_case}(..) => LonghandId::${prop.camel_case},
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the name of this property.
|
||||||
|
pub fn name(&self) -> &'static str {
|
||||||
|
self.id().name()
|
||||||
|
}
|
||||||
|
|
||||||
/// Whether this interpolation does animate, that is, whether the start and
|
/// Whether this interpolation does animate, that is, whether the start and
|
||||||
/// end values are different.
|
/// end values are different.
|
||||||
pub fn does_animate(&self) -> bool {
|
pub fn does_animate(&self) -> bool {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[font-style-interpolation.html]
|
[font-style-interpolation.html]
|
||||||
bug: https://github.com/servo/servo/issues/21570
|
bug: https://github.com/servo/servo/issues/21570
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
[font-style animation]
|
[font-style transition]
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
[variable-transitions-transition-property-all-before-value.html]
|
||||||
|
[Verify substituted color value after transition]
|
||||||
|
expected: FAIL
|
|
@ -0,0 +1,3 @@
|
||||||
|
[variable-transitions-value-before-transition-property-all.html]
|
||||||
|
[Verify substituted color value after transition]
|
||||||
|
expected: FAIL
|
Loading…
Add table
Add a link
Reference in a new issue