diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-08-28 11:26:09 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-08-28 11:26:09 -0600 |
commit | 064b72ac97197e7d1c6cbfd14a4546822c662332 (patch) | |
tree | a8824a050f20f1d21e9504629549e78c8a578128 | |
parent | 72125f070d7faa0f3a927cf8150fabfb382648e7 (diff) | |
parent | 103feca08bf368935a1854afd6a09082e1f79277 (diff) | |
download | servo-064b72ac97197e7d1c6cbfd14a4546822c662332.tar.gz servo-064b72ac97197e7d1c6cbfd14a4546822c662332.zip |
Auto merge of #7417 - glennw:headless-raf, r=pcwalton
Fix requestAnimationFrame in headless mode. Fixes #7296.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7417)
<!-- Reviewable:end -->
3 files changed, 13 insertions, 9 deletions
diff --git a/components/compositing/headless.rs b/components/compositing/headless.rs index d56c50de1d2..d8f952beada 100644 --- a/components/compositing/headless.rs +++ b/components/compositing/headless.rs @@ -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(..) | diff --git a/tests/wpt/mozilla/meta/mozilla/window_requestAnimationFrame2.html.ini b/tests/wpt/mozilla/meta/mozilla/window_requestAnimationFrame2.html.ini deleted file mode 100644 index 6dfbd043f37..00000000000 --- a/tests/wpt/mozilla/meta/mozilla/window_requestAnimationFrame2.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[window_requestAnimationFrame2.html] - type: testharness - expected: TIMEOUT - [Test throwing an error inside requestAnimationFrame callback] - expected: NOTRUN - diff --git a/tests/wpt/mozilla/tests/mozilla/window_requestAnimationFrame.html b/tests/wpt/mozilla/tests/mozilla/window_requestAnimationFrame.html index e9c9e5789b0..8738fcc707e 100644 --- a/tests/wpt/mozilla/tests/mozilla/window_requestAnimationFrame.html +++ b/tests/wpt/mozilla/tests/mozilla/window_requestAnimationFrame.html @@ -8,8 +8,6 @@ <script> async_test(function() { window.requestAnimationFrame(this.step_func_done()); - // FIXME(#7296) - setTimeout(this.step_func_done(), 500); }); </script> </body> |