<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16608" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I made a quick look through the HTML 5 Working 
Draft table of contents, as well as Anne's "differences" document and went 
looking through <A 
href="http://www.w3.org/html/wg/html5/#processing2">http://www.w3.org/html/wg/html5/#processing2</A> the 
changes on the network and processing models to see if this was covered or not, 
but didn't see it. I probably missed it, but noticed something today that I was 
fooling around with some years ago and wondered if it has been 
addressed.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The user opens a web application as one of many 
tabs in a web browser. They then, either within the application window, 
accidentally hit CTRL W (or its Mac equivalent), or from the operating system, 
issue a close application command. Most apps (as opposed to the more "passive" 
browsers) detect that new content has been developed and in is jeopardy of being 
lost and therefore prompt the user to the status of this possible data loss. The 
browser, unless I'm missing something, seems to have a different status within 
the OS and just closes without ceremony.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The way I've handled this is the past is to have an 
onunload script associated with the body: onunload="if (confirm('Save before 
quitting')) (SaveIt());" where SaveIt is some magic function which writes to 
disk (I understand that such a technique will standardize writing to local drive 
space in HTML5). I also understand that there will be ways of overriding the 
default definitions of CTRL-W etc. so that the developer may change these 
unpleasantries inherited from the browser. However, in the case of the solution 
using onload/confirm, (if you're not averse to using IE and looking at VML then 
see <A 
href="http://srufaculty.sru.edu/david.dailey/grapher/grapher.96.html">http://srufaculty.sru.edu/david.dailey/grapher/grapher.96.html</A> for 
an example) , you have two choices: save and cancel -- "cancel" terminates 
without saving, "save" terminates after saving.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Has this group or HTMLWG yet decided on a way 
of preventing accidental loss of work for web applications in a way similar 
to how "applications" handle the situation?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>cheers,</FONT></DIV>
<DIV><FONT face=Arial size=2>David</FONT></DIV></BODY></HTML>