hixie: Call beforeunload earlier in the process. (whatwg r4108)

hixie: Call beforeunload earlier in the process. (whatwg r4108)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.3266&r2=1.3267&f=h
http://html5.org/tools/web-apps-tracker?from=4107&to=4108

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.3266
retrieving revision 1.3267
diff -u -d -r1.3266 -r1.3267
--- Overview.html 12 Oct 2009 01:33:30 -0000 1.3266
+++ Overview.html 12 Oct 2009 05:23:18 -0000 1.3267
@@ -8531,11 +8531,14 @@
 
    </li>
 
+   <li><p><a href="#prompt-to-unload-a-document" title="prompt to unload a document">Prompt to
+   unload</a> the <code>Document</code> object. If the user
+   <a href="#refused-to-allow-the-document-to-be-unloaded">refused to allow the document to be unloaded</a>, then
+   these steps must be aborted.</li>
+
    <li><p><a href="#unload-a-document" title="unload a document">Unload</a> the
    <code>Document</code> object, with the <var title="">recycle</var>
-   parameter set to true. If the user <a href="#refused-to-allow-the-document-to-be-unloaded">refused to allow the
-   document to be unloaded</a>, then these steps must be
-   aborted.</li>
+   parameter set to true.</li>
 
    <li><p>If the document has an <a href="#active-parser">active parser</a>, then
    abort that parser, and throw away any pending content in the
@@ -46972,6 +46975,17 @@
    <li><p>Cancel <em>any</em> preexisting attempt to navigate the
    <a href="#browsing-context">browsing context</a>.</li>
 
+   <li><p>If the new resource is to be handled using a mechanism that
+   does not affect the browsing context, e.g. ignoring the navigation
+   request altogether because the specified scheme is not one of the
+   supported protocols, then abort these steps and proceed with that
+   mechanism instead.</li>
+
+   <li><p><a href="#prompt-to-unload-a-document" title="prompt to unload a document">Prompt to
+   unload</a> the <code>Document</code> object. If the user
+   <a href="#refused-to-allow-the-document-to-be-unloaded">refused to allow the document to be unloaded</a>, then
+   these steps must be aborted.</li>
+
    <li>
 
     <p>If the new resource is to be handled by displaying some sort of
@@ -46987,12 +47001,6 @@
 
    </li>
 
-   <li><p>If the new resource is to be handled using a mechanism that
-   does not affect the browsing context, e.g. ignoring the navigation
-   request altogether because the specified scheme is not one of the
-   supported protocols, then abort these steps and proceed with that
-   mechanism instead.</li>
-
    <li>
 
     <p>If the new resource is to be fetched using HTTP GET <a href="#concept-http-equivalent-get" title="concept-http-equivalent-get">or equivalent</a>, then
@@ -47726,14 +47734,13 @@
 
   </ol></div><h4 id="unloading-documents"><span class="secno">6.11.10 </span>Unloading documents</h4><div class="impl">
 
-  <p>When a user agent is to <dfn id="unload-a-document">unload a document</dfn>, it must run
-  the following steps. These steps are passed an argument, <var title="">recycle</var>, which is either true or false, indicating
-  whether the <code>Document</code> object is going to be
-  re-used. (This is set by the <code title="dom-document-open"><a href="#dom-document-open">document.open()</a></code> method.)</p>
+  <p>A <code>Document</code> has a <var title="">salvageable</var>
+  state, which is initially true.</p>
 
-  <ol><li><p>Set <var title="">salvageable</var> to true.</li>
+  <hr><p>When a user agent is to <dfn id="prompt-to-unload-a-document">prompt to unload a document</dfn>,
+  it must run the following steps.</p>
 
-   <li><p>Let <var title="">event</var> be a new
+  <ol><li><p>Let <var title="">event</var> be a new
    <code><a href="#beforeunloadevent">BeforeUnloadEvent</a></code> event object with the name <code title="event-beforeunload">beforeunload</code>, with no namespace,
    which does not bubble but is cancelable.</li>
 
@@ -47741,7 +47748,7 @@
    <code>Document</code>'s <code><a href="#window">Window</a></code> object.</li>
 
    <li><p>If any event listeners were triggered by the previous step,
-   then set <var title="">salvageable</var> to false.</li>
+   then set the <code>Document</code>'s <var title="">salvageable</var> state to false.</li>
 
    <li>
 
@@ -47759,16 +47766,21 @@
     <p>The user agent must <a href="#pause">pause</a> while waiting for the
     user's response.</p>
 
-    <p>If the user <dfn id="refused-to-allow-the-document-to-be-unloaded">refused to allow the document to be
-    unloaded</dfn> then these steps must be aborted.</p>
+    <p>If the user did not confirm the page navigation, then the user
+    agent <dfn id="refused-to-allow-the-document-to-be-unloaded">refused to allow the document to be unloaded</dfn>.</p>
 
    </li>
 
-   <li><p><a href="#fire-a-simple-event">Fire a simple event</a> named <code title="event-unload">unload</code> at the <code>Document</code>'s
+  </ol><hr><p>When a user agent is to <dfn id="unload-a-document">unload a document</dfn>, it must run
+  the following steps. These steps are passed an argument, <var title="">recycle</var>, which is either true or false, indicating
+  whether the <code>Document</code> object is going to be
+  re-used. (This is set by the <code title="dom-document-open"><a href="#dom-document-open">document.open()</a></code> method.)</p>
+
+  <ol><li><p><a href="#fire-a-simple-event">Fire a simple event</a> named <code title="event-unload">unload</code> at the <code>Document</code>'s
    <code><a href="#window">Window</a></code> object.</li>
 
    <li><p>If any event listeners were triggered by the previous step,
-   then set <var title="">salvageable</var> to false.</li>
+   then set the <code>Document</code> object's <var title="">salvageable</var> state to false.</li>
 
    <li><p>If there are any outstanding transactions that have
    callbacks that involve <a href="#concept-script" title="concept-script">scripts</a>

Received on Monday, 12 October 2009 05:24:09 UTC