Skip to content

Commit

Permalink
[giow] (2) Rationalise the various places that require the session hi…
Browse files Browse the repository at this point in the history
…story to be cleared. Make sure document.open() with replace=true also clears the session history.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=8629

git-svn-id: http://svn.whatwg.org/webapps@4593 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 15, 2010
1 parent 7bfc203 commit 5f72d87
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 104 deletions.
99 changes: 65 additions & 34 deletions complete.html
Expand Up @@ -9837,23 +9837,30 @@ <h4 id=opening-the-input-stream><span class=secno>3.5.1 </span>Opening the input

<li>

<p>If <var title="">replace</var> is false, then:
<p>Remove all the entries in the <a href=#browsing-context>browsing context</a>'s
<a href=#session-history>session history</a> after the <a href=#current-entry>current
entry</a>. If the <a href=#current-entry>current entry</a> is the last entry
in the session history, then no entries are removed.</p>

<ol><li>Remove all the entries in the <a href=#browsing-context>browsing context</a>'s
<a href=#session-history>session history</a> after the <a href=#current-entry>current entry</a>
in its <code>Document</code>'s <code><a href=#history-0>History</a></code> object</li>
<p class=note>This <a href=#history-notes>doesn't necessarily
have to affect</a> the user agent's user interface.</p>

<li>Remove any earlier entries that share the same
<code>Document</code></li>
</li>

<li>Add a new entry just before the last entry that is associated
with the text that was parsed by the previous parser associated
with the <code>Document</code> object, as well as the state of
the document at the start of these steps. (This allows the user
to step backwards in the session history to see the page before
it was blown away by the <code title=dom-document-open><a href=#dom-document-open>document.open()</a></code> call.)</li>
<li>Remove any earlier entries that share the same
<code>Document</code>.</li>

</ol></li>
<li>

<p>If <var title="">replace</var> is false, then add a new entry,
just before the last entry, and assocaite with the new entry the
text that was parsed by the previous parser associated with the
<code>Document</code> object, as well as the state of the document
at the start of these steps. (This allows the user to step
backwards in the session history to see the page before it was
blown away by the <code title=dom-document-open><a href=#dom-document-open>document.open()</a></code> call.)</p>

</li>

<li><p>Finally, set the <a href=#insertion-point>insertion point</a> to point at
just before the end of the <a href=#the-input-stream>input stream</a> (which at this
Expand Down Expand Up @@ -55679,14 +55686,19 @@ <h4 id=the-history-interface><span class=secno>6.10.2 </span>The <code><a href=#

<p>If the method invoked was the <code title=dom-history-pushState><a href=#dom-history-pushstate>pushState()</a></code> method:</p>

<ol><li><p>Remove from the <a href=#session-history>session history</a> any entries for
the <code>Document</code> from the entry after the <a href=#current-entry>current
entry</a> up to the last entry in the session history that
references the same <code>Document</code> object, if any. If the
<a href=#current-entry>current entry</a> is the last entry in the session
history, or if there are no entries after the <a href=#current-entry>current
entry</a> that reference the same <code>Document</code> object,
then no entries are removed.</li>
<ol><li>

<p>Remove all the entries in the <a href=#browsing-context>browsing context</a>'s
<a href=#session-history>session history</a> after the <a href=#current-entry>current
entry</a>. If the <a href=#current-entry>current entry</a> is the last
entry in the session history, then no entries are
removed.</p>

<p class=note>This <a href=#history-notes>doesn't
necessarily have to affect</a> the user agent's user
interface.</p>

</li>

<li><p>Add a state object entry to the session history, after the
<a href=#current-entry>current entry</a>, with <var title="">cloned data</var> as
Expand Down Expand Up @@ -56548,19 +56560,31 @@ <h4 id=navigating-across-documents><span class=secno>6.11.1 </span>Navigating ac
<li><p><a href=#traverse-the-history>Traverse the history</a> to the new
entry.</li>

</ol></dd>
</ol><p class=note>This can only happen if the entry being updated
is no the <a href=#current-entry>current entry</a>. (It happens when the user
tried to traverse to a session history entry that no longer had
a <code>Document</code> object.)</p>

</dd>


<dt>Otherwise</dt>

<dd>

<ol><li><p>Remove all the entries after the <a href=#current-entry>current
entry</a> in the <a href=#browsing-context>browsing context</a>'s
<code>Document</code> object's <code><a href=#history-0>History</a></code> object.</p>
<p class=note>This <a href=#history-notes>doesn't
necessarily have to affect</a> the user agent's user
interface.</p> </li>
<ol><li>

<p>Remove all the entries in the <a href=#browsing-context>browsing
context</a>'s <a href=#session-history>session history</a> after the
<a href=#current-entry>current entry</a>. If the <a href=#current-entry>current entry</a>
is the last entry in the session history, then no entries are
removed.</p>

<p class=note>This <a href=#history-notes>doesn't
necessarily have to affect</a> the user agent's user
interface.</p>

</li>

<li><p>Append a new entry at the end of the <code><a href=#history-0>History</a></code>
object representing the new resource and its
Expand Down Expand Up @@ -56837,10 +56861,17 @@ <h4 id=scroll-to-fragid><span class=secno>6.11.8 </span><dfn title=navigate-frag
identifier, then the user agent must <a href=#queue-a-task>queue a task</a> to
run the following steps:</p>

<ol><li><p>Remove all the entries after the <a href=#current-entry>current entry</a>
in the <a href=#browsing-context>browsing context</a>'s <code>Document</code>
object's <code><a href=#history-0>History</a></code> object.</p> <p class=note>This <a href=#history-notes>doesn't necessarily have to affect</a> the
user agent's user interface.</p> </li>
<ol><li>

<p>Remove all the entries in the <a href=#browsing-context>browsing context</a>'s
<a href=#session-history>session history</a> after the <a href=#current-entry>current
entry</a>. If the <a href=#current-entry>current entry</a> is the last entry
in the session history, then no entries are removed.</p>

<p class=note>This <a href=#history-notes>doesn't necessarily
have to affect</a> the user agent's user interface.</p>

</li>

<li><p>Append a new entry at the end of the <code><a href=#history-0>History</a></code>
object representing the new resource and its <code>Document</code>
Expand Down Expand Up @@ -56955,8 +56986,8 @@ <h4 id=history-traversal><span class=secno>6.11.9 </span>History traversal</h4>
then the user agent must run the following substeps:</p>

<ol><li>If the browsing context is a <a href=#top-level-browsing-context>top-level browsing
context</a> (and not an <a href=#auxiliary-browsing-context>auxiliary browsing
context</a>), and the <a href=#origin>origin</a> of the
context</a>, but not an <a href=#auxiliary-browsing-context>auxiliary browsing
context</a>, and the <a href=#origin>origin</a> of the
<code>Document</code> of the <i>specified entry</i> is not the
<a href=#same-origin title="same origin">same</a> as the <a href=#origin>origin</a>
of the <code>Document</code> of the <a href=#current-entry>current entry</a>,
Expand Down
99 changes: 65 additions & 34 deletions index
Expand Up @@ -9737,23 +9737,30 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0

<li>

<p>If <var title="">replace</var> is false, then:
<p>Remove all the entries in the <a href=#browsing-context>browsing context</a>'s
<a href=#session-history>session history</a> after the <a href=#current-entry>current
entry</a>. If the <a href=#current-entry>current entry</a> is the last entry
in the session history, then no entries are removed.</p>

<ol><li>Remove all the entries in the <a href=#browsing-context>browsing context</a>'s
<a href=#session-history>session history</a> after the <a href=#current-entry>current entry</a>
in its <code>Document</code>'s <code><a href=#history-0>History</a></code> object</li>
<p class=note>This <a href=#history-notes>doesn't necessarily
have to affect</a> the user agent's user interface.</p>

<li>Remove any earlier entries that share the same
<code>Document</code></li>
</li>

<li>Add a new entry just before the last entry that is associated
with the text that was parsed by the previous parser associated
with the <code>Document</code> object, as well as the state of
the document at the start of these steps. (This allows the user
to step backwards in the session history to see the page before
it was blown away by the <code title=dom-document-open><a href=#dom-document-open>document.open()</a></code> call.)</li>
<li>Remove any earlier entries that share the same
<code>Document</code>.</li>

</ol></li>
<li>

<p>If <var title="">replace</var> is false, then add a new entry,
just before the last entry, and assocaite with the new entry the
text that was parsed by the previous parser associated with the
<code>Document</code> object, as well as the state of the document
at the start of these steps. (This allows the user to step
backwards in the session history to see the page before it was
blown away by the <code title=dom-document-open><a href=#dom-document-open>document.open()</a></code> call.)</p>

</li>

<li><p>Finally, set the <a href=#insertion-point>insertion point</a> to point at
just before the end of the <a href=#the-input-stream>input stream</a> (which at this
Expand Down Expand Up @@ -55593,14 +55600,19 @@ NETWORK:

<p>If the method invoked was the <code title=dom-history-pushState><a href=#dom-history-pushstate>pushState()</a></code> method:</p>

<ol><li><p>Remove from the <a href=#session-history>session history</a> any entries for
the <code>Document</code> from the entry after the <a href=#current-entry>current
entry</a> up to the last entry in the session history that
references the same <code>Document</code> object, if any. If the
<a href=#current-entry>current entry</a> is the last entry in the session
history, or if there are no entries after the <a href=#current-entry>current
entry</a> that reference the same <code>Document</code> object,
then no entries are removed.</li>
<ol><li>

<p>Remove all the entries in the <a href=#browsing-context>browsing context</a>'s
<a href=#session-history>session history</a> after the <a href=#current-entry>current
entry</a>. If the <a href=#current-entry>current entry</a> is the last
entry in the session history, then no entries are
removed.</p>

<p class=note>This <a href=#history-notes>doesn't
necessarily have to affect</a> the user agent's user
interface.</p>

</li>

<li><p>Add a state object entry to the session history, after the
<a href=#current-entry>current entry</a>, with <var title="">cloned data</var> as
Expand Down Expand Up @@ -56462,19 +56474,31 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU
<li><p><a href=#traverse-the-history>Traverse the history</a> to the new
entry.</li>

</ol></dd>
</ol><p class=note>This can only happen if the entry being updated
is no the <a href=#current-entry>current entry</a>. (It happens when the user
tried to traverse to a session history entry that no longer had
a <code>Document</code> object.)</p>

</dd>


<dt>Otherwise</dt>

<dd>

<ol><li><p>Remove all the entries after the <a href=#current-entry>current
entry</a> in the <a href=#browsing-context>browsing context</a>'s
<code>Document</code> object's <code><a href=#history-0>History</a></code> object.</p>
<p class=note>This <a href=#history-notes>doesn't
necessarily have to affect</a> the user agent's user
interface.</p> </li>
<ol><li>

<p>Remove all the entries in the <a href=#browsing-context>browsing
context</a>'s <a href=#session-history>session history</a> after the
<a href=#current-entry>current entry</a>. If the <a href=#current-entry>current entry</a>
is the last entry in the session history, then no entries are
removed.</p>

<p class=note>This <a href=#history-notes>doesn't
necessarily have to affect</a> the user agent's user
interface.</p>

</li>

<li><p>Append a new entry at the end of the <code><a href=#history-0>History</a></code>
object representing the new resource and its
Expand Down Expand Up @@ -56751,10 +56775,17 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU
identifier, then the user agent must <a href=#queue-a-task>queue a task</a> to
run the following steps:</p>

<ol><li><p>Remove all the entries after the <a href=#current-entry>current entry</a>
in the <a href=#browsing-context>browsing context</a>'s <code>Document</code>
object's <code><a href=#history-0>History</a></code> object.</p> <p class=note>This <a href=#history-notes>doesn't necessarily have to affect</a> the
user agent's user interface.</p> </li>
<ol><li>

<p>Remove all the entries in the <a href=#browsing-context>browsing context</a>'s
<a href=#session-history>session history</a> after the <a href=#current-entry>current
entry</a>. If the <a href=#current-entry>current entry</a> is the last entry
in the session history, then no entries are removed.</p>

<p class=note>This <a href=#history-notes>doesn't necessarily
have to affect</a> the user agent's user interface.</p>

</li>

<li><p>Append a new entry at the end of the <code><a href=#history-0>History</a></code>
object representing the new resource and its <code>Document</code>
Expand Down Expand Up @@ -56869,8 +56900,8 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU
then the user agent must run the following substeps:</p>

<ol><li>If the browsing context is a <a href=#top-level-browsing-context>top-level browsing
context</a> (and not an <a href=#auxiliary-browsing-context>auxiliary browsing
context</a>), and the <a href=#origin>origin</a> of the
context</a>, but not an <a href=#auxiliary-browsing-context>auxiliary browsing
context</a>, and the <a href=#origin>origin</a> of the
<code>Document</code> of the <i>specified entry</i> is not the
<a href=#same-origin title="same origin">same</a> as the <a href=#origin>origin</a>
of the <code>Document</code> of the <a href=#current-entry>current entry</a>,
Expand Down

0 comments on commit 5f72d87

Please sign in to comment.