Permalink
Browse files

[giow] (3) Turns out that browsers don't distinguish between the 'doc…

…ument's address' and the 'documents's current address', so we can merge them.

Affected topics: DOM APIs, HTML, Microdata

git-svn-id: http://svn.whatwg.org/webapps@7159 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Jun 29, 2012
1 parent 2285df6 commit 2cd18fb6965dd8729b4cd4dd5633e548b1e4c705
Showing with 173 additions and 153 deletions.
  1. +58 −51 complete.html
  2. +58 −51 index
  3. +57 −51 source

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 28 June 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 29 June 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>

<ol><li><p>Let <var title="">fallback base url</var> be <a href="#the-document's-address">the
document's address</a>.</li>
<!-- http://www.hixie.ch/tests/adhoc/dom/level0/history/pushState/001/ -->

<li>

<li>

<p>Generate the <i>address of the resource from which Request-URIs
are obtained</i> as required by HTTP for the <code title=http-referer>Referer</code> (sic) header from <a href="#the-document's-current-address">the
document's current address</a> of <var title="">document</var>.
<a href=#refsHTTP>[HTTP]</a></p>
are obtained</i> as required by HTTP for the <code title=http-referer>Referer</code> (sic) header from <a href="#the-document's-address">the
document's address</a> of <var title="">document</var>. <a href=#refsHTTP>[HTTP]</a></p>

<p>Remove any <a href=#url-fragment title=url-fragment>&lt;fragment&gt;</a>
component from the generated <i>address of the resource from which
<code><a href=#document>Document</a></code> object. <a href=#refsDOMCORE>[DOMCORE]</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><a href=#document>Document</a></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 is initially set when the <code><a href=#document>Document</a></code> is created but
that can change during the lifetime of the <code><a href=#document>Document</a></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 or when the <code title=dom-history-pushState><a href=#dom-history-pushstate>pushState()</a></code> method is called
with a new <a href=#url>URL</a>. <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><a href=#document>Document</a></code> is created.</span></p>
with a new <a href=#url>URL</a>.</p>
<!--
http://www.hixie.ch/tests/adhoc/dom/level0/history/pushState/002/
http://www.hixie.ch/tests/adhoc/html/navigation/fragids/016.html
-->

<p class=note>Interactive user agents typically expose <a href="#the-document's-current-address">the
document's current address</a> in their user interface.</p>
<p class=warning>Interactive user agents typically expose
<a href="#the-document's-address">the document's address</a> in their user interface. This is
the primary mechanism by which a user can tell if a site is
attempting to impersonate another.</p>

<p>When a <code><a href=#document>Document</a></code> is created by a <a href=#concept-script title=concept-script>script</a> using the <code title=dom-DOMImplementation-createDocument><a href=#dom-domimplementation-createdocument>createDocument()</a></code>
or <code title=dom-DOMHTMLImplementation-createHTMLDocument>createHTMLDocument()</code>

<dl class=domintro><dt><var title="">document</var> . <code title=dom-document-referrer><a href=#dom-document-referrer>referrer</a></code></dt>
<dd>
<p>Returns <a href="#the-document's-current-address" title="the document's current address">the
address</a> of the <code><a href=#document>Document</a></code> from which the user
navigated to this one, unless it was blocked or there was no such
document, in which case it returns the empty string.</p>

<p>Returns <a href="#the-document's-address" title="the document's address">the address</a>
of the <code><a href=#document>Document</a></code> from which the user navigated to this
one, unless it was blocked or there was no such document, in which
case it returns the empty string.</p>

<p>The <code title=rel-noreferrer><a href=#link-type-noreferrer>noreferrer</a></code> link
type can be used to block the referrer.</p>

</dd>

</dl><div class=impl>

<p>The <dfn id=dom-document-referrer title=dom-document-referrer><code>referrer</code></dfn> attribute
must return either the <a href="#the-document's-current-address" title="the document's current
address">current address</a> of the <a href=#active-document>active document</a>
of the <a href=#source-browsing-context>source browsing context</a> <em>at the time the
navigation was started</em> (that is, the page which <a href=#navigate title=navigate>navigated</a> the <a href=#browsing-context>browsing context</a>
must return either the <a href="#the-document's-address" title="the document's
address">address</a> of the <a href=#active-document>active document</a> of the
<a href=#source-browsing-context>source browsing context</a> <em>at the time the navigation
was started</em> (that is, the page which <a href=#navigate title=navigate>navigated</a> the <a href=#browsing-context>browsing context</a>
to the current document), with any <a href=#url-fragment title=url-fragment>&lt;fragment&gt;</a> component removed; or
the empty string if there is no such originating page, or if the UA
has been configured not to report referrers in this case, or if the
encrypted connection</dt>

<dd>The request must include a <code title=http-referer>Referer</code> (sic) HTTP header with, as its
value, the <a href="#the-document's-current-address" title="the document's current address">current
address</a> of the document containing the hyperlink, a <code title=http-ping-from><a href=#ping-from>Ping-From</a></code> HTTP header with the same
value, the <a href="#the-document's-address" title="the document's address">address</a> of
the document containing the hyperlink, a <code title=http-ping-from><a href=#ping-from>Ping-From</a></code> HTTP header with the same
value, and a <code title=http-ping-to><a href=#ping-to>Ping-To</a></code> HTTP header
with, as its value, the address of the target of the
hyperlink.</dd>
to <var title="">output</var>.</li>

<li><p><a href=#add-a-vcard-line>Add a vCard line</a> with the type "<code title="">SOURCE</code>" and the result of <a href=#escaping-the-vcard-text-string>escaping the vCard
text string</a> that is <a href="#the-document's-current-address">the document's current
address</a> as the value to <var title="">output</var>.</li>
text string</a> that is <a href="#the-document's-address">the document's address</a> as
the value to <var title="">output</var>.</li>

<li><p>If <a href=#the-title-element-0>the <code>title</code> element</a> is not null,
<a href=#add-a-vcard-line>add a vCard line</a> with the type "<code title="">NAME</code>" and with the result of <a href=#escaping-the-vcard-text-string>escaping the

<li>

<p>Set <a href="#the-document's-current-address">the document's current address</a> to <var title="">new URL</var>.</p>
<p>Set <a href="#the-document's-address">the document's address</a> to <var title="">new
URL</var>.</p>

<p class=note>Since this is neither a <a href=#navigate title=navigate>navigation</a> of the <a href=#browsing-context>browsing
context</a> nor a <a href=#traverse-the-history title="traverse the history">history

</div>

<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>
<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>

<pre class=idl>interface <dfn id=location>Location</dfn> {
stringifier attribute DOMString <a href=#dom-location-href title=dom-location-href>href</a>;
</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-current-address" title="the document's current
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>
attribute must return <a href="#the-document's-address" title="the document's address">the
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, 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>,
<dt>Otherwise</dt>

<dd><p><a href=#navigate>Navigate</a><!--DONAV location.reload()--> the
<a href=#browsing-context>browsing context</a> to <a href="#the-document's-current-address">the document's current
<a href=#browsing-context>browsing context</a> to <a href="#the-document's-address">the document's
address</a> with <a href=#replacement-enabled>replacement enabled</a>. The
<a href=#source-browsing-context>source browsing context</a> must be the <a href=#browsing-context>browsing
context</a> being navigated.</dd> <!-- it appears that

<p>The <code><a href=#location>Location</a></code> interface also has the complement of
<a href=#url-decomposition-idl-attributes>URL decomposition IDL 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 <a href=#url-decomposition-idl-attributes>URL
decomposition IDL attributes</a>, with the <a href=#concept-uda-input title=concept-uda-input>input</a> being <a href="#the-document's-current-address" title="the
document's current 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> (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>
<!--TOPIC:HTML-->
decomposition IDL attributes</a>, 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><a href=#document>Document</a></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> <!--TOPIC:HTML-->


<!--ADD-TOPIC:Security-->
these steps.</li>

<li><p><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>. 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 <i>fragment identifier
loop</i> step.</li>
<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 <i>fragment identifier loop</i>
step.</li>

</ol><p>The <a href=#task-source>task source</a> for this <a href=#concept-task title=concept-task>task</a> is the <a href=#networking-task-source>networking task
source</a>.</p>

<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 what
is now <a href="#the-document's-current-address">the document's current address</a>.</li>
is now <a href="#the-document's-address">the document's address</a>.</li>

</ol><p class=note>If the scrolling fails because the relevant <a href=#concept-id title=concept-id>ID</a> has not yet been parsed, then the
original <a href=#navigate title=navigate>navigation</a> algorithm will

</ol></li>

<li><p>Set <a href="#the-document's-current-address">the document's current address</a> to the URL
of the <var title="">specified entry</var>.</li>
<li><p>Set <a href="#the-document's-address">the document's address</a> to the URL of the
<var title="">specified entry</var>.</li>

<li><p>If the <var title="">specified entry</var> has a URL whose
fragment identifier differs from that of the <a href=#current-entry>current
<p>A <code><a href=#document>Document</a></code> that is assigned responsibility for
actions taken by the script.</p>

<p class=example>When a script <a href=#fetch title=fetch>fetches</a> a resource, the <a href="#the-document's-current-address" title="the
document's current address">current address</a> of the
<a href="#script's-document">script's document</a> will be used to set the <code title=http-referer>Referer</code> (sic) header.</p>
<p class=example>When a script <a href=#fetch title=fetch>fetches</a> a resource, the <a href="#the-document's-address" title="the
document's address">address</a> of the <a href="#script's-document">script's
document</a> will be used to set the <code title=http-referer>Referer</code> (sic) header.</p>

</dd>

target element</a> unchanged.</p>

<p>Otherwise, <a href=#fire-a-dnd-event>fire a DND event</a> named <code title=event-dragenter><a href=#event-dragenter>dragenter</a></code> at <var title="">new target</var>. Then, set the <a href=#current-target-element>current
target element</a> to <var title="">new target</var>
target element</a> to <var title="">new target</var>,
regardless of whether that event was canceled or not.</p>

</dd>

Oops, something went wrong.

0 comments on commit 2cd18fb

Please sign in to comment.