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:
Emilio Cobos Álvarez 2016-08-05 13:38:58 -07:00
parent fc4fc773b4
commit 805988e839
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -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);
} }