WRT actively manages a set of WRT widgets at a given time. In low memory situations WRT might decide to close/unload a WRT widget. It is important the that the WRT app gets notified right before the widget gets closed (beforeunload) and also give a change to attach it own unload handler (unload). These are standard HTML5 events as specified here: http://www.whatwg.org/specs/web-apps/current-work/#unloading-documents
The task is to make sure that Webkit implements these events according to the HTML5 spec so that WRT can take advantage of them.