Make window.close() close the window.

This commit is contained in:
Josh Matthews 2013-08-28 15:47:11 -04:00
parent 6c90dd54b2
commit 32ed715055
3 changed files with 6 additions and 0 deletions

View file

@ -67,6 +67,10 @@ impl ScriptListener for CompositorChan {
self.chan.send(InvalidateRect(id, rect)); self.chan.send(InvalidateRect(id, rect));
} }
fn close(&self) {
self.chan.send(Exit);
}
} }
/// Implementation of the abstract `RenderListener` interface. /// Implementation of the abstract `RenderListener` interface.

View file

@ -80,6 +80,7 @@ pub trait RenderListener {
pub trait ScriptListener : Clone { pub trait ScriptListener : Clone {
fn set_ready_state(&self, ReadyState); fn set_ready_state(&self, ReadyState);
fn invalidate_rect(&self, PipelineId, Rect<uint>); fn invalidate_rect(&self, PipelineId, Rect<uint>);
fn close(&self);
} }
/// The interface used by the quadtree to get info about LayerBuffers /// The interface used by the quadtree to get info about LayerBuffers

View file

@ -564,6 +564,7 @@ impl ScriptTask {
} }
page.layout_chan.send(layout_interface::ExitMsg); page.layout_chan.send(layout_interface::ExitMsg);
} }
self.compositor.close();
} }
/// The entry point to document loading. Defines bindings, sets up the window and document /// The entry point to document loading. Defines bindings, sets up the window and document