[html5] r4207 - [agiow] (1) Define createHTMLDocument(). Fixing http://www.w3.org/Bugs/Public/sh [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Oct 20 04:26:13 PDT 2009


Author: ianh
Date: 2009-10-20 04:26:11 -0700 (Tue, 20 Oct 2009)
New Revision: 4207

Modified:
   complete.html
   index
   source
Log:
[agiow] (1) Define createHTMLDocument().
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=7842

Modified: complete.html
===================================================================
--- complete.html	2009-10-20 10:47:48 UTC (rev 4206)
+++ complete.html	2009-10-20 11:26:11 UTC (rev 4207)
@@ -291,7 +291,8 @@
      <li><a href=#documents-in-the-dom><span class=secno>3.1.1 </span>Documents in the DOM</a></li>
      <li><a href=#security><span class=secno>3.1.2 </span>Security</a></li>
      <li><a href=#resource-metadata-management><span class=secno>3.1.3 </span>Resource metadata management</a></li>
-     <li><a href=#dom-tree-accessors><span class=secno>3.1.4 </span>DOM tree accessors</a></ol></li>
+     <li><a href=#dom-tree-accessors><span class=secno>3.1.4 </span>DOM tree accessors</a></li>
+     <li><a href=#creating-documents><span class=secno>3.1.5 </span>Creating documents</a></ol></li>
    <li><a href=#elements><span class=secno>3.2 </span>Elements</a>
     <ol>
      <li><a href=#semantics-0><span class=secno>3.2.1 </span>Semantics</a></li>
@@ -6746,10 +6747,11 @@
   <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>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
-  the <a href=#active-document>active document</a> of the <a href="#script's-browsing-context">script's browsing
-  context</a>.</p>
+  <p>When a <code>Document</code> is created by a <a href=#concept-script title=concept-script>script</a> using the <code title=dom-DOMImplementation-createDocument>createDocument()</code>
+  or <code title=dom-DOMHTMLImplementation-createHTMLDocument><a href=#dom-domhtmlimplementation-createhtmldocument>createHTMLDocument()</a></code>
+  APIs, <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 the <a href=#active-document>active document</a> of the
+  <a href="#script's-browsing-context">script's browsing context</a>.</p>
 
   <p><code>Document</code> objects are assumed to be <dfn id=xml-documents>XML
   documents</dfn> unless they are flagged as being <dfn id=html-documents>HTML
@@ -6757,13 +6759,8 @@
   <a href=#html-documents title="HTML documents">HTML document</a> or an <a href=#xml-documents title="XML documents">XML document</a> affects the behavior of
   certain APIs and the case-sensitivity of some selectors.</p>
 
-  <p class=note>A <code>Document</code> object created by the <code title="">createDocument()</code> API on the
-  <code>DOMImplementation</code> object is flagged as an <a href=#xml-documents title="XML documents">XML document</a>. A <code>Document</code>
-  object created by the <a href=#html-parser>HTML parser</a> for a
-  <code><a href=#text/html>text/html</a></code> resource will be flagged as an <a href=#html-documents title="HTML documents">HTML document</a>.</p>
 
 
-
   <h4 id=documents-in-the-dom><span class=secno>3.1.1 </span>Documents in the DOM</h4>
 
   <p>All <code>Document</code> objects (in user agents implementing
@@ -7555,8 +7552,54 @@
 
 
 
-  <h3 id=elements><span class=secno>3.2 </span>Elements</h3>
+  <h4 id=creating-documents><span class=secno>3.1.5 </span>Creating documents</h4>
 
+  <p><a href=#xml-documents>XML documents</a> can be created from script using the
+  DOM <code title=dom-DOMImplementation-createDocument>createDocument()</code>
+  method on the <code>DOMImplementation</code> interface.</p>
+
+  <p><a href=#html-documents>HTML documents</a> can be created using the <code title=dom-DOMHTMLImplementation-createHTMLDocument><a href=#dom-domhtmlimplementation-createhtmldocument>createHTMLDocument()</a></code>
+  method:</p>
+
+  <pre>[Supplemental, NoInterfaceObject]
+interface <dfn id=domhtmlimplementation>DOMHTMLImplementation</dfn> {
+  <span>Document</span> <a href=#dom-domhtmlimplementation-createhtmldocument title=dom-DOMHTMLImplementation-createHTMLDocument>createHTMLDocument</a>(in DOMString title);
+};
+<span>DOMImplementation</span> implements <a href=#domhtmlimplementation>DOMHTMLImplementation</a>;</pre>
+
+  <p>The <dfn id=dom-domhtmlimplementation-createhtmldocument title=dom-DOMHTMLImplementation-createHTMLDocument><code>createHTMLDocument(<var title="">title</var>)</code></dfn> method, when invoked, must run the
+  following steps:</p>
+
+  <ol><li><p>Let <var title="">doc</var> be a newly created
+   <code>Document</code> object.</li>
+
+   <li><p>Mark <var title="">doc</var> as being an <a href=#html-documents title="HTML
+   documents">HTML document</a>.</li>
+
+   <li><p>Create a <code>DocumentType</code> node with the <code title="">name</code> attribute set to the string "<code title="">html</code>", and the other attributes specific to
+   <code>DocumentType</code> objects set to the empty string, null,
+   and empty lists, as appropriate. Append the newly created node to
+   <var title="">doc</var>.</li>
+
+   <li><p>Create an <code><a href=#the-html-element-0>html</a></code> element, and append it to <var title="">doc</var>.</li>
+
+   <li><p>Create a <code><a href=#the-head-element-0>head</a></code> element, and append it to the
+   <code><a href=#the-html-element-0>html</a></code> element created in the previous step.</p>
+
+   <li><p>Create a <code><a href=#the-title-element-0>title</a></code> element, and append it to the
+   <code><a href=#the-head-element-0>head</a></code> element created in the previous step.</p>
+
+   <li><p>Create a <code>Text</code> node, and set its <code title="">data</code> attribute to the string given by the method's
+   argument (which could be the empty string). Append it to the
+   <code><a href=#the-title-element-0>title</a></code> element created in the previous step.</p>
+
+   <li><p>Create a <code><a href=#the-body-element-0>body</a></code> element, and append it to the
+   <code><a href=#the-html-element-0>html</a></code> element created in the earlier step.</p>
+
+   <li><p>Return <var title="">doc</var>.</li>
+
+  </ol><h3 id=elements><span class=secno>3.2 </span>Elements</h3>
+
   <h4 id=semantics-0><span class=secno>3.2.1 </span>Semantics</h4>
 
   <p>Elements, attributes, and attribute values in HTML are defined
@@ -50055,7 +50098,8 @@
 
      <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="">createDocument()</code> API, etc)</dt>
+     the user, a <code>Document</code> created using the <code title=dom-DOMImplementation-createDocument>createDocument()</code>
+     API, etc)</dt>
 
      <dd>The <a href=#origin>origin</a> is a globally unique identifier
      assigned when the <code>Document</code> or image is created.</dd>

Modified: index
===================================================================
--- index	2009-10-20 10:47:48 UTC (rev 4206)
+++ index	2009-10-20 11:26:11 UTC (rev 4207)
@@ -281,7 +281,8 @@
      <li><a href=#documents-in-the-dom><span class=secno>3.1.1 </span>Documents in the DOM</a></li>
      <li><a href=#security><span class=secno>3.1.2 </span>Security</a></li>
      <li><a href=#resource-metadata-management><span class=secno>3.1.3 </span>Resource metadata management</a></li>
-     <li><a href=#dom-tree-accessors><span class=secno>3.1.4 </span>DOM tree accessors</a></ol></li>
+     <li><a href=#dom-tree-accessors><span class=secno>3.1.4 </span>DOM tree accessors</a></li>
+     <li><a href=#creating-documents><span class=secno>3.1.5 </span>Creating documents</a></ol></li>
    <li><a href=#elements><span class=secno>3.2 </span>Elements</a>
     <ol>
      <li><a href=#semantics-0><span class=secno>3.2.1 </span>Semantics</a></li>
@@ -6575,10 +6576,11 @@
   <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>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
-  the <a href=#active-document>active document</a> of the <a href="#script's-browsing-context">script's browsing
-  context</a>.</p>
+  <p>When a <code>Document</code> is created by a <a href=#concept-script title=concept-script>script</a> using the <code title=dom-DOMImplementation-createDocument>createDocument()</code>
+  or <code title=dom-DOMHTMLImplementation-createHTMLDocument><a href=#dom-domhtmlimplementation-createhtmldocument>createHTMLDocument()</a></code>
+  APIs, <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 the <a href=#active-document>active document</a> of the
+  <a href="#script's-browsing-context">script's browsing context</a>.</p>
 
   <p><code>Document</code> objects are assumed to be <dfn id=xml-documents>XML
   documents</dfn> unless they are flagged as being <dfn id=html-documents>HTML
@@ -6586,13 +6588,8 @@
   <a href=#html-documents title="HTML documents">HTML document</a> or an <a href=#xml-documents title="XML documents">XML document</a> affects the behavior of
   certain APIs and the case-sensitivity of some selectors.</p>
 
-  <p class=note>A <code>Document</code> object created by the <code title="">createDocument()</code> API on the
-  <code>DOMImplementation</code> object is flagged as an <a href=#xml-documents title="XML documents">XML document</a>. A <code>Document</code>
-  object created by the <a href=#html-parser>HTML parser</a> for a
-  <code><a href=#text/html>text/html</a></code> resource will be flagged as an <a href=#html-documents title="HTML documents">HTML document</a>.</p>
 
 
-
   <h4 id=documents-in-the-dom><span class=secno>3.1.1 </span>Documents in the DOM</h4>
 
   <p>All <code>Document</code> objects (in user agents implementing
@@ -7384,8 +7381,54 @@
 
 
 
-  <h3 id=elements><span class=secno>3.2 </span>Elements</h3>
+  <h4 id=creating-documents><span class=secno>3.1.5 </span>Creating documents</h4>
 
+  <p><a href=#xml-documents>XML documents</a> can be created from script using the
+  DOM <code title=dom-DOMImplementation-createDocument>createDocument()</code>
+  method on the <code>DOMImplementation</code> interface.</p>
+
+  <p><a href=#html-documents>HTML documents</a> can be created using the <code title=dom-DOMHTMLImplementation-createHTMLDocument><a href=#dom-domhtmlimplementation-createhtmldocument>createHTMLDocument()</a></code>
+  method:</p>
+
+  <pre>[Supplemental, NoInterfaceObject]
+interface <dfn id=domhtmlimplementation>DOMHTMLImplementation</dfn> {
+  <span>Document</span> <a href=#dom-domhtmlimplementation-createhtmldocument title=dom-DOMHTMLImplementation-createHTMLDocument>createHTMLDocument</a>(in DOMString title);
+};
+<span>DOMImplementation</span> implements <a href=#domhtmlimplementation>DOMHTMLImplementation</a>;</pre>
+
+  <p>The <dfn id=dom-domhtmlimplementation-createhtmldocument title=dom-DOMHTMLImplementation-createHTMLDocument><code>createHTMLDocument(<var title="">title</var>)</code></dfn> method, when invoked, must run the
+  following steps:</p>
+
+  <ol><li><p>Let <var title="">doc</var> be a newly created
+   <code>Document</code> object.</li>
+
+   <li><p>Mark <var title="">doc</var> as being an <a href=#html-documents title="HTML
+   documents">HTML document</a>.</li>
+
+   <li><p>Create a <code>DocumentType</code> node with the <code title="">name</code> attribute set to the string "<code title="">html</code>", and the other attributes specific to
+   <code>DocumentType</code> objects set to the empty string, null,
+   and empty lists, as appropriate. Append the newly created node to
+   <var title="">doc</var>.</li>
+
+   <li><p>Create an <code><a href=#the-html-element-0>html</a></code> element, and append it to <var title="">doc</var>.</li>
+
+   <li><p>Create a <code><a href=#the-head-element-0>head</a></code> element, and append it to the
+   <code><a href=#the-html-element-0>html</a></code> element created in the previous step.</p>
+
+   <li><p>Create a <code><a href=#the-title-element-0>title</a></code> element, and append it to the
+   <code><a href=#the-head-element-0>head</a></code> element created in the previous step.</p>
+
+   <li><p>Create a <code>Text</code> node, and set its <code title="">data</code> attribute to the string given by the method's
+   argument (which could be the empty string). Append it to the
+   <code><a href=#the-title-element-0>title</a></code> element created in the previous step.</p>
+
+   <li><p>Create a <code><a href=#the-body-element-0>body</a></code> element, and append it to the
+   <code><a href=#the-html-element-0>html</a></code> element created in the earlier step.</p>
+
+   <li><p>Return <var title="">doc</var>.</li>
+
+  </ol><h3 id=elements><span class=secno>3.2 </span>Elements</h3>
+
   <h4 id=semantics-0><span class=secno>3.2.1 </span>Semantics</h4>
 
   <p>Elements, attributes, and attribute values in HTML are defined
@@ -47214,7 +47257,8 @@
 
      <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="">createDocument()</code> API, etc)</dt>
+     the user, a <code>Document</code> created using the <code title=dom-DOMImplementation-createDocument>createDocument()</code>
+     API, etc)</dt>
 
      <dd>The <a href=#origin>origin</a> is a globally unique identifier
      assigned when the <code>Document</code> or image is created.</dd>

Modified: source
===================================================================
--- source	2009-10-20 10:47:48 UTC (rev 4206)
+++ source	2009-10-20 11:26:11 UTC (rev 4207)
@@ -6476,10 +6476,12 @@
 
   <p>When a <code>Document</code> is created by a <span
   title="concept-script">script</span> using the <code
-  title="">createDocument()</code> API, <span>the document's
-  address</span> is the same as <span>the document's address</span> of
-  the <span>active document</span> of the <span>script's browsing
-  context</span>.</p>
+  title="dom-DOMImplementation-createDocument">createDocument()</code>
+  or <code
+  title="dom-DOMHTMLImplementation-createHTMLDocument">createHTMLDocument()</code>
+  APIs, <span>the document's address</span> is the same as <span>the
+  document's address</span> of the <span>active document</span> of the
+  <span>script's browsing context</span>.</p>
 
   <p><code>Document</code> objects are assumed to be <dfn>XML
   documents</dfn> unless they are flagged as being <dfn>HTML
@@ -6488,16 +6490,8 @@
   title="XML documents">XML document</span> affects the behavior of
   certain APIs and the case-sensitivity of some selectors.</p>
 
-  <p class="note">A <code>Document</code> object created by the <code
-  title="">createDocument()</code> API on the
-  <code>DOMImplementation</code> object is flagged as an <span
-  title="XML documents">XML document</span>. A <code>Document</code>
-  object created by the <span>HTML parser</span> for a
-  <code>text/html</code> resource will be flagged as an <span
-  title="HTML documents">HTML document</span>.</p>
 
 
-
   <h4>Documents in the DOM</h4>
 
   <p>All <code>Document</code> objects (in user agents implementing
@@ -7434,6 +7428,66 @@
 
 
 
+  <h4>Creating documents</h4>
+
+  <p><span>XML documents</span> can be created from script using the
+  DOM <code
+  title="dom-DOMImplementation-createDocument">createDocument()</code>
+  method on the <code>DOMImplementation</code> interface.</p>
+
+  <p><span>HTML documents</span> can be created using the <code
+  title="dom-DOMHTMLImplementation-createHTMLDocument">createHTMLDocument()</code>
+  method:</p>
+
+  <pre>[Supplemental, NoInterfaceObject]
+interface <dfn>DOMHTMLImplementation</dfn> {
+  <span>Document</span> <span title="dom-DOMHTMLImplementation-createHTMLDocument">createHTMLDocument</span>(in DOMString title);
+};
+<span>DOMImplementation</span> implements <span>DOMHTMLImplementation</span>;</pre>
+
+  <p>The <dfn
+  title="dom-DOMHTMLImplementation-createHTMLDocument"><code>createHTMLDocument(<var
+  title="">title</var>)</code></dfn> method, when invoked, must run the
+  following steps:</p>
+
+  <ol>
+
+   <li><p>Let <var title="">doc</var> be a newly created
+   <code>Document</code> object.</p></li>
+
+   <li><p>Mark <var title="">doc</var> as being an <span title="HTML
+   documents">HTML document</span>.</p></li>
+
+   <li><p>Create a <code>DocumentType</code> node with the <code
+   title="">name</code> attribute set to the string "<code
+   title="">html</code>", and the other attributes specific to
+   <code>DocumentType</code> objects set to the empty string, null,
+   and empty lists, as appropriate. Append the newly created node to
+   <var title="">doc</var>.</p></li>
+
+   <li><p>Create an <code>html</code> element, and append it to <var
+   title="">doc</var>.</p></li>
+
+   <li><p>Create a <code>head</code> element, and append it to the
+   <code>html</code> element created in the previous step.</p>
+
+   <li><p>Create a <code>title</code> element, and append it to the
+   <code>head</code> element created in the previous step.</p>
+
+   <li><p>Create a <code>Text</code> node, and set its <code
+   title="">data</code> attribute to the string given by the method's
+   argument (which could be the empty string). Append it to the
+   <code>title</code> element created in the previous step.</p>
+
+   <li><p>Create a <code>body</code> element, and append it to the
+   <code>html</code> element created in the earlier step.</p>
+
+   <li><p>Return <var title="">doc</var>.</p></li>
+
+  </ol>
+
+
+
   <h3>Elements</h3>
 
   <h4>Semantics</h4>
@@ -56248,7 +56302,8 @@
      <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="">createDocument()</code> API, etc)</dt>
+     title="dom-DOMImplementation-createDocument">createDocument()</code>
+     API, etc)</dt>
 
      <dd>The <span>origin</span> is a globally unique identifier
      assigned when the <code>Document</code> or image is created.</dd>




More information about the Commit-Watchers mailing list