Skip to content

Commit a9ad5a8

Browse files
committed
Use "create an element" in createHTMLDocument
Takes care of part of #212.
1 parent 290a529 commit a9ad5a8

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
@@ -5148,39 +5148,39 @@ The
51485148
method, when invoked, must run these steps:
51495149

51505150
<ol>
5151-
<li>Let <var>doc</var> be a new <a>document</a> that is an <a>HTML document</a>.
5151+
<li><p>Let <var>doc</var> be a new <a>document</a> that is an <a>HTML document</a>.
51525152

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

5155-
<li><a>Append</a> a new <a>doctype</a>, with "<code>html</code>" as its
5155+
<li><p><a>Append</a> a new <a>doctype</a>, with "<code>html</code>" as its
51565156
<a for=DocumentType>name</a> and with its <a>node document</a> set to <var>doc</var>, to
51575157
<var>doc</var>.
51585158

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

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

51655165
<li>
5166-
If the <var>title</var> argument is not omitted:
5166+
<p>If the <var>title</var> argument is not omitted:
51675167

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

5172-
<li><a>Append</a> a new {{Text}} <a>node</a>, with its <a>data</a> set to
5173-
<var>title</var> (which could be the empty string), to the <{title}> element created
5174-
earlier.
5172+
<li><p><a>Append</a> a new {{Text}} <a>node</a>, with its <a>data</a> set to
5173+
<var>title</var> (which could be the empty string) and its <a>node document</a> set to
5174+
<var>doc</var>, to the <{title}> element created earlier.
51755175
</ol>
51765176

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

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

5183-
<li>Return <var>doc</var>.
5183+
<li><p>Return <var>doc</var>.
51845184
</ol>
51855185

51865186
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
@@ -2976,21 +2976,35 @@ <h4 class="heading settled" data-level="4.5.1" id="interface-domimplementation">
29762976
</ol>
29772977
<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>
29782978
<ol>
2979-
<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>.
2980-
<li>Set <var>doc</var>’s <a data-link-type="dfn" href="#concept-document-content-type">content type</a> to "<code>text/html</code>".
2981-
<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>.
2982-
<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 <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, to <var>doc</var>.
2983-
<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 <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.
29842979
<li>
2985-
If the <var>title</var> argument is not omitted:
2980+
<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>
2981+
<li>
2982+
<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>
2983+
<li>
2984+
<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>
2985+
<li>
2986+
<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
2987+
the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a> to <var>doc</var>. </p>
2988+
<li>
2989+
<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
2990+
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>
2991+
<li>
2992+
<p>If the <var>title</var> argument is not omitted: </p>
29862993
<ol>
2987-
<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.
2988-
<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
2989-
earlier.
2994+
<li>
2995+
<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>,
2996+
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>
2997+
<li>
2998+
<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>
29902999
</ol>
2991-
<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.
2992-
<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>
2993-
<li>Return <var>doc</var>.
3000+
<li>
3001+
<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
3002+
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>
3003+
<li>
3004+
<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
3005+
associated <a data-link-type="dfn" href="#concept-document">document</a>. <a data-link-type="biblio" href="#biblio-html">[HTML]</a> </p>
3006+
<li>
3007+
<p>Return <var>doc</var>. </p>
29943008
</ol>
29953009
<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
29963010
invoked, must return true.</p>

0 commit comments

Comments
 (0)