hixie: <iframe srcdoc=''> first cut. (whatwg r4619)

hixie: <iframe srcdoc=''> first cut. (whatwg r4619)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.3679&r2=1.3680&f=h
http://html5.org/tools/web-apps-tracker?from=4618&to=4619

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.3679
retrieving revision 1.3680
diff -u -d -r1.3679 -r1.3680
--- Overview.html 20 Jan 2010 02:17:35 -0000 1.3679
+++ Overview.html 22 Jan 2010 05:50:23 -0000 1.3680
@@ -262,7 +262,7 @@
    <h1>HTML5</h1>
    <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2>
 
-   <h2 class="no-num no-toc" id="editor-s-draft-20-january-2010">Editor's Draft 20 January 2010</h2>
+   <h2 class="no-num no-toc" id="editor-s-draft-22-january-2010">Editor's Draft 22 January 2010</h2>
    <dl><dt>Latest Published Version:</dt>
     <dd><a href="http://www.w3.org/TR/html5/">http://www.w3.org/TR/html5/</a></dd>
     <dt>Latest Editor's Draft:</dt>
@@ -361,7 +361,7 @@
   specification's progress along the W3C Recommendation
   track.
 
-  This specification is the 20 January 2010 Editor's Draft.
+  This specification is the 22 January 2010 Editor's Draft.
   </p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- relationship to other work (required) --><p>This specification is part of <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/">a
   larger specification</a> being produced by the <a href="http://www.whatwg.org/">WHATWG</a>.
   <!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
@@ -4168,7 +4168,14 @@
 
   </ol><p>This specification defines the URL
   <dfn id="about:legacy-compat"><code>about:legacy-compat</code></dfn> as a reserved, though
-  unresolvable, <code title="">about:</code> URI. <a href="#refsABOUT">[ABOUT]</a></p>
+  unresolvable, <code title="">about:</code> URI, for use in <a href="#syntax-doctype" title="syntax-doctype">DOCTYPE</a>s in <a href="#html-documents">HTML
+  documents</a> when needed for compatibility with XML tools. <a href="#refsABOUT">[ABOUT]</a></p>
+
+  <p>This specification defines the URL
+  <dfn id="about:srcdoc"><code>about:srcdoc</code></dfn> as a reserved, though
+  unresolvable, <code title="">about:</code> URI, that is used as
+  <a href="#the-document-s-address">the document's address</a> of <a href="#an-iframe-srcdoc-document" title="an iframe srcdoc
+  document"><code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> documents</a>. <a href="#refsABOUT">[ABOUT]</a></p>
 
   </div><p class="note">The term "URL" in this specification is used in a
   manner distinct from the precise technical meaning it is given in
@@ -9079,7 +9086,8 @@
    <dt>Contexts in which this element may be used:</dt>
    <dd>As the first element in an <code><a href="#the-html-element-0">html</a></code> element.</dd>
    <dt>Content model:</dt>
-   <dd>One or more elements of <a href="#metadata-content">metadata content</a>, of which exactly one is a <code><a href="#the-title-element-0">title</a></code> element.</dd>
+   <dd>If the document is <a href="#an-iframe-srcdoc-document">an <code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> document</a>: Zero or more elements of <a href="#metadata-content">metadata content</a>.</dd>
+   <dd>Otherwise: One or more elements of <a href="#metadata-content">metadata content</a>, of which exactly one is a <code><a href="#the-title-element-0">title</a></code> element.</dd>
    <dt>Content attributes:</dt>
    <dd><a href="#global-attributes">Global attributes</a></dd>
    <dt>DOM interface:</dt>
@@ -10196,14 +10204,19 @@
 
   </ul><p>If an <a href="#html-documents" title="HTML documents">HTML document</a> does not
   start with a BOM, and if its encoding is not explicitly given by
-  <a href="#content-type" title="Content-Type">Content-Type metadata</a>, then the
+  <a href="#content-type" title="Content-Type">Content-Type metadata</a>, and the
+  document is not <a href="#an-iframe-srcdoc-document">an <code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> document</a>, then the
   character encoding used must be an <a href="#ascii-compatible-character-encoding">ASCII-compatible character
   encoding</a>, and, in addition, if that encoding isn't US-ASCII
   itself, then the encoding must be specified using a
   <code><a href="#meta">meta</a></code> element with a <code title="attr-meta-charset"><a href="#attr-meta-charset">charset</a></code> attribute or a
   <code><a href="#meta">meta</a></code> element with an <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> attribute in the
   <a href="#attr-meta-http-equiv-content-type" title="attr-meta-http-equiv-content-type">Encoding declaration
-  state</a>.<p>If an <a href="#html-documents" title="HTML documents">HTML document</a> contains
+  state</a>.<p>If the document is <a href="#an-iframe-srcdoc-document">an <code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> document</a>, the
+  document must not have a <a href="#character-encoding-declaration">character encoding
+  declaration</a>. (In this case, the source is already decoded,
+  since it is part of the document that contained the
+  <code><a href="#the-iframe-element">iframe</a></code>.)<p>If an <a href="#html-documents" title="HTML documents">HTML document</a> contains
   a <code><a href="#meta">meta</a></code> element with a <code title="attr-meta-charset"><a href="#attr-meta-charset">charset</a></code> attribute or a
   <code><a href="#meta">meta</a></code> element with an <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> attribute in the
   <a href="#attr-meta-http-equiv-content-type" title="attr-meta-http-equiv-content-type">Encoding declaration
@@ -16737,6 +16750,7 @@
    <dt>Content attributes:</dt>
    <dd><a href="#global-attributes">Global attributes</a></dd>
    <dd><code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code></dd>
+   <dd><code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code></dd>
    <dd><code title="attr-iframe-name"><a href="#attr-iframe-name">name</a></code></dd>
    <dd><code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code></dd>
    <dd><code title="attr-iframe-seamless"><a href="#attr-iframe-seamless">seamless</a></code></dd>
@@ -16746,6 +16760,7 @@
    <dd>
 <pre class="idl">interface <dfn id="htmliframeelement">HTMLIFrameElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
            attribute DOMString <a href="#dom-iframe-src" title="dom-iframe-src">src</a>;
+           attribute DOMString <a href="#dom-iframe-srcdoc" title="dom-iframe-srcdoc">srcdoc</a>;
            attribute DOMString <a href="#dom-iframe-name" title="dom-iframe-name">name</a>;
   [PutForwards=<a href="#dom-domsettabletokenlist-value" title="dom-DOMSettableTokenList-value">value</a>] readonly attribute <a href="#domsettabletokenlist">DOMSettableTokenList</a> <a href="#dom-iframe-sandbox" title="dom-iframe-sandbox">sandbox</a>;
            attribute boolean <a href="#dom-iframe-seamless" title="dom-iframe-seamless">seamless</a>;
@@ -16755,57 +16770,109 @@
   readonly attribute <a href="#windowproxy">WindowProxy</a> <a href="#dom-iframe-contentwindow" title="dom-iframe-contentWindow">contentWindow</a>;
 };</pre>
    </dd>
-  </dl><!-- v2 doc="" idea (awaiting implementation experience with seamless="" first):
+  </dl><p>The <code><a href="#the-iframe-element">iframe</a></code> element <a href="#represents">represents</a> a
+  <a href="#nested-browsing-context">nested browsing context</a>.<p>The <dfn id="attr-iframe-src" title="attr-iframe-src"><code>src</code></dfn> attribute
+  gives the address of a page that the <a href="#nested-browsing-context">nested browsing
+  context</a> is to contain. The attribute, if present, must be a
+  <a href="#valid-url">valid URL</a>.<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>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
+  syntax</a> that consists of the following syntactic components,
+  in the given order:<ol><li>Any number of <a href="#syntax-comments" title="syntax-comments">comments</a> and
+   <a href="#space-character" title="space character">space characters</a>.</li>
 
-       http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-May/014874.html
+   <li>Optionally, a <a href="#syntax-doctype" title="syntax-doctype">DOCTYPE</a>.
 
-       doc="" would take a string which would then be interpreted as
-       the source document markup of an HTML document, much like the
-       above; it would override src="" if it was present, allowing
-       src="" to be used for legacy UAs:
+   <li>Any number of <a href="#syntax-comments" title="syntax-comments">comments</a> and
+   <a href="#space-character" title="space character">space characters</a>.</li>
 
-          <iframe seamless sandbox="allow-scripts allow-forms" doc="
-            Welcome to my blog!
-            </sandbox>
-            <a href='#' onclick='alert(document.cookie)'>Click here</a>
-          "></iframe>
+   <li>The root element, in the form of an <code><a href="#the-html-element-0">html</a></code> <a href="#syntax-elements" title="syntax-elements">element</a>.</li>
 
-       TODO:
-          <!DOCTYPE HTML> implication
-          <title></title> optional
+   <li>Any number of <a href="#syntax-comments" title="syntax-comments">comments</a> and
+   <a href="#space-character" title="space character">space characters</a>.</li>
 
-  --><p>The <code><a href="#the-iframe-element">iframe</a></code> element <a href="#represents">represents</a> a
-  <a href="#nested-browsing-context">nested browsing context</a>.<p>The <dfn id="attr-iframe-src" title="attr-iframe-src"><code>src</code></dfn> attribute
-  gives the address of a page that the <a href="#nested-browsing-context">nested browsing
-  context</a> is to contain. The attribute, if present, must be a
-  <a href="#valid-url">valid URL</a>. <span class="impl">When the browsing context
-  is created, if the attribute is present, the user agent must <a href="#resolve-a-url" title="resolve a url">resolve</a> the value of that attribute,
-  relative to the element, and if that is successful, must then
-  <a href="#navigate">navigate</a> the element's browsing context to the
-  resulting <a href="#absolute-url">absolute URL</a>, with <a href="#replacement-enabled">replacement
-  enabled</a>, and with the <code><a href="#the-iframe-element">iframe</a></code> element's
+  </ol><p>For <code><a href="#the-iframe-element">iframe</a></code> elements in <a href="#xml-documents">XML documents</a>,
+  the attribute, if present, must have a value that matches the
+  production labeled <code>document</code> in the XML
+  specification. <a href="#refsXML">[XML]</a><p>If the <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code> attribute and the
+  <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code> attribute are both
+  specified together, the <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code>
+  attribute takes priority. This allows authors to provide a fallback
+  <a href="#url">URL</a> for legacy user agents that do not support the
+  <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code> attribute.<div class="impl">
+
+  <p>When an <code><a href="#the-iframe-element">iframe</a></code> element is first <a href="#insert-an-element-into-a-document" title="insert
+  an element into a document">inserted into a document</a>, the
+  user agent must create a <a href="#nested-browsing-context">nested browsing context</a>, and
+  then <a href="#process-the-iframe-attributes">process the <code>iframe</code> attributes</a>.</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>
+  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>
+  attributes</a>.</p> <!-- It doesn't happen when the base URL is
+  changed, though. -->
+
+  <p>When the user agent is to <dfn id="process-the-iframe-attributes">process the <code>iframe</code>
+  attributes</dfn>, it must run the first appropriate steps from the
+  following list:</p>
+
+  <dl class="switch"><dt>If the <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code> attribute
+   is specified</dt>
+
+   <dd><p><a href="#navigate">Navigate</a> the element's <a href="#browsing-context">browsing
+   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>
+
+   <dt>Otherwise, 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>
+
+   <dd>
+
+    <ol><li><p><a href="#resolve-a-url" title="resolve a url">Resolve</a> the value of
+     the <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code> attribute, relative
+     to the <code><a href="#the-iframe-element">iframe</a></code> element.</li>
+
+     <li><p>If that is successful, <a href="#navigate">navigate</a> the element's
+     <a href="#browsing-context">browsing context</a> to the resulting <a href="#absolute-url">absolute
+     URL</a>.</li>
+
+    </ol></dd>
+
+  </dl><p>Any <a href="#navigate" title="navigate">navigation</a> required of the user
+  agent in the <a href="#process-the-iframe-attributes">process the <code>iframe</code> attributes</a>
+  algorithm must be completed with the <code><a href="#the-iframe-element">iframe</a></code> element's
   document's <a href="#browsing-context">browsing context</a> as the <a href="#source-browsing-context">source
-  browsing context</a>. If the user <a href="#navigate" title="navigate">navigates</a> away from this page, the
-  <code><a href="#the-iframe-element">iframe</a></code>'s corresponding <code><a href="#windowproxy">WindowProxy</a></code> object
-  will proxy new <code><a href="#window">Window</a></code> objects for new
-  <code>Document</code> objects, but the <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code> attribute will not
-  change.</span><div class="impl">
+  browsing context</a>.</p>
 
-  <p>Whenever the <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code> attribute
-  is set, the user agent must <a href="#resolve-a-url" title="resolve a
-  url">resolve</a> the value of that attribute, relative to the
-  element, and if that is successful, the nested <a href="#browsing-context">browsing
-  context</a> must be <a href="#navigate" title="navigate">navigated</a> to
-  the resulting <a href="#absolute-url">absolute URL</a>, with the
-  <code><a href="#the-iframe-element">iframe</a></code> element's document's <a href="#browsing-context">browsing
-  context</a> as the <a href="#source-browsing-context">source browsing context</a>.</p> <!--
-  It doesn't happen when the base URL is changed, though. -->
+  <p>Furthermore, if the <a href="#process-the-iframe-attributes">process the <code>iframe</code>
+  attributes</a> algorithm was invoked as a result of the element
+  being <a href="#insert-an-element-into-a-document" title="insert an element into a document">inserted into
+  a document</a>, then any <a href="#navigate" title="navigate">navigation</a>
+  required of the user agent in that algorithm must be completed with
+  <a href="#replacement-enabled">replacement enabled</a>.</p>
 
-  <p>If the <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code> attribute is not
-  set when the element is created, or if its value cannot be <a href="#resolve-a-url" title="resolve a url">resolved</a>, the browsing context will
-  remain at the initial <code><a href="#about:blank">about:blank</a></code> page.</p>
+  </div><p class="note">If, when the element is created, the <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code> attribute is not set, and
+  the <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code> attribute is either
+  also not set or set but its value cannot be <a href="#resolve-a-url" title="resolve a
+  url">resolved</a>, the browsing context will remain at the
+  initial <code><a href="#about:blank">about:blank</a></code> page.<p class="note">If the user <a href="#navigate" title="navigate">navigates</a>
+  away from this page, the <code><a href="#the-iframe-element">iframe</a></code>'s corresponding
+  <code><a href="#windowproxy">WindowProxy</a></code> object will proxy new <code><a href="#window">Window</a></code>
+  objects for new <code>Document</code> objects, but the <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code> attribute will not change.<div class="example">
 
-  </div><p>The <dfn id="attr-iframe-name" title="attr-iframe-name"><code>name</code></dfn>
+   <p class="xxx">example for srcdoc here</p>
+
+  </div><hr><p>The <dfn id="attr-iframe-name" title="attr-iframe-name"><code>name</code></dfn>
   attribute, if present, must be a <a href="#valid-browsing-context-name">valid browsing context
   name</a>. The given value is used to name the <a href="#nested-browsing-context">nested
   browsing context</a>. <span class="impl">When the browsing
@@ -17221,7 +17288,7 @@
   documents</a>.<p class="note">The <a href="#html-parser">HTML parser</a> treats markup inside
   <code><a href="#the-iframe-element">iframe</a></code> elements as text.<div class="impl">
 
-  <p>The IDL attributes <dfn id="dom-iframe-src" title="dom-iframe-src"><code>src</code></dfn>, <dfn id="dom-iframe-name" title="dom-iframe-name"><code>name</code></dfn>, <dfn id="dom-iframe-sandbox" title="dom-iframe-sandbox"><code>sandbox</code></dfn>, and <dfn id="dom-iframe-seamless" title="dom-iframe-seamless"><code>seamless</code></dfn> must
+  <p>The IDL attributes <dfn id="dom-iframe-src" title="dom-iframe-src"><code>src</code></dfn>, <dfn id="dom-iframe-srcdoc" title="dom-iframe-srcdoc"><code>srcdoc</code></dfn>, <dfn id="dom-iframe-body" title="dom-iframe-body"><code>body</code></dfn>, <dfn id="dom-iframe-name" title="dom-iframe-name"><code>name</code></dfn>, <dfn id="dom-iframe-sandbox" title="dom-iframe-sandbox"><code>sandbox</code></dfn>, and <dfn id="dom-iframe-seamless" title="dom-iframe-seamless"><code>seamless</code></dfn> must
   <a href="#reflect">reflect</a> the respective content attributes of the same
   name.</p>
 
@@ -38798,6 +38865,14 @@
      assigned when its browsing context was created</a>.</dd>
 
 
+     <dt>If a <code>Document</code> is <a href="#an-iframe-srcdoc-document">an <code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> document</a></dt>
+
+     <dd>The <a href="#origin">origin</a> of the <code>Document</code> is the
+     <a href="#origin">origin</a> of the <code>Document</code>'s <a href="#browsing-context">browsing
+     context</a>'s <a href="#browsing-context-container">browsing context container</a>'s
+     <code>Document</code>.</dd>
+
+
      <dt>If a <code>Document</code> or image was obtained in some
      other manner (e.g. a <code title="">data:</code> URL typed in by
      the user, a <code>Document</code> created using the <code title="dom-DOMImplementation-createDocument">createDocument()</code>
@@ -64565,6 +64640,7 @@
      <td>text*</td>
      <td><a href="#global-attributes" title="global attributes">globals</a>;
          <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code>;
+         <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code>;
          <code title="attr-iframe-name"><a href="#attr-iframe-name">name</a></code>;
          <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code>;
          <code title="attr-iframe-seamless"><a href="#attr-iframe-seamless">seamless</a></code>;
@@ -65242,6 +65318,10 @@
           <code title="attr-media-autoplay"><a href="#attr-media-autoplay">video</a></code>
      <td> Hint that the <a href="#media-resource">media resource</a> can be started automatically when the page is loaded
      <td> <a href="#boolean-attribute">Boolean attribute</a>
+    <tr><th> <code title="">srcdoc</code>
+     <td> <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">iframe</a></code>
+     <td> A document to render in the <code><a href="#the-iframe-element">iframe</a></code>
+     <td> The source of <a href="#an-iframe-srcdoc-document">an <code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> document</a>*
     <tr><th> <code title="">challenge</code>
      <td> <code title="attr-keygen-challenge"><a href="#attr-keygen-challenge">keygen</a></code>
      <td> String to package with the generated and signed public key

Received on Friday, 22 January 2010 05:51:14 UTC