Skip to content
Permalink
Browse files

[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 db6bc706ee85869dfdc25c4319446740a817e056
Showing with 138 additions and 39 deletions.
  1. +45 −13 complete.html
  2. +45 −13 index
  3. +48 −13 source

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

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

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

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

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

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

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

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

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

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

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

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

0 comments on commit db6bc70

Please sign in to comment.
You can’t perform that action at this time.