Skip to content

Commit

Permalink
[e] (0) Add some exposition about state objects.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@4989 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Apr 9, 2010
1 parent d6b574c commit 93088c6
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 2 deletions.
25 changes: 24 additions & 1 deletion complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -55093,7 +55093,30 @@ <h4 id=the-session-history-of-browsing-contexts><span class=secno>6.4.1 </span>T
(or script) goes back in the history, thus enabling authors to use
the "navigation" metaphor even in one-page applications.</p>

<p>At any point, one of the entries in the session history is the
<div class=note>

<p><a href=#state-object title="state object">State objects</a> are intended to
be used for two main purposes: first, storing a preparsed
description of the state in the <a href=#url>URL</a> so that in the
simple case an author doesn't have to do the parsing (though one
would still need the parsing for handling <a href=#url title=URL>URLs</a> passed around by users, so it's only a minor
optimization), and second, so that the author can store state that
one wouldn't store in the URL because it only applies to the current
<code><a href=#document>Document</a></code> instance and it would have to be reconstructed
if a new <code><a href=#document>Document</a></code> were opened.</p>

<p>An example of the latter would be something like keeping track of
the precise coordinate from which a popup <code><a href=#the-div-element>div</a></code> was made
to animate, so that if the user goes back, it can be made to animate
to the same location. Or alternatively, it could be used to keep a
pointer into a cache of data that would be fetched from the server
based on the information in the <a href=#url>URL</a>, so that when going
back and forward, the information doesn't have to be fetched
again.</p>

</div>

<hr><p>At any point, one of the entries in the session history is the
<dfn id=current-entry>current entry</dfn>. This is the entry representing the
<a href=#active-document>active document</a> of the <a href=#browsing-context>browsing
context</a>. The <a href=#current-entry>current entry</a> is usually an entry
Expand Down
25 changes: 24 additions & 1 deletion index
Original file line number Diff line number Diff line change
Expand Up @@ -54994,7 +54994,30 @@ x === this; // true</pre>
(or script) goes back in the history, thus enabling authors to use
the "navigation" metaphor even in one-page applications.</p>

<p>At any point, one of the entries in the session history is the
<div class=note>

<p><a href=#state-object title="state object">State objects</a> are intended to
be used for two main purposes: first, storing a preparsed
description of the state in the <a href=#url>URL</a> so that in the
simple case an author doesn't have to do the parsing (though one
would still need the parsing for handling <a href=#url title=URL>URLs</a> passed around by users, so it's only a minor
optimization), and second, so that the author can store state that
one wouldn't store in the URL because it only applies to the current
<code><a href=#document>Document</a></code> instance and it would have to be reconstructed
if a new <code><a href=#document>Document</a></code> were opened.</p>

<p>An example of the latter would be something like keeping track of
the precise coordinate from which a popup <code><a href=#the-div-element>div</a></code> was made
to animate, so that if the user goes back, it can be made to animate
to the same location. Or alternatively, it could be used to keep a
pointer into a cache of data that would be fetched from the server
based on the information in the <a href=#url>URL</a>, so that when going
back and forward, the information doesn't have to be fetched
again.</p>

</div>

<hr><p>At any point, one of the entries in the session history is the
<dfn id=current-entry>current entry</dfn>. This is the entry representing the
<a href=#active-document>active document</a> of the <a href=#browsing-context>browsing
context</a>. The <a href=#current-entry>current entry</a> is usually an entry
Expand Down
26 changes: 26 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -61987,6 +61987,32 @@ x === this; // true</pre>
(or script) goes back in the history, thus enabling authors to use
the "navigation" metaphor even in one-page applications.</p>

<div class="note">

<p><span title="state object">State objects</span> are intended to
be used for two main purposes: first, storing a preparsed
description of the state in the <span>URL</span> so that in the
simple case an author doesn't have to do the parsing (though one
would still need the parsing for handling <span
title="URL">URLs</span> passed around by users, so it's only a minor
optimization), and second, so that the author can store state that
one wouldn't store in the URL because it only applies to the current
<code>Document</code> instance and it would have to be reconstructed
if a new <code>Document</code> were opened.</p>

<p>An example of the latter would be something like keeping track of
the precise coordinate from which a popup <code>div</code> was made
to animate, so that if the user goes back, it can be made to animate
to the same location. Or alternatively, it could be used to keep a
pointer into a cache of data that would be fetched from the server
based on the information in the <span>URL</span>, so that when going
back and forward, the information doesn't have to be fetched
again.</p>

</div>

<hr>

<p>At any point, one of the entries in the session history is the
<dfn>current entry</dfn>. This is the entry representing the
<span>active document</span> of the <span>browsing
Expand Down

0 comments on commit 93088c6

Please sign in to comment.