mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
compositor: Send animation ticks to layout even if there are script animation frames.
The script tick ends up only processing JS callbacks related to animation frames, so CSS transitions/animations end up not working as expected. This could have accidentally worked before #12563 because we over-restyled, but now this is no longer the case. Other possible way to do it is making a layout reflow with RAF handle CSS animations/transitions too, but that may not work if the reflow ends up being suppressed (that could very well be the case), and we'd need to handle a lot more state in the document, so this solution (assuming it doesn't break try) seems a bit less flacky. Fixes #12749.
This commit is contained in:
parent
fc4fc773b4
commit
805988e839
1 changed files with 9 additions and 6 deletions
|
@ -1786,12 +1786,15 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
||||||
fn tick_animations_for_pipeline(&mut self, pipeline_id: PipelineId) {
|
fn tick_animations_for_pipeline(&mut self, pipeline_id: PipelineId) {
|
||||||
self.schedule_delayed_composite_if_necessary();
|
self.schedule_delayed_composite_if_necessary();
|
||||||
let animation_callbacks_running = self.pipeline_details(pipeline_id).animation_callbacks_running;
|
let animation_callbacks_running = self.pipeline_details(pipeline_id).animation_callbacks_running;
|
||||||
let animation_type = if animation_callbacks_running {
|
if animation_callbacks_running {
|
||||||
AnimationTickType::Script
|
let msg = ConstellationMsg::TickAnimation(pipeline_id, AnimationTickType::Script);
|
||||||
} else {
|
if let Err(e) = self.constellation_chan.send(msg) {
|
||||||
AnimationTickType::Layout
|
warn!("Sending tick to constellation failed ({}).", e);
|
||||||
};
|
}
|
||||||
let msg = ConstellationMsg::TickAnimation(pipeline_id, animation_type);
|
}
|
||||||
|
|
||||||
|
// We still need to tick layout unfortunately, see things like #12749.
|
||||||
|
let msg = ConstellationMsg::TickAnimation(pipeline_id, AnimationTickType::Layout);
|
||||||
if let Err(e) = self.constellation_chan.send(msg) {
|
if let Err(e) = self.constellation_chan.send(msg) {
|
||||||
warn!("Sending tick to constellation failed ({}).", e);
|
warn!("Sending tick to constellation failed ({}).", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue