Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[giow] (1) Make about:srcdoc documents have better defined handling f…
…or base URL, Referer headers, and location.reload().

git-svn-id: http://svn.whatwg.org/webapps@5679 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Nov 13, 2010
1 parent 01f4189 commit db6bc70
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 39 deletions.
58 changes: 45 additions & 13 deletions complete.html
Expand Up @@ -214,7 +214,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>Web Applications 1.0</h1>
<h2 class="no-num no-toc">Draft Standard &mdash; 11 November 2010</h2>
<h2 class="no-num no-toc">Draft Standard &mdash; 12 November 2010</h2>
</hgroup><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>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
Expand Down Expand Up @@ -5919,6 +5919,13 @@ <h4 id=terminology-0><span class=secno>2.6.1 </span>Terminology</h4>

</li>

<li><p>If the <code><a href=#document>Document</a></code> is <a href=#an-iframe-srcdoc-document>an
<code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> document</a>, then
let <var title="">fallback base url</var> be the <a href=#document-base-url>document
base URL</a> of the <code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing
context</a>'s <a href=#browsing-context-container>browsing context container</a>'s
<code><a href=#document>Document</a></code> instead.</li>

<li><p>If there is no <code><a href=#the-base-element>base</a></code> element that is both a
child of <a href=#the-head-element>the <code>head</code> element</a> and has an
<code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute, then the
Expand Down Expand Up @@ -6311,10 +6318,8 @@ <h3 id=fetching-resources><span class=secno>2.7 </span>Fetching resources</h3>

<ol><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 the appropriate
<code><a href=#document>Document</a></code> as given by the following list. <a href=#refsHTTP>[HTTP]</a></p>
<p>Let <var title="">document</var> be the appropriate
<code><a href=#document>Document</a></code> as given by the following list:</p>

<dl class=switch><dt>When <a href=#navigate title=navigate>navigating</a></dt>

Expand All @@ -6330,7 +6335,26 @@ <h3 id=fetching-resources><span class=secno>2.7 </span>Fetching resources</h3>
<dd>The <a href=#entry-script>entry script</a>'s <a href="#script's-document" title="script's
document">document</a>.</dd>

</dl><p>Remove any <a href=#url-fragment title=url-fragment>&lt;fragment&gt;</a>
</dl></li>

<li>

<p>While <var title="">document</var> is is <a href=#an-iframe-srcdoc-document>an
<code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code>
document</a>, let <var title="">document</var> be <var title="">document</var>'s <a href=#browsing-context>browsing context</a>'s
<a href=#browsing-context-container>browsing context container</a>'s <code><a href=#document>Document</a></code>
instead.</p>

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

<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
Request-URIs are obtained</i>.</p> <!-- RFC2616 says "The URI MUST
NOT include a fragment." (section 14.36) -->
Expand Down Expand Up @@ -22211,8 +22235,8 @@ <h4 id=the-iframe-element><span class=secno>4.8.2 </span>The <dfn><code>iframe</

<p>The <dfn id=attr-iframe-srcdoc title=attr-iframe-srcdoc><code>srcdoc</code></dfn>
attribute gives the content of the page that the <a href=#nested-browsing-context>nested
browsing context</a> is to contain. The value of the attribute
in is <dfn id=an-iframe-srcdoc-document>an <code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> document</dfn>.</p>
browsing context</a> is to contain. The value of the attribute is
the source of <dfn id=an-iframe-srcdoc-document>an <code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> document</dfn>.</p>

<p>For <code><a href=#the-iframe-element>iframe</a></code> elements in <a href=#html-documents>HTML documents</a>,
the attribute, if present, must have a value using <a href=#syntax>the HTML
Expand Down Expand Up @@ -22253,14 +22277,14 @@ <h4 id=the-iframe-element><span class=secno>4.8.2 </span>The <dfn><code>iframe</
first time.</p>

<p>Whenever an <code><a href=#the-iframe-element>iframe</a></code> element with a <a href=#nested-browsing-context>nested
browsing context</a> has its <code title=attr-iframe-srcdoc><a href=#attr-iframe-srcdoc>srcdoc</a></code> attribute set or changed,
the user agent must <a href=#process-the-iframe-attributes>process the <code>iframe</code>
browsing context</a> has its <code title=attr-iframe-srcdoc><a href=#attr-iframe-srcdoc>srcdoc</a></code> attribute set, changed, or
removed, the user agent must <a href=#process-the-iframe-attributes>process the <code>iframe</code>
attributes</a>.</p>

<p>Similarly, whenever an <code><a href=#the-iframe-element>iframe</a></code> element with a
<a href=#nested-browsing-context>nested browsing context</a> but with no <code title=attr-iframe-srcdoc><a href=#attr-iframe-srcdoc>srcdoc</a></code> attribute specified has its
<code title=attr-iframe-src><a href=#attr-iframe-src>src</a></code> attribute set or changed,
the user agent must <a href=#process-the-iframe-attributes>process the <code>iframe</code>
<code title=attr-iframe-src><a href=#attr-iframe-src>src</a></code> attribute set, changed, or
removed, the user agent must <a href=#process-the-iframe-attributes>process the <code>iframe</code>
attributes</a>.</p> <!-- It doesn't happen when the base URL is
changed, though. -->

Expand All @@ -22275,7 +22299,8 @@ <h4 id=the-iframe-element><span class=secno>4.8.2 </span>The <dfn><code>iframe</
context</a> to a resource whose <a href=#content-type>Content-Type</a> is
<code><a href=#text/html>text/html</a></code>, whose <a href=#url>URL</a> is
<code><a href=#about:srcdoc>about:srcdoc</a></code>, and whose data consists of the value of
the attribute.</dd>
the attribute. The resulting <code><a href=#document>Document</a></code> must be
considered <a href=#an-iframe-srcdoc-document>an <code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> document</a>.</dd>

<dt>If the <code title=attr-iframe-src><a href=#attr-iframe-src>src</a></code>
attribute is specified but the <code title=attr-iframe-srcdoc><a href=#attr-iframe-srcdoc>srcdoc</a></code> attribute is not</dt>
Expand Down Expand Up @@ -58939,6 +58964,13 @@ <h4 id=the-location-interface><span class=secno>6.4.3 </span>The <code><a href=#
steps.</dd> <!-- this theoretically would have no effect but in
practice can be useful to work around rendering bugs. -->

<dt>If the <a href=#browsing-context>browsing context</a>'s <a href=#active-document>active
document</a> is <a href=#an-iframe-srcdoc-document>an <code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> document</a></dt>

<dd><p><a href=#process-the-iframe-attributes title="process the iframe attributes">Reprocess the
<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>Otherwise</dt>

<dd><p><a href=#navigate>Navigate</a> the <a href=#browsing-context>browsing context</a> to
Expand Down
58 changes: 45 additions & 13 deletions index
Expand Up @@ -218,7 +218,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>HTML5 (including next generation additions still in development)</h1>
<h2 class="no-num no-toc">Draft Standard &mdash; 11 November 2010</h2>
<h2 class="no-num no-toc">Draft Standard &mdash; 12 November 2010</h2>
</hgroup><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>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
Expand Down Expand Up @@ -5896,6 +5896,13 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

</li>

<li><p>If the <code><a href=#document>Document</a></code> is <a href=#an-iframe-srcdoc-document>an
<code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> document</a>, then
let <var title="">fallback base url</var> be the <a href=#document-base-url>document
base URL</a> of the <code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing
context</a>'s <a href=#browsing-context-container>browsing context container</a>'s
<code><a href=#document>Document</a></code> instead.</li>

<li><p>If there is no <code><a href=#the-base-element>base</a></code> element that is both a
child of <a href=#the-head-element>the <code>head</code> element</a> and has an
<code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute, then the
Expand Down Expand Up @@ -6288,10 +6295,8 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

<ol><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 the appropriate
<code><a href=#document>Document</a></code> as given by the following list. <a href=#refsHTTP>[HTTP]</a></p>
<p>Let <var title="">document</var> be the appropriate
<code><a href=#document>Document</a></code> as given by the following list:</p>

<dl class=switch><dt>When <a href=#navigate title=navigate>navigating</a></dt>

Expand All @@ -6307,7 +6312,26 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<dd>The <a href=#entry-script>entry script</a>'s <a href="#script's-document" title="script's
document">document</a>.</dd>

</dl><p>Remove any <a href=#url-fragment title=url-fragment>&lt;fragment&gt;</a>
</dl></li>

<li>

<p>While <var title="">document</var> is is <a href=#an-iframe-srcdoc-document>an
<code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code>
document</a>, let <var title="">document</var> be <var title="">document</var>'s <a href=#browsing-context>browsing context</a>'s
<a href=#browsing-context-container>browsing context container</a>'s <code><a href=#document>Document</a></code>
instead.</p>

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

<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
Request-URIs are obtained</i>.</p> <!-- RFC2616 says "The URI MUST
NOT include a fragment." (section 14.36) -->
Expand Down Expand Up @@ -22188,8 +22212,8 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>

<p>The <dfn id=attr-iframe-srcdoc title=attr-iframe-srcdoc><code>srcdoc</code></dfn>
attribute gives the content of the page that the <a href=#nested-browsing-context>nested
browsing context</a> is to contain. The value of the attribute
in is <dfn id=an-iframe-srcdoc-document>an <code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> document</dfn>.</p>
browsing context</a> is to contain. The value of the attribute is
the source of <dfn id=an-iframe-srcdoc-document>an <code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> document</dfn>.</p>

<p>For <code><a href=#the-iframe-element>iframe</a></code> elements in <a href=#html-documents>HTML documents</a>,
the attribute, if present, must have a value using <a href=#syntax>the HTML
Expand Down Expand Up @@ -22230,14 +22254,14 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>
first time.</p>

<p>Whenever an <code><a href=#the-iframe-element>iframe</a></code> element with a <a href=#nested-browsing-context>nested
browsing context</a> has its <code title=attr-iframe-srcdoc><a href=#attr-iframe-srcdoc>srcdoc</a></code> attribute set or changed,
the user agent must <a href=#process-the-iframe-attributes>process the <code>iframe</code>
browsing context</a> has its <code title=attr-iframe-srcdoc><a href=#attr-iframe-srcdoc>srcdoc</a></code> attribute set, changed, or
removed, the user agent must <a href=#process-the-iframe-attributes>process the <code>iframe</code>
attributes</a>.</p>

<p>Similarly, whenever an <code><a href=#the-iframe-element>iframe</a></code> element with a
<a href=#nested-browsing-context>nested browsing context</a> but with no <code title=attr-iframe-srcdoc><a href=#attr-iframe-srcdoc>srcdoc</a></code> attribute specified has its
<code title=attr-iframe-src><a href=#attr-iframe-src>src</a></code> attribute set or changed,
the user agent must <a href=#process-the-iframe-attributes>process the <code>iframe</code>
<code title=attr-iframe-src><a href=#attr-iframe-src>src</a></code> attribute set, changed, or
removed, the user agent must <a href=#process-the-iframe-attributes>process the <code>iframe</code>
attributes</a>.</p> <!-- It doesn't happen when the base URL is
changed, though. -->

Expand All @@ -22252,7 +22276,8 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>
context</a> to a resource whose <a href=#content-type>Content-Type</a> is
<code><a href=#text/html>text/html</a></code>, whose <a href=#url>URL</a> is
<code><a href=#about:srcdoc>about:srcdoc</a></code>, and whose data consists of the value of
the attribute.</dd>
the attribute. The resulting <code><a href=#document>Document</a></code> must be
considered <a href=#an-iframe-srcdoc-document>an <code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> document</a>.</dd>

<dt>If the <code title=attr-iframe-src><a href=#attr-iframe-src>src</a></code>
attribute is specified but the <code title=attr-iframe-srcdoc><a href=#attr-iframe-srcdoc>srcdoc</a></code> attribute is not</dt>
Expand Down Expand Up @@ -58919,6 +58944,13 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU
steps.</dd> <!-- this theoretically would have no effect but in
practice can be useful to work around rendering bugs. -->

<dt>If the <a href=#browsing-context>browsing context</a>'s <a href=#active-document>active
document</a> is <a href=#an-iframe-srcdoc-document>an <code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> document</a></dt>

<dd><p><a href=#process-the-iframe-attributes title="process the iframe attributes">Reprocess the
<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>Otherwise</dt>

<dd><p><a href=#navigate>Navigate</a> the <a href=#browsing-context>browsing context</a> to
Expand Down

0 comments on commit db6bc70

Please sign in to comment.