You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The <dfn class="idl-code" data-dfn-for="DOMImplementation" data-dfn-type="method" data-export="" data-lt="createHTMLDocument(title)|createHTMLDocument()" id="dom-domimplementation-createhtmldocument"><code>createHTMLDocument(<var>title</var>)</code><a class="self-link" href="#dom-domimplementation-createhtmldocument"></a></dfn> method, when invoked, must run these steps:</p>
2840
2840
<ol>
2841
-
<li>Let <var>doc</var> be a new <a data-link-type="dfn" href="#concept-document">document</a> that is an <a data-link-type="dfn" href="#html-document">HTML document</a>.
2842
-
<li>Set <var>doc</var>’s <a data-link-type="dfn" href="#concept-document-content-type">content type</a> to "<code>text/html</code>".
2843
-
<li><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <a data-link-type="dfn" href="#concept-doctype">doctype</a>, with "<code>html</code>" as its <a data-link-type="dfn" href="#concept-doctype-name">name</a> and with its <a data-link-type="dfn" href="#concept-node-document">node document</a> set to <var>doc</var>, to <var>doc</var>.
2844
-
<li><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-html-element">html</a></code> element in the <span>HTML namespace</span>, to <var>doc</var>.
2845
-
<li><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-head-element">head</a></code> element in the <span>HTML namespace</span>, to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-html-element">html</a></code> element created earlier.
2846
2841
<li>
2847
-
If the <var>title</var> argument is not omitted:
2842
+
<p>Let <var>doc</var> be a new <a data-link-type="dfn" href="#concept-document">document</a> that is an <a data-link-type="dfn" href="#html-document">HTML document</a>. </p>
2843
+
<li>
2844
+
<p>Set <var>doc</var>’s <a data-link-type="dfn" href="#concept-document-content-type">content type</a> to "<code>text/html</code>". </p>
2845
+
<li>
2846
+
<p><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <a data-link-type="dfn" href="#concept-doctype">doctype</a>, with "<code>html</code>" as its <a data-link-type="dfn" href="#concept-doctype-name">name</a> and with its <a data-link-type="dfn" href="#concept-node-document">node document</a> set to <var>doc</var>, to <var>doc</var>. </p>
2847
+
<li>
2848
+
<p><a data-link-type="dfn" href="#concept-node-append">Append</a> the result of <a data-link-type="dfn" href="#concept-create-element">creating an element</a> given <var>doc</var>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-html-element">html</a></code>, and
2849
+
the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, to <var>doc</var>. </p>
2850
+
<li>
2851
+
<p><a data-link-type="dfn" href="#concept-node-append">Append</a> the result of <a data-link-type="dfn" href="#concept-create-element">creating an element</a> given <var>doc</var>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-head-element">head</a></code>, and
2852
+
the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-html-element">html</a></code> element created earlier. </p>
2853
+
<li>
2854
+
<p>If <var>title</var> is given: </p>
2848
2855
<ol>
2849
-
<li><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-title-element">title</a></code> element in the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-head-element">head</a></code> element created earlier.
2850
-
<li><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, with its <a data-link-type="dfn" href="#concept-cd-data">data</a> set to <var>title</var> (which could be the empty string), to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-title-element">title</a></code> element created
2851
-
earlier.
2856
+
<li>
2857
+
<p><a data-link-type="dfn" href="#concept-node-append">Append</a> the result of <a data-link-type="dfn" href="#concept-create-element">creating an element</a> given <var>doc</var>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-title-element">title</a></code>,
2858
+
and the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-head-element">head</a></code> element created earlier. </p>
2859
+
<li>
2860
+
<p><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, with its <a data-link-type="dfn" href="#concept-cd-data">data</a> set to <var>title</var> (which could be the empty string) and its <a data-link-type="dfn" href="#concept-node-document">node document</a> set to <var>doc</var>, to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-title-element">title</a></code> element created earlier. </p>
2852
2861
</ol>
2853
-
<li><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-body-element">body</a></code> element in the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-html-element">html</a></code> element created earlier.
2854
-
<li><var>doc</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origin</a> is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origin</a> of the <a data-link-type="dfn" href="#context-object">context object</a>’s associated <a data-link-type="dfn" href="#concept-document">document</a>. <a data-link-type="biblio" href="#biblio-html">[HTML]</a>
2855
-
<li>Return <var>doc</var>.
2862
+
<li>
2863
+
<p><a data-link-type="dfn" href="#concept-node-append">Append</a> the result of <a data-link-type="dfn" href="#concept-create-element">creating an element</a> given <var>doc</var>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-body-element">body</a></code>, and
2864
+
the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-html-element">html</a></code> element created earlier.</p>
2865
+
<li>
2866
+
<p><var>doc</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origin</a> is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origin</a> of the <a data-link-type="dfn" href="#context-object">context object</a>’s
0 commit comments