mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Fix requestAnimationFrame in headless mode. Fixes #7296.
This commit is contained in:
parent
856fda7f2e
commit
103feca08b
3 changed files with 13 additions and 9 deletions
|
@ -7,6 +7,7 @@ use windowing::WindowEvent;
|
|||
|
||||
use euclid::scale_factor::ScaleFactor;
|
||||
use euclid::size::Size2D;
|
||||
use msg::constellation_msg::AnimationState;
|
||||
use msg::constellation_msg::Msg as ConstellationMsg;
|
||||
use msg::constellation_msg::{ConstellationChan, WindowSizeData};
|
||||
use profile_traits::mem;
|
||||
|
@ -88,6 +89,18 @@ impl CompositorEventListener for NullCompositor {
|
|||
response_chan.send(()).unwrap();
|
||||
}
|
||||
|
||||
Msg::ChangeRunningAnimationsState(pipeline_id, animation_state) => {
|
||||
match animation_state {
|
||||
AnimationState::AnimationsPresent |
|
||||
AnimationState::NoAnimationsPresent |
|
||||
AnimationState::NoAnimationCallbacksPresent => {}
|
||||
AnimationState::AnimationCallbacksPresent => {
|
||||
let msg = ConstellationMsg::TickAnimation(pipeline_id);
|
||||
self.constellation_chan.0.send(msg).unwrap()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Explicitly list ignored messages so that when we add a new one,
|
||||
// we'll notice and think about whether it needs a response, like
|
||||
// SetFrameTree.
|
||||
|
@ -95,7 +108,6 @@ impl CompositorEventListener for NullCompositor {
|
|||
Msg::InitializeLayersForPipeline(..) |
|
||||
Msg::SetLayerRect(..) |
|
||||
Msg::AssignPaintedBuffers(..) |
|
||||
Msg::ChangeRunningAnimationsState(..) |
|
||||
Msg::ScrollFragmentPoint(..) |
|
||||
Msg::Status(..) |
|
||||
Msg::LoadStart(..) |
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
[window_requestAnimationFrame2.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[Test throwing an error inside requestAnimationFrame callback]
|
||||
expected: NOTRUN
|
||||
|
|
@ -8,8 +8,6 @@
|
|||
<script>
|
||||
async_test(function() {
|
||||
window.requestAnimationFrame(this.step_func_done());
|
||||
// FIXME(#7296)
|
||||
setTimeout(this.step_func_done(), 500);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue