[html5] r5685 - [giow] (2) Make form submission via .submit(), and page navigation via location. [...]
whatwg at whatwg.org
whatwg at whatwg.org
Mon Nov 29 17:22:35 PST 2010
Author: ianh
Date: 2010-11-29 17:22:34 -0800 (Mon, 29 Nov 2010)
New Revision: 5685
Modified:
complete.html
index
source
Log:
[giow] (2) 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.
Modified: complete.html
===================================================================
--- complete.html 2010-11-30 00:41:19 UTC (rev 5684)
+++ complete.html 2010-11-30 01:22:34 UTC (rev 5685)
@@ -47239,13 +47239,18 @@
<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
the events fired from the next two steps, probably from a script
@@ -47450,7 +47455,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
@@ -47484,16 +47490,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>
@@ -47581,11 +47586,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
@@ -58893,23 +58897,14 @@
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 -->
+ <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-->
- <!-- we could change the magic .location setter to simply refer
- straight to assign(), so we don't have two levels of indirection -->
-
<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
the <a href=#entry-script>entry script</a>'s <a href="#script's-base-url" title="script's base URL">base
@@ -58929,7 +58924,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
@@ -62049,8 +62044,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>
@@ -82523,9 +82518,12 @@
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>
Modified: index
===================================================================
--- index 2010-11-30 00:41:19 UTC (rev 5684)
+++ index 2010-11-30 01:22:34 UTC (rev 5685)
@@ -47219,13 +47219,18 @@
<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
the events fired from the next two steps, probably from a script
@@ -47430,7 +47435,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
@@ -47464,16 +47470,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>
@@ -47561,11 +47566,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
@@ -58873,23 +58877,14 @@
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 -->
+ <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-->
- <!-- we could change the magic .location setter to simply refer
- straight to assign(), so we don't have two levels of indirection -->
-
<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
the <a href=#entry-script>entry script</a>'s <a href="#script's-base-url" title="script's base URL">base
@@ -58909,7 +58904,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
@@ -62038,8 +62033,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>
@@ -78437,9 +78432,12 @@
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>
Modified: source
===================================================================
--- source 2010-11-30 00:41:19 UTC (rev 5684)
+++ source 2010-11-30 01:22:34 UTC (rev 5685)
@@ -53033,13 +53033,19 @@
<ol>
- <li id="sandboxSubmitBlocked"><p>If <var title="">form</var> is in
- a <code>Document</code> that has no associated <span>browsing
- context</span> or whose <span>browsing context</span> had its
- <span>sandboxed forms browsing context flag</span> set when the
- <code>Document</code> was created, then abort these steps without
- doing anything.</p></li>
+ <li><p>Let <var title="">form document</var> be the <var
+ title="">form</var>'s <code>Document</code>.</p></li>
+ <li id="sandboxSubmitBlocked"><p>If <var title="">form
+ document</var> has no associated <span>browsing context</span> or
+ its <span>browsing context</span> had its <span>sandboxed forms
+ browsing context flag</span> set when the <code>Document</code> was
+ created, then abort these steps without doing anything.</p></li>
+
+ <li><p>Let <var title="">form browsing context</var> be the
+ <span>browsing context</span> of <var title="">form
+ document</var>.</p></li>
+
<li><p>If <var title="">form</var> is already being submitted
(i.e. the form was <span
title="concept-form-submit">submitted</span> again while processing
@@ -53321,7 +53327,8 @@
<li>
<p>If <var title="">action</var> is the empty string, let <var
- title="">action</var> be <span>the document's address</span>.</p>
+ title="">action</var> be <span>the document's address</span> of
+ the <var title="">form document</var>.</p>
<p class="note">This step is a <span>willful violation</span> of
RFC 3986, which would require base URL processing here. This
@@ -53365,16 +53372,16 @@
title="">target browsing context</var> be that <span>browsing
context</span>. Otherwise, apply <span>the rules for choosing a
browsing context given a browsing context name</span> using <var
- title="">target</var> as the name and the <span>browsing
- context</span> 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 <span>browsing
- context</span>.</p></li>
+ 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 <span>browsing context</span>.</p></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.</p></li>
- <!-- XXXXX this is about to change -->
+ in the previous step, or if the <var title="">form document</var>
+ has not yet <span>completely loaded</span>, then let <var
+ title="">replace</var> be true. Otherwise, let it be
+ false.</p></li>
<li>
@@ -53483,11 +53490,10 @@
<!--<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)-->
+ 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, <span>navigate</span><!--DONAV form--> <var
title="">target browsing context</var> to <var
@@ -66909,23 +66915,15 @@
address">the current address</span> of the associated
<code>Document</code> object, as an <span>absolute URL</span>.</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">assign()</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 -->
+ <p>On setting, if the <code>Location</code> object's associated
+ <code>Document</code> object has <span>completely loaded</span>,
+ then the user agent must act as if the <code
+ title="dom-location-assign">assign()</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">replace()</code>
+ method had been called with the new value as its argument.</p>
+ <!--DONAV location.href, defined in terms of the paragraphs below-->
- <!-- we could change the magic .location setter to simply refer
- straight to assign(), so we don't have two levels of indirection -->
-
<p>When the <dfn title="dom-location-assign"><code>assign(<var
title="">url</var>)</code></dfn> method is invoked, the UA must
<span title="resolve a url">resolve</span> the argument, relative to
@@ -66948,7 +66946,7 @@
<span title="resolve a url">resolve</span> the argument, relative to
the <span>entry script</span>'s <span title="script's base URL">base
URL</span>, and if that is successful,
- <span>navigate</span><!--DONAV location.replace--> the
+ <span>navigate</span><!--DONAV location.href/replace--> the
<span>browsing context</span> to the specified <var
title="">url</var> with <span>replacement enabled</span>.</p>
@@ -70594,8 +70592,8 @@
<dl>
- <dt>If <var title="">target</var>'s <code>Document</code> has
- <span>completely loaded</span></dt>
+ <dt>If <var title="">target</var>'s <code>Document</code> is
+ <span>ready for post-load tasks</span></dt>
<dd><p><span title="queue a task">Queue</span> the task <var
title="">task</var>.</p></dd>
@@ -94563,9 +94561,12 @@
for these <span title="concept-task">tasks</span> is the
<span>networking task source</span>.</p></li>
- <li><p>The <code>Document</code> is now <dfn>completely
- loaded</dfn>.</p></li>
+ <li><p>The <code>Document</code> is now <dfn>ready for post-load
+ tasks</dfn>.</p></li>
+ <li><p><span>Queue a task</span> to mark the <code>Document</code>
+ as <dfn>completely loaded</dfn>.</p></li>
+
</ol>
<p>When the user agent is to <dfn>abort a parser</dfn>, it must run
More information about the Commit-Watchers
mailing list