Skip to content

Commit aaed93a

Browse files
committed
Use "create an element" in createHTMLDocument
Takes care of part of #212. (cherry picked from commit 7b42a54) # Conflicts: # dom.bs # dom.html
1 parent 33d1b34 commit aaed93a

File tree

2 files changed

+44
-30
lines changed

2 files changed

+44
-30
lines changed

dom.bs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5081,39 +5081,39 @@ The
50815081
method, when invoked, must run these steps:
50825082

50835083
<ol>
5084-
<li>Let <var>doc</var> be a new <a>document</a> that is an <a>HTML document</a>.
5084+
<li><p>Let <var>doc</var> be a new <a>document</a> that is an <a>HTML document</a>.
50855085

5086-
<li>Set <var>doc</var>'s <a for=Document>content type</a> to "<code>text/html</code>".
5086+
<li><p>Set <var>doc</var>'s <a for=Document>content type</a> to "<code>text/html</code>".
50875087

5088-
<li><a>Append</a> a new <a>doctype</a>, with "<code>html</code>" as its
5088+
<li><p><a>Append</a> a new <a>doctype</a>, with "<code>html</code>" as its
50895089
<a for=DocumentType>name</a> and with its <a>node document</a> set to <var>doc</var>, to
50905090
<var>doc</var>.
50915091

5092-
<li><a>Append</a> a new <{html}> element in the <span>HTML namespace</span>, to
5093-
<var>doc</var>.
5092+
<li><p><a>Append</a> the result of <a>creating an element</a> given <var>doc</var>, <{html}>, and
5093+
the <a>HTML namespace</a>, to <var>doc</var>.
50945094

5095-
<li><a>Append</a> a new <{head}> element in the <span>HTML namespace</span>, to the
5096-
<{html}> element created earlier.
5095+
<li><p><a>Append</a> the result of <a>creating an element</a> given <var>doc</var>, <{head}>, and
5096+
the <a>HTML namespace</a>, to the <{html}> element created earlier.
50975097

50985098
<li>
5099-
If the <var>title</var> argument is not omitted:
5099+
<p>If <var>title</var> is given:
51005100

51015101
<ol>
5102-
<li><a>Append</a> a new <{title}> element in the <a>HTML namespace</a>, to the <{head}>
5103-
element created earlier.
5102+
<li><p><a>Append</a> the result of <a>creating an element</a> given <var>doc</var>, <{title}>,
5103+
and the <a>HTML namespace</a>, to the <{head}> element created earlier.
51045104

5105-
<li><a>Append</a> a new {{Text}} <a>node</a>, with its <a>data</a> set to
5106-
<var>title</var> (which could be the empty string), to the <{title}> element created
5107-
earlier.
5105+
<li><p><a>Append</a> a new {{Text}} <a>node</a>, with its <a>data</a> set to
5106+
<var>title</var> (which could be the empty string) and its <a>node document</a> set to
5107+
<var>doc</var>, to the <{title}> element created earlier.
51085108
</ol>
51095109

5110-
<li><a>Append</a> a new <{body}> element in the <a>HTML namespace</a>, to the <{html}>
5111-
element created earlier.
5110+
<li><p><a>Append</a> the result of <a>creating an element</a> given <var>doc</var>, <{body}>, and
5111+
the <a>HTML namespace</a>, to the <{html}> element created earlier.</li>
51125112

5113-
<li><var>doc</var>'s <a>origin</a> is the <a>origin</a> of the <a>context object</a>'s associated
5114-
<a>document</a>. [[!HTML]]
5113+
<li><p><var>doc</var>'s <a>origin</a> is the <a>origin</a> of the <a>context object</a>'s
5114+
associated <a>document</a>. [[!HTML]]
51155115

5116-
<li>Return <var>doc</var>.
5116+
<li><p>Return <var>doc</var>.
51175117
</ol>
51185118

51195119
The <dfn method for="DOMImplementation"><code>hasFeature()</code></dfn> method, when

dom.html

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2838,21 +2838,35 @@ <h4 class="heading settled" data-level="4.5.1" id="interface-domimplementation">
28382838
</ol>
28392839
<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>
28402840
<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.
28462841
<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>
28482855
<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>
28522861
</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
2867+
associated <a data-link-type="dfn" href="#concept-document">document</a>. <a data-link-type="biblio" href="#biblio-html">[HTML]</a> </p>
2868+
<li>
2869+
<p>Return <var>doc</var>. </p>
28562870
</ol>
28572871
<p>The <dfn class="idl-code" data-dfn-for="DOMImplementation" data-dfn-type="method" data-export="" id="dom-domimplementation-hasfeature"><code>hasFeature()</code><a class="self-link" href="#dom-domimplementation-hasfeature"></a></dfn> method, when
28582872
invoked, must return true.</p>

0 commit comments

Comments
 (0)