Skip to content

Commit

Permalink
[giow] (1) Make document.reload() reload the input to document.write(…
Browse files Browse the repository at this point in the history
…), not reload the URL of the page. Also, a number of editorial fixes.

git-svn-id: http://svn.whatwg.org/webapps@5709 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Dec 7, 2010
1 parent f37d45e commit b903be5
Show file tree
Hide file tree
Showing 3 changed files with 215 additions and 106 deletions.
105 changes: 69 additions & 36 deletions complete.html
Expand Up @@ -8096,9 +8096,26 @@ <h3 id=documents><span class=secno>3.1 </span>Documents</h3>
<a href=#html-documents title="HTML documents">HTML document</a> or an <a href=#xml-documents title="XML documents">XML document</a> affects the behavior of
certain APIs and the case-sensitivity of some selectors.</p>

<p>Each <code><a href=#document>Document</a></code> object has a <dfn id=reload-override-flag>reload override
flag</dfn> that is originally unset. The flag is set by the <code title=dom-document-open><a href=#dom-document-open>document.open()</a></code> and <code title=dom-document-open><a href=#dom-document-open>document.write()</a></code> methods in certain
situations. When the flag is set, the <code><a href=#document>Document</a></code> also has
a <dfn id=reload-override-buffer>reload override buffer</dfn> which is a Unicode string that
is used as the source of the document when it is reloaded.</p>

<p>When the user agent is to perform <dfn id=an-overridden-reload>an overridden
reload</dfn>, it must act as follows:</p>

<h4 id=documents-in-the-dom><span class=secno>3.1.1 </span>Documents in the DOM</h4>
<ol><li><p>Let <var title="">source</var> be the value of the
<a href=#browsing-context>browsing context</a>'s <a href=#active-document>active document</a>'s
<a href=#reload-override-buffer>reload override buffer</a>.</li>

<li><p><a href=#navigate>Navigate</a><!--DONAV reload after d.open()--> the
<a href=#browsing-context>browsing context</a> to a resource whose source is <var title="">source</var>. When the <a href=#navigate>navigate</a> algorithm
creates a <code><a href=#document>Document</a></code> object for this purpose, set that
<code><a href=#document>Document</a></code>'s <a href=#reload-override-flag>reload override flag</a> and set
its <a href=#reload-override-buffer>reload override buffer</a> to <var title="">source</var>.</li>

</ol><h4 id=documents-in-the-dom><span class=secno>3.1.1 </span>Documents in the DOM</h4>

<p>All <code><a href=#document>Document</a></code> objects (in user agents implementing
this specification) <span class=impl>must</span> also implement
Expand Down Expand Up @@ -11330,7 +11347,7 @@ <h4 id=annotations-for-assistive-technology-products-(aria)><span class=secno>3.
overridden. The following table lists these elements<span class=impl> and their <span>implicit ARIA semantics</span></span>,
along with the restrictions that apply to those elements. Each
language feature (element or attribute) in a cell in the first
column implies, unless otherwise overriden, the ARIA semantic (role,
column implies, unless otherwise overridden, the ARIA semantic (role,
state, or property) given in the cell in the second column of the
same row, but this semantic may be overridden under the conditions
listed in the cell in the third column of that row. In addition, any
Expand Down Expand Up @@ -11809,6 +11826,10 @@ <h4 id=opening-the-input-stream><span class=secno>3.5.1 </span>Opening the input
<li><p>Change the <a href="#document's-character-encoding">document's character encoding</a> to
UTF-8.</li>

<li><p>Set the <code><a href=#document>Document</a></code> object's <a href=#reload-override-flag>reload override
flag</a> and set the <code><a href=#document>Document</a></code>'s <a href=#reload-override-buffer>reload
override buffer</a> to the empty string.</li>

<li><p>Change <a href="#the-document's-address">the document's address</a> to the
<a href=#entry-script>entry script</a>'s <a href="#script's-document" title="script's
document">document</a>'s <a href="#the-document's-address" title="the document's
Expand Down Expand Up @@ -12002,39 +12023,41 @@ <h4 id=document.write()><span class=secno>3.5.3 </span><code title=dom-document-

<li>

<p>If the <a href=#insertion-point>insertion point</a> is undefined, the <code title=dom-document-open><a href=#dom-document-open>open()</a></code> method must be called
(with no arguments) on the <code title=Document><a href=#document>document</a></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. Otherwise, the
<p>If the <a href=#insertion-point>insertion point</a> is undefined, call the
<code title=dom-document-open><a href=#dom-document-open>open()</a></code> method on the <code title=Document><a href=#document>document</a></code> object (with no arguments). If
the user <a href=#refused-to-allow-the-document-to-be-unloaded>refused to allow the document to be
unloaded</a>, then abort these steps. Otherwise, the
<a href=#insertion-point>insertion point</a> will point at just before the end of
the (empty) <a href=#the-input-stream>input stream</a>.</p>

</li>

<li>

<p>The string consisting of the concatenation of all the arguments
to the method must be inserted into the <a href=#the-input-stream>input stream</a>
just before the <a href=#insertion-point>insertion point</a>.</p>
<p>Insert the string consisting of the concatenation of all the
arguments to the method into the <a href=#the-input-stream>input stream</a> just
before the <a href=#insertion-point>insertion point</a>.</p>

</li>

<li>

<p>If there is a <a href=#pending-parsing-blocking-script>pending parsing-blocking script</a>, then the
method must now return without further processing of the
<a href=#the-input-stream>input stream</a>.</p>
<p>If the <code><a href=#document>Document</a></code> object's <a href=#reload-override-flag>reload override
flag</a> is set, then append the string consisting of the
concatenation of all the arguments to the method to the
<code><a href=#document>Document</a></code>'s <a href=#reload-override-buffer>reload override buffer</a>.</p>

</li>

<li>

<p>Otherwise, the tokenizer must process the characters that were
inserted, one at a time, processing resulting tokens as they are
emitted, and stopping when the tokenizer reaches the insertion
point or when the processing of the tokenizer is aborted by the
tree construction stage (this can happen if a <code><a href=#script>script</a></code>
end tag token is emitted by the tokenizer).
<p>If there is no <a href=#pending-parsing-blocking-script>pending parsing-blocking script</a>,
have the tokenizer process the characters that were inserted, one
at a time, processing resulting tokens as they are emitted, and
stopping when the tokenizer reaches the insertion point or when
the processing of the tokenizer is aborted by the tree
construction stage (this can happen if a <code><a href=#script>script</a></code> end
tag token is emitted by the tokenizer).

<p class=note>If the <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> method was
called from script executing inline (i.e. executing because the
Expand All @@ -12046,7 +12069,7 @@ <h4 id=document.write()><span class=secno>3.5.3 </span><code title=dom-document-

<li>

<p>Finally, the method must return.</p>
<p>Finally, return from the method.</p>

</li>

Expand Down Expand Up @@ -59219,6 +59242,12 @@ <h4 id=the-location-interface><span class=secno>6.4.3 </span>The <code><a href=#
<code>iframe</code> attributes</a> of the <a href=#browsing-context>browsing
context</a>'s <a href=#browsing-context-container>browsing context container</a>.</dd>

<dt>If the <a href=#browsing-context>browsing context</a>'s <a href=#active-document>active
document</a> has its <a href=#reload-override-flag>reload override
flag</a> set</dt>

<dd><p>Perform <a href=#an-overridden-reload>an overridden reload</a>.</dd>

<dt>Otherwise</dt>

<dd><p><a href=#navigate>Navigate</a><!--DONAV location.reload()--> the
Expand All @@ -59230,16 +59259,20 @@ <h4 id=the-location-interface><span class=secno>6.4.3 </span>The <code><a href=#

<!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/141 -->

</dl><p>When a user requests that the current page be reloaded through a
user interface element, the user agent should
<a href=#navigate>navigate</a><!--DONAV user reload--> the <a href=#browsing-context>browsing
context</a> to the same resource as <code><a href=#document>Document</a></code>, with
<a href=#replacement-enabled>replacement enabled</a>. In the case of non-idempotent
methods (e.g. HTTP POST), the user agent should prompt the user to
confirm the operation first, since otherwise transactions (e.g.
purchases or database modifications) could be repeated. User agents
may allow the user to explicitly override any caches when
reloading.</p>
</dl><p>When a user requests that the current page of a <a href=#browsing-context>browsing
context</a> be reloaded through a user interface element, the
user agent should <a href=#navigate>navigate</a><!--DONAV user reload--> the
<a href=#browsing-context>browsing context</a> to the same resource as
<code><a href=#document>Document</a></code>, with <a href=#replacement-enabled>replacement enabled</a>. In the
case of non-idempotent methods (e.g. HTTP POST), the user agent
should prompt the user to confirm the operation first, since
otherwise transactions (e.g. purchases or database modifications)
could be repeated. User agents may allow the user to explicitly
override any caches when reloading. If <a href=#browsing-context>browsing
context</a>'s <a href=#active-document>active document</a>'s <a href=#reload-override-flag>reload
override flag</a> is set, then the user agent may instead perform
<a href=#an-overridden-reload>an overridden reload</a> rather than the navigation
described in this paragraph.</p>

</div>

Expand Down Expand Up @@ -68850,7 +68883,7 @@ <h3 id=undo><span class=secno>8.8 </span><dfn>Undo history</dfn></h3>
<h4 id=definitions-2><span class=secno>8.8.1 </span>Definitions</h4>

<p>The user agent must associate an <dfn id=undo-transaction-history>undo transaction
history</dfn> with each <code><a href=#htmldocument>HTMLDocument</a></code> object.</p>
history</dfn> with each <code><a href=#document>Document</a></code> object.</p>

<p>The <a href=#undo-transaction-history>undo transaction history</a> is a list of
entries. The entries are of two types: <a href=#dom-changes>DOM changes</a> and
Expand All @@ -68864,7 +68897,7 @@ <h4 id=definitions-2><span class=secno>8.8.1 </span>Definitions</h4>
node.</li>

<li>Changes to the DOM hierarchy of nodes that are descendants of
the <code><a href=#htmldocument>HTMLDocument</a></code> object (<code title=dom-Node-parentNode><a href=#dom-node-parentnode>parentNode</a></code>, <code title=dom-Node-childNodes><a href=#dom-node-childnodes>childNodes</a></code>).</li>
the <code><a href=#document>Document</a></code> object (<code title=dom-Node-parentNode><a href=#dom-node-parentnode>parentNode</a></code>, <code title=dom-Node-childNodes><a href=#dom-node-childnodes>childNodes</a></code>).</li>

<li>Changes to internal state, such as a form control's <a href=#concept-fe-value title=concept-fe-value>value</a> or <a href=#concept-input-checked-dirty-flag title=concept-input-checked-dirty-flag>dirty checkedness
flag</a>.</li>
Expand Down Expand Up @@ -68968,8 +69001,8 @@ <h4 id=the-undomanager-interface><span class=secno>8.8.2 </span>The <code><a hre
<p>The <dfn id=dom-undomanager title=dom-undoManager><code>undoManager</code></dfn>
attribute of the <code><a href=#window>Window</a></code> interface must return the
object implementing the <code><a href=#undomanager>UndoManager</a></code> interface for that
<code><a href=#window>Window</a></code> object's associated
<code><a href=#htmldocument>HTMLDocument</a></code> object.</p>
<code><a href=#window>Window</a></code> object's associated <code><a href=#document>Document</a></code>
object.</p>

<p><code><a href=#undomanager>UndoManager</a></code> objects represent their document's
<a href=#undo-transaction-history>undo transaction history</a>. Only <a href=#undo-object>undo object</a>
Expand Down Expand Up @@ -74033,8 +74066,8 @@ <h4 id=the-storage-interface><span class=secno>11.2.1 </span>The <code><a href=#
none, then the method must do nothing.</p>

<p class=note>When the <code title=dom-Storage-setItem><a href=#dom-storage-setitem>setItem()</a></code>, <code title=dom-Storage-removeItem><a href=#dom-storage-removeitem>removeItem()</a></code>, and <code title=dom-Storage-clear><a href=#dom-storage-clear>clear()</a></code> methods are invoked, events
are fired on other <code><a href=#htmldocument>HTMLDocument</a></code> objects that can access
the newly stored or removed data, as defined in the sections on the
are fired on other <code><a href=#document>Document</a></code> objects that can access the
newly stored or removed data, as defined in the sections on the
<code title=dom-sessionStorage><a href=#dom-sessionstorage>sessionStorage</a></code> and <code title=dom-localStorage><a href=#dom-localstorage>localStorage</a></code> attributes.</p> <!--
not normative, see the sections below for the normative statement
-->
Expand Down Expand Up @@ -83961,7 +83994,7 @@ <h3 id=introduction-12><span class=secno>14.1 </span>Introduction</h3>
</ul><p class=note>Just being off-screen does not mean the element is
not <a href=#being-rendered>being rendered</a>. The presence of the <code title=attr-hidden><a href=#the-hidden-attribute>hidden</a></code> attribute normally means the
element is not <a href=#being-rendered>being rendered</a>, though this might be
overriden by the style sheets.</p>
overridden by the style sheets.</p>

</div>

Expand Down

0 comments on commit b903be5

Please sign in to comment.