Skip to content

Commit

Permalink
Use "create an element" in createHTMLDocument
Browse files Browse the repository at this point in the history
Takes care of part of #212.
  • Loading branch information
domenic authored and annevk committed Apr 19, 2016
1 parent 5fc5624 commit 7b42a54
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 30 deletions.
36 changes: 18 additions & 18 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -5297,39 +5297,39 @@ The
method, when invoked, must run these steps:

<ol>
<li>Let <var>doc</var> be a new <a>document</a> that is an <a>HTML document</a>.
<li><p>Let <var>doc</var> be a new <a>document</a> that is an <a>HTML document</a>.

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

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

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

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

<li>
If the <var>title</var> argument is not omitted:
<p>If <var>title</var> is given:

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

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

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

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

<li>Return <var>doc</var>.
<li><p>Return <var>doc</var>.
</ol>

The <dfn method for="DOMImplementation"><code>hasFeature()</code></dfn> method, when
Expand Down
38 changes: 26 additions & 12 deletions dom.html
Original file line number Diff line number Diff line change
Expand Up @@ -3093,21 +3093,35 @@ <h4 class="heading settled" data-level="4.5.1" id="interface-domimplementation">
</ol>
<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>
<ol>
<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>.
<li>Set <var>doc</var>’s <a data-link-type="dfn" href="#concept-document-content-type">content type</a> to "<code>text/html</code>".
<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>.
<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>.
<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.
<li>
If the <var>title</var> argument is not omitted:
<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>
<li>
<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>
<li>
<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>
<li>
<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
the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, to <var>doc</var>. </p>
<li>
<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
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>
<li>
<p>If <var>title</var> is given: </p>
<ol>
<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.
<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
earlier.
<li>
<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>,
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>
<li>
<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>
</ol>
<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.
<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>
<li>Return <var>doc</var>.
<li>
<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
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>
<li>
<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
associated <a data-link-type="dfn" href="#concept-document">document</a>. <a data-link-type="biblio" href="#biblio-html">[HTML]</a> </p>
<li>
<p>Return <var>doc</var>. </p>
</ol>
<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
invoked, must return true.</p>
Expand Down

0 comments on commit 7b42a54

Please sign in to comment.