servo: Resize event is not fired when resizing window in headless mode

Compare:

<script>
window.onresize = function() { console.log("resize event"); }
window.resizeTo(200, 200);
console.log("called resizeTo");
</script>
$ ./mach run foo.html
called resizeTo
resize event
$ ./mach run foo.html --headless
called resizeTo

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 15 (13 by maintainers)

Commits related to this issue

Most upvoted comments

  1. Verify the testcase behaves as described.
  2. Trace the execution from Window::ResizeTo in components/script/dom/window.rs to the code that I mentioned in previous comments to verify my guesses
  3. Modify ports/glutin/window.rs as suggested and see if anything changes
  4. Trace what happens in the non-headless case and how that causes a resize event to reach the script thread (probably via a callback in components/compositing/compositor.rs)