[html5] r2924 - [giow] (2) Make pushState() and <a href='#foo'> actually update the window.locat [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Mar 30 18:07:39 PDT 2009


Author: ianh
Date: 2009-03-30 18:07:38 -0700 (Mon, 30 Mar 2009)
New Revision: 2924

Modified:
   index
   source
Log:
[giow] (2) Make pushState() and <a href='#foo'> actually update the window.location object's value.

Modified: index
===================================================================
--- index	2009-03-30 23:53:42 UTC (rev 2923)
+++ index	2009-03-31 01:07:38 UTC (rev 2924)
@@ -39,7 +39,7 @@
   <div class=head>
    <p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
    <h1>HTML 5</h1>
-   <h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 30 March 2009</h2>
+   <h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 31 March 2009</h2>
    <p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
    <p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
    <dl><dt>Multiple-page version:</dt>
@@ -6686,7 +6686,14 @@
   <code>Document</code> object. <a href=#refsDOM3CORE>[DOM3CORE]</a></p>
 
   <p><dfn id="the-document's-address">The document's address</dfn> is an <a href=#absolute-url>absolute URL</a>
-  that is set when the <code>Document</code> is created.</p>
+  that is set when the <code>Document</code> is created. <dfn id="the-document's-current-address">The
+  document's current address</dfn> is an <a href=#absolute-url>absolute URL</a>
+  that can change during the lifetime of the <code>Document</code>,
+  for example when the user <a href=#navigate title=navigate>navigates</a> to
+  a <a href=#scroll-to-fragid title=navigate-fragid>fragment identifier</a> on the
+  page. <span class=impl><a href="#the-document's-current-address">The document's current address</a>
+  must be set to <a href="#the-document's-address">the document's address</a> when the
+  <code>Document</code> is created.</span></p>
 
   <p>When a <code>Document</code> is created by a <a href=#concept-script title=concept-script>script</a> using the <code title="">createDocument()</code> API, <a href="#the-document's-address">the document's
   address</a> is the same as <a href="#the-document's-address">the document's address</a> of
@@ -17996,9 +18003,9 @@
   <a href=#active-document>active document</a> has the <a href=#same-origin>same origin</a> as the
   <code><a href=#the-iframe-element>iframe</a></code> element's document, or the <a href=#browsing-context>browsing
   context</a>'s <a href=#active-document>active document</a>'s <em><a href="#the-document's-address" title="the
-  document's address">address</a><!-- XXX xref --></em> has the
-  <a href=#same-origin>same origin</a> as the <code><a href=#the-iframe-element>iframe</a></code> element's
-  document, the following requirements apply:</span></p>
+  document's address">address</a></em> has the <a href=#same-origin>same
+  origin</a> as the <code><a href=#the-iframe-element>iframe</a></code> element's document, the
+  following requirements apply:</span></p>
 
   <div class=impl>
 
@@ -43930,7 +43937,9 @@
    URL</a> that was found earlier in this algorithm as the
    <a href=#url>URL</a> of the entry.</li>
 
-   <!-- XXX update the current address as per bug 6437 -->
+   <li><p>If the third argument is present, set <a href="#the-document's-current-address">the document's
+   current address</a> to the <a href=#absolute-url>absolute URL</a> that was
+   found earlier in this algorithm.</li>
 
    <li><p>Update the <a href=#current-entry>current entry</a> to be the this newly
    added entry.</li>
@@ -44068,11 +44077,10 @@
 
   </div>
 
-  <p><code><a href=#location>Location</a></code> objects provide a representation of <a href="#the-document's-address" title="the document's address">their document's address</a>, and
-  allow the <a href=#current-entry>current entry</a> of the <a href=#browsing-context>browsing
-  context</a>'s session history to be changed, by adding or
-  replacing entries in the <code title=dom-history><a href=#dom-history>history</a></code>
-  object.</p>
+  <p><code><a href=#location>Location</a></code> objects provide a representation of <a href="#the-document's-current-address" title="the document's current address">their document's current
+  address</a>, and allow the <a href=#current-entry>current entry</a> of the
+  <a href=#browsing-context>browsing context</a>'s session history to be changed, by
+  adding or replacing entries in the <code title=dom-history><a href=#dom-history>history</a></code> object.</p>
 
   <pre class=idl>interface <dfn id=location>Location</dfn> {
   readonly attribute DOMString <a href=#dom-location-href title=dom-location-href>href</a>;
@@ -44138,9 +44146,9 @@
   </dl><div class=impl>
 
   <p>The <dfn id=dom-location-href title=dom-location-href><code>href</code></dfn>
-  attribute must return <a href="#the-document's-address" title="the document's address">the
-  address</a> of the associated <code>Document</code> object, as an
-  <a href=#absolute-url>absolute URL</a>.</p>
+  attribute must return <a href="#the-document's-current-address" title="the document's current
+  address">the current address</a> of the associated
+  <code>Document</code> object, as an <a href=#absolute-url>absolute URL</a>.</p>
 
   <p>On setting, <!--XXX Mozilla does this, but IE doesn't. What
   should we do?: the behavior depends on the context in which the
@@ -44200,12 +44208,11 @@
   <p>The <code><a href=#location>Location</a></code> interface also has the complement of
   <a href=#url-decomposition-attributes>URL decomposition attributes</a>, <dfn id=dom-location-protocol title=dom-location-protocol><code>protocol</code></dfn>, <dfn id=dom-location-host title=dom-location-host><code>host</code></dfn>, <dfn id=dom-location-port title=dom-location-port><code>port</code></dfn>, <dfn id=dom-location-hostname title=dom-location-hostname><code>hostname</code></dfn>, <dfn id=dom-location-pathname title=dom-location-pathname><code>pathname</code></dfn>, <dfn id=dom-location-search title=dom-location-search><code>search</code></dfn>, and <dfn id=dom-location-hash title=dom-location-hash><code>hash</code></dfn>. <span class=impl>These must follow the rules given for URL decomposition
   attributes, with the <a href=#concept-uda-input title=concept-uda-input>input</a>
-  being <a href="#the-document's-address" title="the document's address">the address</a> of the
-  associated <code>Document</code> object, as an <a href=#absolute-url>absolute
-  URL</a> (same as the <code title=dom-location-href><a href=#dom-location-href>href</a></code>
-  attribute), and the <a href=#concept-uda-setter title=concept-uda-setter>common setter
-  action</a> being the same as setting the <code title=dom-location-href><a href=#dom-location-href>href</a></code> attribute to the new output
-  value.</span></p>
+  being <a href="#the-document's-current-address" title="the document's current address">the current
+  address</a> of the associated <code>Document</code> object, as an
+  <a href=#absolute-url>absolute URL</a> (same as the <code title=dom-location-href><a href=#dom-location-href>href</a></code> attribute), and the <a href=#concept-uda-setter title=concept-uda-setter>common setter action</a> being the
+  same as setting the <code title=dom-location-href><a href=#dom-location-href>href</a></code>
+  attribute to the new output value.</span></p>
 
   <div class=impl>
 
@@ -44630,9 +44637,10 @@
      these substeps.</li>
 
      <li><p><a href=#scroll-to-the-fragment-identifier>Scroll to the fragment identifier</a> given in
-     <a href="#the-document's-address">the document's address</a>. If this fails to find <a href=#the-indicated-part-of-the-document title="the indicated part of the document">an indicated part of
-     the document</a>, then return to the first step of these
-     substeps.</li>
+     <a href="#the-document's-current-address">the document's current address</a>. If this fails to
+     find <a href=#the-indicated-part-of-the-document title="the indicated part of the document">an
+     indicated part of the document</a>, then return to the first
+     step of these substeps.</li>
 
     </ol></li>
 
@@ -44874,16 +44882,28 @@
   <h4 id=scroll-to-fragid><span class=secno>5.10.8 </span><dfn title=navigate-fragid>Navigating to a fragment identifier</dfn></h4>
 
   <p>When a user agent is supposed to navigate to a fragment
-  identifier, then the user agent must <a href=#update-the-session-history-with-the-new-page>update the session
-  history with the new page</a>, where "the new page" has the same
-  <code>Document</code> as before but with the URL having the newly
-  specified fragment identifier.</p>
+  identifier, then the user agent must <a href=#queue-a-task>queue a task</a> to
+  run the following steps:</p>
 
-  <p>Part of that algorithm involves the user agent having to
-  <a href=#scroll-to-the-fragment-identifier>scroll to the fragment identifier</a>, which is the
-  important part for this step.</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-1>History</a></code> object.</p>
+   <p class=note>This <a href=#history-notes>doesn't necessarily
+   have to affect</a><!--XXX change to auto-xref?--> the user
+   agent's user interface.</p> </li>
 
-  <p>When the user agent is required to <dfn id=scroll-to-the-fragment-identifier>scroll to the fragment
+   <li><p>Append a new entry at the end of the <code><a href=#history-1>History</a></code>
+   object representing the new resource and its <code>Document</code>
+   object and related state, and set its URL to the address to which
+   the user agent was <a href=#navigate title=navigate>navigating</a>. (This
+   will be the same as <a href="#the-document's-address">the document's address</a>, but with a
+   new fragment identifier.)</li>
+
+   <li><p><a href=#traverse-the-history>Traverse the history</a> to the new entry. This
+   will <a href=#scroll-to-the-fragment-identifier>scroll to the fragment identifier</a> given in
+   <a href="#the-document's-current-address">the document's current address</a>.</li>
+
+  </ol><hr><p>When the user agent is required to <dfn id=scroll-to-the-fragment-identifier>scroll to the fragment
   identifier</dfn>, it must change the scrolling position of the
   document, or perform some other action, such that <a href=#the-indicated-part-of-the-document>the
   indicated part of the document</a> is brought to the user's
@@ -45006,6 +45026,9 @@
 
     </ol></li>
 
+   <li><p>Set <a href="#the-document's-current-address">the document's current address</a> to the URL
+   of the <i>specified entry</i>.</li>
+
    <li><p>If the <i>specified entry</i> is a state object or the
    first entry for a <code>Document</code>, the user agent must <a href=#activating-state-object-entries title="activate the state object">activate that
    entry</a>.</li>

Modified: source
===================================================================
--- source	2009-03-30 23:53:42 UTC (rev 2923)
+++ source	2009-03-31 01:07:38 UTC (rev 2924)
@@ -6756,7 +6756,14 @@
   href="#refsDOM3CORE">[DOM3CORE]</a></p>
 
   <p><dfn>The document's address</dfn> is an <span>absolute URL</span>
-  that is set when the <code>Document</code> is created.</p>
+  that is set when the <code>Document</code> is created. <dfn>The
+  document's current address</dfn> is an <span>absolute URL</span>
+  that can change during the lifetime of the <code>Document</code>,
+  for example when the user <span title="navigate">navigates</span> to
+  a <span title="navigate-fragid">fragment identifier</span> on the
+  page. <span class="impl"><span>The document's current address</span>
+  must be set to <span>the document's address</span> when the
+  <code>Document</code> is created.</span></p>
 
   <p>When a <code>Document</code> is created by a <span
   title="concept-script">script</span> using the <code
@@ -19336,9 +19343,9 @@
   <span>active document</span> has the <span>same origin</span> as the
   <code>iframe</code> element's document, or the <span>browsing
   context</span>'s <span>active document</span>'s <em><span title="the
-  document's address">address</span><!-- XXX xref --></em> has the
-  <span>same origin</span> as the <code>iframe</code> element's
-  document, the following requirements apply:</span></p>
+  document's address">address</span></em> has the <span>same
+  origin</span> as the <code>iframe</code> element's document, the
+  following requirements apply:</span></p>
 
   <div class="impl">
 
@@ -49960,7 +49967,9 @@
    URL</span> that was found earlier in this algorithm as the
    <span>URL</span> of the entry.</p></li>
 
-   <!-- XXX update the current address as per bug 6437 -->
+   <li><p>If the third argument is present, set <span>the document's
+   current address</span> to the <span>absolute URL</span> that was
+   found earlier in this algorithm.</p></li>
 
    <li><p>Update the <span>current entry</span> to be the this newly
    added entry.</p></li>
@@ -50128,11 +50137,11 @@
   </div>
 
   <p><code>Location</code> objects provide a representation of <span
-  title="the document's address">their document's address</span>, and
-  allow the <span>current entry</span> of the <span>browsing
-  context</span>'s session history to be changed, by adding or
-  replacing entries in the <code title="dom-history">history</code>
-  object.</p>
+  title="the document's current address">their document's current
+  address</span>, and allow the <span>current entry</span> of the
+  <span>browsing context</span>'s session history to be changed, by
+  adding or replacing entries in the <code
+  title="dom-history">history</code> object.</p>
 
   <pre class="idl">interface <dfn>Location</dfn> {
   readonly attribute DOMString <span title="dom-location-href">href</span>;
@@ -50202,9 +50211,9 @@
   <div class="impl">
 
   <p>The <dfn title="dom-location-href"><code>href</code></dfn>
-  attribute must return <span title="the document's address">the
-  address</span> of the associated <code>Document</code> object, as an
-  <span>absolute URL</span>.</p>
+  attribute must return <span title="the document's current
+  address">the current address</span> of the associated
+  <code>Document</code> object, as an <span>absolute URL</span>.</p>
 
   <p>On setting, <!--XXX Mozilla does this, but IE doesn't. What
   should we do?: the behavior depends on the context in which the
@@ -50280,13 +50289,13 @@
   title="dom-location-hash"><code>hash</code></dfn>. <span
   class="impl">These must follow the rules given for URL decomposition
   attributes, with the <span title="concept-uda-input">input</span>
-  being <span title="the document's address">the address</span> of the
-  associated <code>Document</code> object, as an <span>absolute
-  URL</span> (same as the <code title="dom-location-href">href</code>
-  attribute), and the <span title="concept-uda-setter">common setter
-  action</span> being the same as setting the <code
-  title="dom-location-href">href</code> attribute to the new output
-  value.</span></p>
+  being <span title="the document's current address">the current
+  address</span> of the associated <code>Document</code> object, as an
+  <span>absolute URL</span> (same as the <code
+  title="dom-location-href">href</code> attribute), and the <span
+  title="concept-uda-setter">common setter action</span> being the
+  same as setting the <code title="dom-location-href">href</code>
+  attribute to the new output value.</span></p>
 
   <div class="impl">
 
@@ -50780,10 +50789,10 @@
      these substeps.</p></li>
 
      <li><p><span>Scroll to the fragment identifier</span> given in
-     <span>the document's address</span>. If this fails to find <span
-     title="the indicated part of the document">an indicated part of
-     the document</span>, then return to the first step of these
-     substeps.</p></li>
+     <span>the document's current address</span>. If this fails to
+     find <span title="the indicated part of the document">an
+     indicated part of the document</span>, then return to the first
+     step of these substeps.</p></li>
 
     </ol>
 
@@ -51045,15 +51054,33 @@
   <h4 id="scroll-to-fragid"><dfn title="navigate-fragid">Navigating to a fragment identifier</dfn></h4>
 
   <p>When a user agent is supposed to navigate to a fragment
-  identifier, then the user agent must <span>update the session
-  history with the new page</span>, where "the new page" has the same
-  <code>Document</code> as before but with the URL having the newly
-  specified fragment identifier.</p>
+  identifier, then the user agent must <span>queue a task</span> to
+  run the following steps:</p>
 
-  <p>Part of that algorithm involves the user agent having to
-  <span>scroll to the fragment identifier</span>, which is the
-  important part for this step.</p>
+  <ol>
 
+   <li><p>Remove all the entries after the <span>current
+   entry</span> in the <span>browsing context</span>'s
+   <code>Document</code> object's <code>History</code> object.</p>
+   <p class="note">This <a href="#history-notes">doesn't necessarily
+   have to affect</a><!--XXX change to auto-xref?--> the user
+   agent's user interface.</p> </li>
+
+   <li><p>Append a new entry at the end of the <code>History</code>
+   object representing the new resource and its <code>Document</code>
+   object and related state, and set its URL to the address to which
+   the user agent was <span title="navigate">navigating</span>. (This
+   will be the same as <span>the document's address</span>, but with a
+   new fragment identifier.)</p></li>
+
+   <li><p><span>Traverse the history</span> to the new entry. This
+   will <span>scroll to the fragment identifier</span> given in
+   <span>the document's current address</span>.</p></li>
+
+  </ol>
+
+  <hr>
+
   <p>When the user agent is required to <dfn>scroll to the fragment
   identifier</dfn>, it must change the scrolling position of the
   document, or perform some other action, such that <span>the
@@ -51199,6 +51226,9 @@
 
    </li>
 
+   <li><p>Set <span>the document's current address</span> to the URL
+   of the <i>specified entry</i>.</p></li>
+
    <li><p>If the <i>specified entry</i> is a state object or the
    first entry for a <code>Document</code>, the user agent must <span
    title="activate the state object">activate that




More information about the Commit-Watchers mailing list