hixie: Make form submission via .submit(), and page navigation via location.href, when either is done before the page has completely loaded, result in a history replacement (like a redirect) rather than a regular load. (whatwg r5685)

hixie: Make form submission via .submit(), and page navigation via
location.href, when either is done before the page has completely
loaded, result in a history replacement (like a redirect) rather than a
regular load. (whatwg r5685)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.4552&r2=1.4553&f=h
http://html5.org/tools/web-apps-tracker?from=5684&to=5685

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.4552
retrieving revision 1.4553
diff -u -d -r1.4552 -r1.4553
--- Overview.html 30 Nov 2010 00:41:25 -0000 1.4552
+++ Overview.html 30 Nov 2010 01:22:50 -0000 1.4553
@@ -37887,12 +37887,17 @@
   <var title="">scripted-submit</var> flag set, the user agent must
   run the following steps:</p>
 
-  <ol><li id="sandboxSubmitBlocked"><p>If <var title="">form</var> is in
-   a <code><a href="#document">Document</a></code> that has no associated <a href="#browsing-context">browsing
-   context</a> or whose <a href="#browsing-context">browsing context</a> had its
-   <a href="#sandboxed-forms-browsing-context-flag">sandboxed forms browsing context flag</a> set when the
-   <code><a href="#document">Document</a></code> was created, then abort these steps without
-   doing anything.</li>
+  <ol><li><p>Let <var title="">form document</var> be the <var title="">form</var>'s <code><a href="#document">Document</a></code>.</li>
+
+   <li id="sandboxSubmitBlocked"><p>If <var title="">form
+   document</var> has no associated <a href="#browsing-context">browsing context</a> or
+   its <a href="#browsing-context">browsing context</a> had its <a href="#sandboxed-forms-browsing-context-flag">sandboxed forms
+   browsing context flag</a> set when the <code><a href="#document">Document</a></code> was
+   created, then abort these steps without doing anything.</li>
+
+   <li><p>Let <var title="">form browsing context</var> be the
+   <a href="#browsing-context">browsing context</a> of <var title="">form
+   document</var>.</li>
 
    <li><p>If <var title="">form</var> is already being submitted
    (i.e. the form was <a href="#concept-form-submit" title="concept-form-submit">submitted</a> again while processing
@@ -38098,7 +38103,8 @@
 
    <li>
 
-    <p>If <var title="">action</var> is the empty string, let <var title="">action</var> be <a href="#the-document-s-address">the document's address</a>.</p>
+    <p>If <var title="">action</var> is the empty string, let <var title="">action</var> be <a href="#the-document-s-address">the document's address</a> of
+    the <var title="">form document</var>.</p>
 
     <p class="note">This step is a <a href="#willful-violation">willful violation</a> of
     RFC 3986, which would require base URL processing here. This
@@ -38132,16 +38138,15 @@
    <li><p>If the user indicated a specific <a href="#browsing-context">browsing
    context</a> to use when submitting the form, then let <var title="">target browsing context</var> be that <a href="#browsing-context">browsing
    context</a>. Otherwise, apply <a href="#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name">the rules for choosing a
-   browsing context given a browsing context name</a> using <var title="">target</var> as the name and the <a href="#browsing-context">browsing
-   context</a> of <var title="">form</var> as the context in which
-   the algorithm is executed, and let <var title="">target browsing
-   context</var> be the resulting <a href="#browsing-context">browsing
-   context</a>.</li>
+   browsing context given a browsing context name</a> using <var title="">target</var> as the name and <var title="">form browsing
+   context</var> as the context in which the algorithm is executed,
+   and let <var title="">target browsing context</var> be the
+   resulting <a href="#browsing-context">browsing context</a>.</li>
 
    <li><p>If <var title="">target browsing context</var> was created
-   in the previous step, then let <var title="">replace</var> be true.
-   Otherwise, let it be false.</li>
-   <!-- XXXXX this is about to change -->
+   in the previous step, or if the <var title="">form document</var>
+   has not yet <a href="#completely-loaded">completely loaded</a>, then let <var title="">replace</var> be true. Otherwise, let it be
+   false.</li>
 
    <li>
 
@@ -38229,11 +38234,10 @@
 
       </dl><!--<p>If <var title="">method</var> is anything but (GET or)
       POST, and the <span>origin</span> of <var title="">action</var>
-      is not the <span>same origin</span> as that of the
-      <code>form</code> element's <code>Document</code>, then abort
-      these steps.</p> [or do CORS] (this is commented out since only
-      POST can trigger this now, and that's historically
-      unrestricted)--><p>Otherwise, <a href="#navigate">navigate</a><!--DONAV form--> <var title="">target browsing context</var> to <var title="">action</var> using the HTTP method given by <var title="">method</var> and with <var title="">entity body</var>
+      is not the <span>same origin</span> as that of <var
+      title="">form document</var>, then abort these steps.</p> [or do
+      CORS] (this is commented out since only POST can trigger this
+      now, and that's historically unrestricted)--><p>Otherwise, <a href="#navigate">navigate</a><!--DONAV form--> <var title="">target browsing context</var> to <var title="">action</var> using the HTTP method given by <var title="">method</var> and with <var title="">entity body</var>
       as the entity body, of type <var title="">MIME type</var>. If
       <var title="">replace</var> is true, then <var title="">target
       browsing context</var> must be navigated with <a href="#replacement-enabled">replacement
@@ -43647,22 +43651,13 @@
   address">the current address</a> of the associated
   <code><a href="#document">Document</a></code> object, as an <a href="#absolute-url">absolute URL</a>.</p>
 
-  <p>On setting, <!-- READ ME WHEN EDITING THIS: Mozilla does this,
-  but IE doesn't. What should we do?: the behavior depends on the
-  context in which the script that set the attribute is running. If
-  the script ran as the direct result of the execution of a
-  <code>script</code> element in the document represented by the
-  <code>Location</code> object's associated <code>Document</code>
-  object, then the user agent must act as if the <code
-  title="dom-location-replace">replace()</code> method had been called
-  with the new value as its argument. Otherwise,--> the user agent
-  must act as if the <code title="dom-location-assign"><a href="#dom-location-assign">assign()</a></code>
-  method had been called with the new value as its argument.</p><!--
-  v2: may wish to allow replace instead as a UI improvement -->
-  <!-- XXXXX the above is about to change -->
-
-  <!-- we could change the magic .location setter to simply refer
-  straight to assign(), so we don't have two levels of indirection -->
+  <p>On setting, if the <code><a href="#location">Location</a></code> object's associated
+  <code><a href="#document">Document</a></code> object has <a href="#completely-loaded">completely loaded</a>,
+  then the user agent must act as if the <code title="dom-location-assign"><a href="#dom-location-assign">assign()</a></code> method had been called
+  with the new value as its argument. Otherwise, the user agent must
+  act as if the <code title="dom-location-replace"><a href="#dom-location-replace">replace()</a></code>
+  method had been called with the new value as its argument.</p>
+  <!--DONAV location.href, defined in terms of the paragraphs below-->
 
   <p>When the <dfn id="dom-location-assign" title="dom-location-assign"><code>assign(<var title="">url</var>)</code></dfn> method is invoked, the UA must
   <a href="#resolve-a-url" title="resolve a url">resolve</a> the argument, relative to
@@ -43683,7 +43678,7 @@
   <a href="#resolve-a-url" title="resolve a url">resolve</a> the argument, relative to
   the <a href="#entry-script">entry script</a>'s <a href="#script-s-base-url" title="script's base URL">base
   URL</a>, and if that is successful,
-  <a href="#navigate">navigate</a><!--DONAV location.replace--> the
+  <a href="#navigate">navigate</a><!--DONAV location.href/replace--> the
   <a href="#browsing-context">browsing context</a> to the specified <var title="">url</var> with <a href="#replacement-enabled">replacement enabled</a>.</p>
 
   <p>Navigation for the <code title="dom-location-assign"><a href="#dom-location-assign">assign()</a></code> and <code title="dom-location-replace"><a href="#dom-location-replace">replace()</a></code> methods must be done
@@ -46657,8 +46652,8 @@
   target <code><a href="#applicationcache">ApplicationCache</a></code> object <var title="">target</var>, the user agent must run the appropriate steps
   from the following list:</p>
 
-  <dl><dt>If <var title="">target</var>'s <code><a href="#document">Document</a></code> has
-   <a href="#completely-loaded">completely loaded</a></dt>
+  <dl><dt>If <var title="">target</var>'s <code><a href="#document">Document</a></code> is
+   <a href="#ready-for-post-load-tasks">ready for post-load tasks</a></dt>
 
    <dd><p><a href="#queue-a-task" title="queue a task">Queue</a> the task <var title="">task</var>.</dd>
 
@@ -61453,8 +61448,11 @@
    for these <a href="#concept-task" title="concept-task">tasks</a> is the
    <a href="#networking-task-source">networking task source</a>.</li>
 
-   <li><p>The <code><a href="#document">Document</a></code> is now <dfn id="completely-loaded">completely
-   loaded</dfn>.</li>
+   <li><p>The <code><a href="#document">Document</a></code> is now <dfn id="ready-for-post-load-tasks">ready for post-load
+   tasks</dfn>.</li>
+
+   <li><p><a href="#queue-a-task">Queue a task</a> to mark the <code><a href="#document">Document</a></code>
+   as <dfn id="completely-loaded">completely loaded</dfn>.</li>
 
   </ol><p>When the user agent is to <dfn id="abort-a-parser">abort a parser</dfn>, it must run
   the following steps:</p>

Received on Tuesday, 30 November 2010 01:25:25 UTC